Skip to main content
POST
C#
This endpoint requires the gift-cards.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

idempotency-key
string | null

A unique key that identifies this request. If supported by the gift card service, the value will be forwarded to make the activation idempotent. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.

x-gr4vy-merchant-account-id
string | null

The ID of the merchant account to use for this request.

Example:

"default"

Body

application/json

The details used to activate a physical gift card.

number
string
required

The 16-19 digit number for the gift card.

Required string length: 16 - 19
Pattern: ^\d+$
Example:

"4123455541234561234"

pin
string | null

The PIN for this gift card.

Minimum string length: 1
Example:

"1234"

amount
integer | null

The amount to load onto the gift card, in the smallest denomination for the currency. Required if currency is provided.

Required range: 0 <= x <= 99999999
Example:

5000

currency
string | null

The ISO-4217 currency code for the amount. Required if amount is provided.

Pattern: ^[A-Z]{3}$
Example:

"USD"

external_identifier
string | null

An optional external identifier for this activation.

Required string length: 1 - 200
Example:

"order-12345"

store
boolean
default:false

Whether to store the activated gift card in the vault. When true, a pin is required.

Example:

false

buyer_id
string<uuid> | null

The ID of the buyer to associate this gift card to. Only allowed when store is true. If this field is provided then the buyer_external_identifier field needs to be unset.

Example:

"fe26475d-ec3e-4884-9553-f7356683f7f9"

buyer_external_identifier
string | null

The external_identifier of the buyer to associate this gift card to. Only allowed when store is true. If this field is provided then the buyer_id field needs to be unset.

Required string length: 1 - 200
Example:

"user-789123"

Response

Successful Response

id
string<uuid>
required

The ID for the gift card.

Example:

"356d56e5-fe16-42ae-97ee-8d55d846ae2e"

merchant_account_id
string
required

The ID of the merchant account this buyer belongs to.

Example:

"default"

gift_card_service
GiftCardService · object
required

The service this gift card belongs to.

bin
string
required

The first 6 digits of the full gift card number.

Example:

"412345"

sub_bin
string
required

The 3 digits after the bin of the full gift card number.

Example:

"554"

last4
string
required

The last 4 digits for the gift card.

Example:

"1234"

created_at
string<date-time>
required

The date this gift card record was created at.

Example:

"2013-07-16T19:23:00.000+00:00"

updated_at
string<date-time>
required

The date this gift card record was last updated at.

Example:

"2013-07-16T19:23:00.000+00:00"

usage_count
integer
required

The number of times this gift card has been used in transactions.

Example:

100

cit_usage_count
integer
required

The number of times this gift card has been used in transactions for client initiated transactions.

Example:

50

type
string
default:gift-card

Always gift-card.

Allowed value: "gift-card"
Example:

"gift-card"

expiration_date
string<date-time> | null

The date and time when this gift card expires. This is a full date/time and may be more accurate than the actual expiry date received by the gift card service.

Example:

"2013-07-16T19:23:00.000+00:00"

buyer
Buyer · object | null

The buyer for which this gift card is stored.

last_used_at
string<date-time> | null

The timestamp when this gift card was last used in a transaction.

Example:

"2013-07-16T19:23:00.000+00:00"

cit_last_used_at
string<date-time> | null

The timestamp when this gift card was last used in a transaction for client initiated transactions.

Example:

"2013-07-16T19:23:00.000+00:00"