Skip to main content
POST
/
gift_cards
curl https://api.thanxsandbox.com/gift_cards \
  -X POST \
  -H "Content-Type: application/json"  \
  -H "Accept-Version: v4.0" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${token}" \
  -H "X-ClientId: ${client_id}" \
  -d '{
    "provider_id": "prov123merchant",
    "card_number": "1234567890123456",
    "pin": "1234"
  }'
{
  "gift_card": {
    "id": "abc123def456",
    "provider_id": "prov123merchant",
    "card_number": "1234567890123456",
    "pin": "1234",
    "last4": "3456",
    "balance": 50.00,
    "state": "active",
    "expires_at": "2026-12-31T23:59:59Z",
    "created_at": "2024-12-15T10:00:00Z"
  }
}
This endpoint allows users to add a gift card to their account. The card is validated with the gift card provider and the balance is checked before the card is stored. The system prevents duplicate cards — the same card number cannot be added twice for the same user and merchant.
Please review proper request headers here.

Body

provider_id
string
required
The provider merchant ID. This identifies which gift card provider and merchant configuration to use for validation.
card_number
string
required
The full gift card number
pin
string
The PIN code for the gift card, if required by the provider

Response

id
string
Gift card ID
provider_id
string
Provider merchant ID
card_number
string
Full gift card number
pin
string
PIN code (if required by provider)
last4
string
Last 4 digits of the card number
balance
number
Current balance on the gift card (fetched in real-time from provider)
state
enum
Gift card state (active, archived)
expires_at
string
Expiration date in ISO8601 format (nullable)
created_at
string
Time the gift card was added in ISO8601 format
curl https://api.thanxsandbox.com/gift_cards \
  -X POST \
  -H "Content-Type: application/json"  \
  -H "Accept-Version: v4.0" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer ${token}" \
  -H "X-ClientId: ${client_id}" \
  -d '{
    "provider_id": "prov123merchant",
    "card_number": "1234567890123456",
    "pin": "1234"
  }'
{
  "gift_card": {
    "id": "abc123def456",
    "provider_id": "prov123merchant",
    "card_number": "1234567890123456",
    "pin": "1234",
    "last4": "3456",
    "balance": 50.00,
    "state": "active",
    "expires_at": "2026-12-31T23:59:59Z",
    "created_at": "2024-12-15T10:00:00Z"
  }
}