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
| Field | Type | Required | Description |
|---|---|---|---|
| brandId | string | No | Unique identifier of the gift card brand to purchase |
| faceAmount | integer (int64) | No | Face value of the gift card in the smallest currency unit (e.g., cents) |
| oneTimeCode | string | Yes | 6-digit verification code (pattern: ^\d{6}$) used to authorize the purchase |
| secureOperationType | string | Yes | Verification method used to generate the one-time code. Allowed values: ShortMessageCode, TimeBasedCode, LegacyTimeBasedCode |
| fromFinancialAccountId | string | No | ID of the financial account from which funds will be deducted. If omitted, the default product funding account is used |
| rewardsPoints | integer (int32) | No | Number 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
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier of the gift card order |
| brandId | string | Identifier of the brand for which the gift card was issued |
| brandName | string | Display name of the gift card brand |
| logoUrl | string | URL of the brand's logo image |
| url | string | Redemption URL or link associated with the gift card |
| currency | string | Currency code for the gift card (e.g., USD) |
| faceAmount | integer (int64) | Face value of the gift card |
| amount | integer (int64) | Actual amount charged to the customer's account |
| discount | number (double) | Discount applied to the purchase, if any |
| expirationDate | string (date-time) | Date and time when the gift card expires, if applicable |
| createdDate | string (date-time) | Date and time the order was created |
| cancelDate | string (date-time) | Date and time the order was canceled, if applicable |
| issueTransactionId | string | Transaction ID associated with the issuance of the gift card |
| cancelTransactionId | string | Transaction ID associated with the cancellation, if applicable |
| status | string | Current status of the gift card order. Values: Issued, Canceled |
| userName | string | Display name of the user who placed the order |
| userId | integer (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
| Code | When it happens |
|---|---|
| 400 | Missing required fields (oneTimeCode, secureOperationType), invalid one-time code format (must be 6 digits), or insufficient funds in the financial account |
| 401 | Token missing, expired, or invalid |
| 403 | Insufficient permissions to purchase gift cards |
| 404 | Specified brandId or fromFinancialAccountId not found |
| 500 | Internal server error |
Common Mistakes
- Omitting
oneTimeCodeorsecureOperationType— both are required fields; the request will be rejected with a 400 error if either is missing - Supplying a
oneTimeCodethat 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
fromFinancialAccountIdthat belongs to a different customer — ensure the account ID matches the authenticated user's account - Passing
faceAmountin dollars instead of cents — the field expects the smallest currency unit (e.g.,5000for $50.00)
Related Endpoints
GET /api/giftCards/orders— Retrieve the list of gift card orders placed by the customerGET /api/giftCards/brands— List available gift card brands and their supported denominationsDELETE /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
}'