# Cards

Source: https://docs.globagift.io/docs/api/reference/cards
Description: Issue gift cards, read them, and suspend, release or void them.


## Issue a gift card

`POST /v1/cards`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: send an Idempotency-Key header. Repeating the request with the same key and the same body returns the original result; the same key with a different body returns 409 idempotency_key_conflict.

Parameters:

- `Idempotency-Key` (header, required, string)

Request body:

- `card_product_id` (string, required)
- `amount` (integer, required)
- `recipient_email` (string): Required when delivery_channel is email. The gift card is emailed to this address.
- `payment_reference` (string): Optional store payment reference for till reconciliation.
- `acceptance_point_id` (string (uuid)): Optional store or till that issued the card.
- `recipient_phone` (string): E.164 phone. Required when delivery_channel is whatsapp.
- `delivery_channel` (string: qr, email, whatsapp): How to deliver the card. Default qr, or email when recipient_email is set.
- `whatsapp_consent` (boolean): Must be true when delivery_channel is whatsapp (Meta opt-in).

Responses:

- 201: Card issued (200 on idempotent replay)
- 400: Idempotency key missing or malformed
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: No such card product
- 409: Idempotency key conflict or state conflict
- 422: Invalid amount
- default: Unexpected server error

## List cards with cursor pagination and composable filters

`GET /v1/cards`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Parameters:

- `after_cursor` (query, string)
- `limit` (query, integer)
- `state` (query, string: created, active, partially_redeemed, depleted, suspended, fraud_hold, expired, voided)
- `issued_from` (query, string (date-time)): Inclusive date/time boundary for the resource timestamp named by this parameter.
- `issued_to` (query, string (date-time)): Inclusive date/time boundary for the resource timestamp named by this parameter.
- `order_id` (query, string (uuid))
- `recipient_email` (query, string)
- `last4` (query, string)

Responses:

- 200: Cards page
- 400: Validation failed
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- default: Unexpected server error

## Get a single card

`GET /v1/cards/{id}`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Parameters:

- `id` (path, required, string)

Responses:

- 200: Card
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- default: Unexpected server error

## Look up a card by redemption code for POS balance check and redeem confirm

`GET /v1/pos/cards/lookup`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Parameters:

- `code` (query, required, string)

Responses:

- 200: Card balance and status for the POS terminal
- 400: Missing or invalid code
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- 422: The card could not be looked up
- default: Unexpected server error

## Suspend a card

`POST /v1/cards/{id}/suspend`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: not idempotent. After an unclear failure, read the current state before trying again.

Parameters:

- `id` (path, required, string)

Responses:

- 200: Card suspended
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- 409: Invalid state transition
- default: Unexpected server error

## Release a suspended card

`POST /v1/cards/{id}/release`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: not idempotent. After an unclear failure, read the current state before trying again.

Parameters:

- `id` (path, required, string)

Responses:

- 200: Card released
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- 409: Invalid state transition
- default: Unexpected server error

## Void a card

`POST /v1/cards/{id}/void`

Authentication: Merchant API key (`Authorization: Bearer gg_...`)

Retries: not idempotent. After an unclear failure, read the current state before trying again.

Parameters:

- `id` (path, required, string)

Responses:

- 200: Card voided
- 401: Authentication failed
- 403: Authenticated caller lacks permission or the account is unavailable
- 404: Not found
- 409: Invalid state transition
- default: Unexpected server error
