Create a TransArmor token
North America—United States and Canada
Create a TransArmor token to use with the Create a charge and Pay for an order endpoints.
Prerequisites
- Create a global developer account and select the API checkbox in the Ecommerce Settings.
- Do one of the following:
- If you are using the tokenization services for a single merchant or to run test scenarios, generate Ecommerce API tokens (public and private keys). Use the keys as follows:
- Public key—Use as the Ecommerce API key or
apiAccessKey
for card, gift card, or ACH tokenization without the need to generate a separate PAKMS key. - Private key—Set as the Bearer token in the Authorization header to use Ecommerce APIs.
- Public key—Use as the Ecommerce API key or
- If you are using tokenization services for a merchant with multiple businesses or in the production environment, generate OAuth
access_token
andrefresh_token
pair to initiate the v2/OAuth flow.
Create a single-pay card token
- Generate a PAKMS key.
- Send a POST request to the v1/tokens endpoint. See the Create a card token tutorial for more information.
- Enter information in the following required fields:
number
exp_month
exp_year
cvv
apikey
A single-pay token returns. The token is alphanumeric and begins with clv_. Example: clv_1ABCDefgHI23jKL4m5nOPqR
Request and response example—Create a single-pay card token
curl --request POST \
--url https://token-sandbox.dev.clover.com/v1/tokens \
--header 'accept: application/json' \
--header 'apikey: 7aacxxxx-xxxx-xxxx-xxxx-xxxxxxxxcae2' \
--header 'content-type: application/json' \
--data '{
"card": {
"brand": "MC",
"number": "5000-0000-0000-1236",
"exp_month": "12",
"exp_year": "2025",
"cvv": "121"
}
}'
{
"id": "clv_1ABCDefgHI23jKL4m5nOPqR",
"object": "token",
"card": {
"exp_month": "12",
"exp_year": "2025",
"first6": "542418",
"last4": "3333",
"brand": "VISA"
}
}
Use the single-pay Clover token or c-token as the source
parameter of either of the following endpoints to generate a TransArmor® token:
Option 1: Use Create a charge
endpoint to generate a TransArmor token
Create a charge
endpoint to generate a TransArmor token- Send a POST request to the v1/charges endpoint.
- Enter values in the following required parameters in the request:
amount
currency
source
(clv_ token - obtained from the response of v1/token)
- In
intent
attribute, select save_credentials_on_file. - Under the
stored_credentials
object, select FIRST as thesequence
.
In the response, a multi-pay TransArmor token and a multipay c-token return. You can use this token for recurring and multi-pay transactions.
Request and response example—Generate a TA token from the Create a charge
endpoint
Create a charge
endpointcurl --request POST \
--url 'https://scl-sandbox.dev.clover.com/v1/charges' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer 7aacxxxx-xxxx-xxxx-xxxx-xxxxxxxxcae2' \
--header 'Content-Type: application/json' \
--header 'x-forwarded-for: {client_ip}' \
--data '{
"ecomind":"ecom",
"amount": 122,
"currency": "USD",
"capture": false,
"source": "clv_1ABCDefgHI23jKL4m5nOPqR",
"intent": "save_credential_on_file",
"stored_credentials": {
"initiator": "MERCHANT",
"sequence": "FIRST",
"is_scheduled": false
}'
{
"id": "WZ1E7AQ16S5DY",
"amount": "amount": 122,
"payment_method_details": "card",
"amount_refunded": 0,
"currency": "USD",
"created": 1721846264976,
"captured": false,
"ref_num": "420600610870",
"auth_code": "OK6564",
"outcome": {
"network_status": "approved_by_network",
"type": "authorized"
},
"status": "succeeded",
"source": {
"id": "clv_1TSTS*****************66",
"address_line1_check": "pass",
"address_zip": "11747",
"address_zip_check": "pass",
"brand": "VISA",
"exp_month": "02",
"exp_year": "2026",
"first6": "400551",
"last4": "0004"
},
"external_reference_id": "8KMRJY0S5RQ1R",
"saved_credentials_on_file": {
"tokenType": "TRANSARMOR",
"value": "88************58"
}
}
Option 2: Use Pay for an order
endpoint to generate a TransArmor token
Pay for an order
endpoint to generate a TransArmor token- Send a POST request to v1/orders/{orderId}/pay endpoint.
- Enter values in the following required parameters in the request:
orderId
source
(clv_ token - obtained from the response of v1/token)
- In
intent
attribute, select save_credentials_on_file. - Under the
stored_credentials
object, select FIRST insequence
.
In the response, a multi-pay TransArmor token and a multipay c-token return. You can use this token for recurring and multi-pay transactions.
Request and response example—Generate a TA token from the Pay for an order
endpoint
Pay for an order
endpointcurl --location 'https://scl-sandbox.dev.clover.com/v1/orders/3NHSD5ESJE0JE/pay' \
--header 'Authorization: Bearer XXX' \
--header 'X-Clover-Merchant-Id: A2J94WZSZW851' \
--header 'Content-Type: application/json' \
--data '{
"source": "clv_1ABCDefgHI23jKL4m5nOPqR",
"intent": "save_credentials_on_file",
"stored_credentials": {
"initiator": "MERCHANT",
"sequence": "FIRST",
"is_scheduled": false
}
}'
{
"id": "3NHSD5ESJE0JE",
"saved_credentials_on_file": {
"tokenType": "TRANSARMOR",
"value": "4111111111111111"
}
}
Updated 2 days ago