Overview
Gift cards are digital payment instruments that enable merchants to:- Create branded gift cards with custom cover designs
- Issue cards with specified amounts and currencies
- Track card status and redemption via the query API
- Query merchant account currency balances (separate from any single card) when needed
API Reference
Create Gift Card
Endpoint:POST /v1/pay/gift/create
Creates a new gift card with specified parameters. On success, the response includes the standard status / code / data wrapper; card fields such as card_num, card_key, and numeric status are inside data.
Request Parameters
Response Fields
Successful responses use the common wrapper:status, code, errorMessage, and data. The gift card payload is in data:
Example Request
Example Response
Query Gift Card Cover Templates
Endpoint:GET /v1/pay/gift/temp/list
Retrieves available cover templates for gift card customization.
Response Fields
Successful responses use the common wrapper; templates are returned indata as an array. Each item has:
Example Response
Query merchant account balances
Endpoint:GET /v1/pay/balance
Returns balances for all currencies available on the current merchant account (account-level balances), not a single gift card. There are no query parameters; authentication headers apply as for other Pay APIs.
Response Fields
Example Response
Query Gift Card Details
Endpoint:POST /v1/pay/gift/query
Retrieves gift card details by card number or redemption code. Send a JSON body (not query string). Provide card_number and/or key; if both are sent, key takes priority.
Request body
Response Fields (data)
Example Request
Example Response
Gift card status codes
Thestatus field on gift card records is an integer. Values match the platform enumeration (e.g. GiftCardStatusEnum):
Callback Behavior
Gift cards do not provide asynchronous callbacks. Card status and details should be retrieved withPOST /v1/pay/gift/query. Use GET /v1/pay/balance when you need the merchant account’s multi-currency balances, not a per-card balance.
For information on callback handling for other products, see Notification & Callbacks.
Error Handling
Common platform error codes and how to resolve them are listed below. When querying a gift card, an incorrect key or card number may return5003000.
For more error codes and best practices, see Error Codes & Best Practices.
Integration Guide
Minimum runnable path
Basic Flow
- Retrieve available templates using
GET /v1/pay/gift/temp/list - Create a gift card using
POST /v1/pay/gift/createwith your chosen template - Store the card details (
card_numandcard_keyfrom the create response) securely - Distribute the gift card to your customer
- Query card details with
POST /v1/pay/gift/query(body:card_numberand/orkey). UseGET /v1/pay/balanceonly for merchant account currency balances
Best Practices
- Store both
card_numandcard_keyfor lookups; the query API acceptscard_numberorkeyin the JSON body (if both are sent,keywins) - Use integer
statuscodes from Gift card status codes when branching in your app - Use
card_temp_idfrom the template list astemplateIdwhen creating a card GET /v1/pay/balancereflects merchant account funds by currency, not an individual gift card’s remaining value

