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

  1. Gift card number.
  2. Generate a merchant-specific API token.

Steps

  1. Generate an Ecommerce API key or apiAccessKey.
  2. Send a POST request to the /v1/tokens endpoint. See Create a gift card token endpoint.
  3. Enter information in the following fields:
FieldDescriptionRequired/Optional
numberGift card number.
Length: One of the following: 6-digit, 13-digit, 16-digit, or 19-digit
Format: Numeric only
Required.
apikeyEcommerce API key or apiAccessKey generated in step 1.Required.
security_codeSecurity 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: