Skip to main content

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
For request headers, signature rules, and callback verification, refer to Authentication & Security.

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 in data 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

The status 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 with POST /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 return 5003000. For more error codes and best practices, see Error Codes & Best Practices.

Integration Guide

Minimum runnable path

For a first integration, validate the lifecycle of a single gift card first, then expand to batch issuance, campaign fulfillment, or membership-related use cases.

Basic Flow

  1. Retrieve available templates using GET /v1/pay/gift/temp/list
  2. Create a gift card using POST /v1/pay/gift/create with your chosen template
  3. Store the card details (card_num and card_key from the create response) securely
  4. Distribute the gift card to your customer
  5. Query card details with POST /v1/pay/gift/query (body: card_number and/or key). Use GET /v1/pay/balance only for merchant account currency balances

Best Practices

  • Store both card_num and card_key for lookups; the query API accepts card_number or key in the JSON body (if both are sent, key wins)
  • Use integer status codes from Gift card status codes when branching in your app
  • Use card_temp_id from the template list as templateId when creating a card
  • GET /v1/pay/balance reflects merchant account funds by currency, not an individual gift card’s remaining value