Create a gift card token
To process secure gift card payment, you require a single-pay Clover gift card token, which is a unique code that indicates gift card details and metadata.
Prerequisites
- Gift card number.
- Generate a merchant-specific API token.
Steps
- Generate an Ecommerce API key or
apiAccessKey. - Send a POST request to the
/v1/tokensendpoint. See Create a gift card token endpoint. - Enter information in the following fields:
| Field | Description | Required/Optional |
|---|---|---|
number | Gift card number. Length: One of the following: 6-digit, 13-digit, 16-digit, or 19-digit Format: Numeric only | Required. |
apikey | Ecommerce API key or apiAccessKey generated in step 1. | Required. |
security_code | Security card value (SCV) associated with a Clover gift card. Length: 4-8 characters | Optional. |
A single-pay Clover gift card token (cToken) is returned in the response. The token is alphanumeric and begins with clv_. Example: clv_1TSTSECWntExtCdPXnbFjkgN
Request and Response example—Single-pay gift card token
Request a single-pay gift gift card token using a Clover gift card number and secure code value (SCV).
curl --request POST \
--url 'https://token-sandbox.dev.clover.com/v1/tokens' \
--header 'apikey: 12cda345c6c78e90a120a345df67890e'
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"gift_card": {
"card_number": "98765432100",
"security_code": "785577",
}
}{
"id": "clv_1TSTSExxxxxxxxxPXnbFjkgN",
"object": "token",
"giftCard": {
"last4": "2100"
}
}Use the single-pay gift card token with the following endpoints:
Updated 4 days ago
