Restore Digital Card

Cancel Gift Card

This endpoint cancels a previously purchased digital gift card and credits the corresponding amount back to the customer's funding account. Once cancelled, the card will no longer appear in the list returned by GET /api/giftCards/orders. A one-time SMS verification code is required to authorize the cancellation.

Endpoint

DELETE /api/giftCards/card

Authentication

Bearer token required. Obtain via:

POST https://api.banking.netevia.dev/api/auth/v2

Include in header: Authorization: Bearer {token}
Token lifetime: 10 minutes. Refresh via POST /api/auth/refresh.

When to use

Use this endpoint when a customer wants to cancel a gift card they have already purchased and recover the funds back to their financial account. This is applicable only to cash-purchased gift cards — gift cards acquired via rewards points are managed through a separate endpoint. SMS verification is required to confirm the cancellation is authorized.

Query Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the gift card order to cancel. Obtained from the gift card order record.

Response

200 OK

The gift card has been successfully cancelled and the face amount has been credited back to the customer's funding financial account. The card will no longer appear in gift card order listings.

"Success"

Error Codes

CodeWhen it happens
400The gift card ID is missing, malformed, or the card is not eligible for cancellation (e.g., already used or already cancelled)
401Token missing, expired, or invalid
403Insufficient permissions — the caller does not own the gift card or lacks authorization
404Gift card with the specified ID not found
500Internal server error

Common Mistakes

  • Omitting the id query parameter — the gift card order ID is required; the request will fail without it.
  • Attempting to cancel a gift card purchased with rewards points — those must be handled via DELETE /api/UsersReward/exchange/giftcard or the appropriate rewards endpoint, not this one.
  • Sending the request with an already-used or already-cancelled card ID — the card must be active and unused to be eligible for cancellation.
  • Using a stale Bearer token — tokens expire after 10 minutes; refresh before making the call.

Related Endpoints

  • GET /api/giftCards/orders — Retrieve the list of purchased gift card orders; use this to find the gift card id before cancelling.
  • GET /api/giftCards/brands — Retrieve available gift card brands and their denominations.
  • POST /api/giftCards/card — Purchase a new digital gift card.
  • GET /api/UsersReward/exchange/giftcard — Manage gift cards purchased through rewards points redemption.

Example

curl -X DELETE "https://api.banking.netevia.dev/api/giftCards/card?id=GC-ORDER-ID-HERE" \
  -H "Authorization: Bearer YOUR_TOKEN"
Query Params
string
Response
200

Success

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here!