Create a gift card token
United States
A gift card is a prepaid payment card used to make purchases at participating restaurants, stores, or online retailers. A gift card can have different denominations. You can redeem the value of these cards for services, merchandise, or even cash, depending on the terms and conditions set by the card issuer.
Prerequisites
To process secure gift card payments, you need one of the following:
- Native gift card with a SCV (security code value). Clover Gift Card uses the integrated gift card solution payment gateway from Fiserv.
- Non-native gift card with an FCA (foreign access code). This is a non-Fiserv gift card or a gift card that does not use the Fiserv payment gateway.
Steps
- Generate an Ecommerce API key or
apiAccessKey
. - Send a POST request to the
/v1/tokens
endpoint. See Create a gift card token. - Enter information in the required fields.
Field | Description | Require/Optional |
---|---|---|
card_number | Gift card number. Length: One of the following: 6-digit, 13-digit, 16-digit, or 19-digit | Required |
security_code | Encrypted security code associated with the gift card. Length: 4-8 characters | Optional |
foreign_access_code | Foreign access code for merchants converting to CLGC (closed loop gift card) from an external gift card program, if applicable. | Required in case of non-Fiserv gift cards |
apikey | Universally unique identifier (ID) of the API. Public API key associated with the specific merchant and developer app. | Required |
A single-use gift card token is returned in the response. The token is alphanumeric and begins with clv_. Example: clv_1TSTSECWntExtCdPXnbFjkgN
- Use the gift card token for a single transaction to:
Request example
curl --request POST \
--url 'https://token-sandbox.dev.clover.com/v1/tokens' \
--header 'apikey: xxx'
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"gift_card": {
"card_number": "98765441066",
"security_code": "785577",
"foreign_access_code": "67755"
}
}'
Response example
{
"id": "clv_1TSTSECWntExtCdPXnbFjkgN",
"object": "token",
"giftCard": {
"last4": "1066"
}
}
Updated 18 days ago