Skip to main content

Issue Gift Card

Create a new gift card from a template. The platform generates the card's secrets and returns them once — this response is your only opportunity to capture them.

Endpoint

POST /v1/giftCards

Headers

HeaderTypeDescriptionRequired
X-Client-IdStringYour client ID✅ Yes
X-Client-SecretStringYour client secret✅ Yes
Content-TypeStringapplication/json✅ Yes

Request Body

FieldTypeDescriptionRequired
giftCardTemplateIdString (UUID)The template to issue from✅ Yes

That is the entire body. Denomination, currency, expiry and redemption rules are all fixed on the template — see Setup Flow.

Example Request

curl --location 'https://stage-platform-exlr8-incentives.exlr8now.com/v1/giftCards' \
--header 'X-Client-Id: YOUR_CLIENT_ID' \
--header 'X-Client-Secret: YOUR_CLIENT_SECRET' \
--header 'Content-Type: application/json' \
--data '{
"giftCardTemplateId": "d4c3b2a1-6f5e-4d3c-8b2a-1f0e9d8c7b6a"
}'

Response

Successful Response — 201 Created

{
"success": true,
"data": {
"giftCardId": "9b2c4d6e-8f0a-4b1c-9d3e-5f7a1b2c3d4e",
"digitalCode": "GC-7F3A-9K2M-4XQ8",
"cardNumber": "6011457893214567",
"pin": "4821"
}
}

Response Fields

FieldTypeDescription
giftCardIdStringInternal identifier. Store this — refunds and voids reference it
digitalCodeStringThe code the customer presents to redeem
cardNumberStringLuhn-valid card number, always issued
pinStringPIN, always issued

:::caution Returned exactly once Only hashes of digitalCode, cardNumber and pin are stored. They cannot be retrieved again by any endpoint. Deliver them to the customer and persist whatever you need before you acknowledge this response. :::

Behaviour

The campaign must be active. Issuance is refused with PROGRAM_INACTIVE if the campaign behind the template is DRAFT, PAUSED, EXPIRED or ARCHIVED. A campaign also expires automatically once it passes its endAt, so a previously working integration can start failing without anyone changing anything — surface this error clearly rather than retrying.

Caps are enforced at issuance, atomically. The cap reservation and the card insert commit together, so counters never drift from the cards that exist. Two caps apply:

  • The template's own count and value caps → TEMPLATE_LIMIT_EXCEEDED
  • The campaign's value budgetCAMPAIGN_LIMIT_EXCEEDED

Note that a campaign's count cap governs how many templates may exist under it, not how many cards you issue. Only its value budget is consumed here, by the card's face value.

Velocity limits are enforced. If the campaign carries a rolling value limit (per day, month or year), issuance that would breach the window is rejected with CAMPAIGN_LIMIT_EXCEEDED — the same code as the lifetime budget. The two are not distinguishable from the code alone; read the message to tell them apart when diagnosing.

Neither cap is retryable — an administrator must raise the limit.

Expiry is set now. With FROM_ISSUANCE, the card's expiry is computed from this moment plus the template's validity period. With FIXED_DATE, every card shares one date regardless of when it was issued.

Issuance is not idempotent. Unlike redemption, this endpoint takes no idempotency key — two calls create two cards. If a call times out, look the card up with List Gift Cards before retrying, or accept that an unused card may be stranded.

Error Responses

Error codeHTTPCause
BAD_REQUEST400Missing or malformed giftCardTemplateId, or an unknown field
TEMPLATE_NOT_FOUND404No such template within your merchant
PROGRAM_NOT_FOUND404The template points at a campaign that no longer exists
PROGRAM_INACTIVE422The campaign is not ACTIVE
TEMPLATE_LIMIT_EXCEEDED422The template's count or value cap is reached
CAMPAIGN_LIMIT_EXCEEDED422The campaign's value budget or velocity window is exhausted
INTERNAL_SERVER_ERROR500Platform fault
{
"success": false,
"errCode": "PROGRAM_INACTIVE",
"message": "Program is inactive: program is not ACTIVE"
}