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 an ecommerce app integration in the Global Developer Dashboard. See Get started with the Global Developer Dashboard.
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-use card token returns. The token is alphanumeric and begins with clv_. Example: clv_1ABCDefgHI23jKL4m5nOPqR
Request example
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"
}
}
'
Response example
{
"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 example
curl --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
}'
Response example
{
"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_1ABCDefgHI23jKL4m5nOPqR",
"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": "4111111111111111"
}
}
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 example
curl --location 'https://scl-dev1.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_credential_on_file",
"stored_credentials": {
"initiator": "MERCHANT",
"sequence": "FIRST",
"is_scheduled": false
}
}'
Response example
{
"id": "3NHSD5ESJE0JE",
"saved_credentials_on_file": {
"tokenType": "TRANSARMOR",
"value": "4111111111111111"
}
}
Updated 20 days ago