Issue digital card

Issue Gift Card

The /api/giftCards/card endpoint allows customers to purchase digital gift cards from brands available in the Netevia system. Upon a successful purchase, the gift card is immediately accessible via the GET /api/giftCards/orders endpoint and the corresponding amount is deducted from the customer's designated financial account. An optional rewards points redemption is supported to offset the purchase cost.

Endpoint

POST /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 selects a brand and denomination from the gift card catalog and initiates a purchase. This is the primary action endpoint for the gift card flow — call it after retrieving available brands and confirming the customer has sufficient funds. The purchased gift card order is immediately trackable and the deducted amount is reflected on the funding account in real time.

Request Body

FieldTypeRequiredDescription
brandIdstringNoUnique identifier of the gift card brand to purchase
faceAmountinteger (int64)NoFace value of the gift card in the smallest currency unit (e.g., cents)
oneTimeCodestringYes6-digit verification code (pattern: ^\d{6}$) used to authorize the purchase
secureOperationTypestringYesVerification method used to generate the one-time code. Allowed values: ShortMessageCode, TimeBasedCode, LegacyTimeBasedCode
fromFinancialAccountIdstringNoID of the financial account from which funds will be deducted. If omitted, the default product funding account is used
rewardsPointsinteger (int32)NoNumber of rewards points to apply toward the purchase cost
{
  "brandId": "brand_abc123",
  "faceAmount": 5000,
  "oneTimeCode": "482917",
  "secureOperationType": "ShortMessageCode",
  "fromFinancialAccountId": "fa_9d8e7f6a5b4c",
  "rewardsPoints": 200
}

Response

200 OK

FieldTypeDescription
idstringUnique identifier of the gift card order
brandIdstringIdentifier of the brand for which the gift card was issued
brandNamestringDisplay name of the gift card brand
logoUrlstringURL of the brand's logo image
urlstringRedemption URL or link associated with the gift card
currencystringCurrency code for the gift card (e.g., USD)
faceAmountinteger (int64)Face value of the gift card
amountinteger (int64)Actual amount charged to the customer's account
discountnumber (double)Discount applied to the purchase, if any
expirationDatestring (date-time)Date and time when the gift card expires, if applicable
createdDatestring (date-time)Date and time the order was created
cancelDatestring (date-time)Date and time the order was canceled, if applicable
issueTransactionIdstringTransaction ID associated with the issuance of the gift card
cancelTransactionIdstringTransaction ID associated with the cancellation, if applicable
statusstringCurrent status of the gift card order. Values: Issued, Canceled
userNamestringDisplay name of the user who placed the order
userIdinteger (int32)Internal identifier of the user who placed the order
{
  "id": "gco_7f3a2b1c9d8e",
  "brandId": "brand_abc123",
  "brandName": "Amazon",
  "logoUrl": "https://cdn.example.com/brands/amazon-logo.png",
  "url": "https://redeem.example.com/gift/7f3a2b1c9d8e",
  "currency": "USD",
  "faceAmount": 5000,
  "amount": 4750,
  "discount": 0.05,
  "expirationDate": "2027-06-30T23:59:59Z",
  "createdDate": "2026-06-08T14:32:00Z",
  "cancelDate": null,
  "issueTransactionId": "txn_1a2b3c4d5e6f",
  "cancelTransactionId": null,
  "status": "Issued",
  "userName": "Jane Smith",
  "userId": 10042
}

Error Codes

CodeWhen it happens
400Missing required fields (oneTimeCode, secureOperationType), invalid one-time code format (must be 6 digits), or insufficient funds in the financial account
401Token missing, expired, or invalid
403Insufficient permissions to purchase gift cards
404Specified brandId or fromFinancialAccountId not found
500Internal server error

Common Mistakes

  • Omitting oneTimeCode or secureOperationType — both are required fields; the request will be rejected with a 400 error if either is missing
  • Supplying a oneTimeCode that does not match the exact 6-digit pattern (^\d{6}$) — codes with letters, spaces, or fewer/more digits will fail validation
  • Using an expired or already-consumed one-time code — generate a fresh code immediately before submitting the purchase request
  • Specifying a fromFinancialAccountId that belongs to a different customer — ensure the account ID matches the authenticated user's account
  • Passing faceAmount in dollars instead of cents — the field expects the smallest currency unit (e.g., 5000 for $50.00)

Related Endpoints

  • GET /api/giftCards/orders — Retrieve the list of gift card orders placed by the customer
  • GET /api/giftCards/brands — List available gift card brands and their supported denominations
  • DELETE /api/giftCards/card/{orderId} — Cancel a previously issued gift card order

Example

curl -X POST https://api.banking.netevia.dev/api/giftCards/card \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "brandId": "brand_abc123",
    "faceAmount": 5000,
    "oneTimeCode": "482917",
    "secureOperationType": "ShortMessageCode",
    "fromFinancialAccountId": "fa_9d8e7f6a5b4c",
    "rewardsPoints": 200
  }'
Body Params
string | null
int32
string | null
int64
string
required
length ≥ 1
^\d{6}$
string
enum
required
Allowed:
Headers
string
enum
Defaults to application/json

Generated from available response content types

Allowed:
string
enum
Defaults to application/json

Generated from available request content types

Allowed:
Response

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
text/plain
application/json
text/json