Use existing TransArmor tokens

North America—United States and Canada

Use your existing TransArmor token with the create a charge and pay for an order endpoints.

Prerequisites

  1. Create an ecommerce app integration in the Global Developer Dashboard. See Get started with the Global Developer Dashboard.
  2. Existing TransArmor® token. See Create a TransArmor token.

Create a TransArmor token

  1. Generate a PAKMS key.
  2. Send a POST request to the v1/tokens endpoint.
  3. Expand the external_token object.
  4. Enter values in the required fields.
FieldDescriptionRequire/Optional
token_valueValue of the TransArmor token.Required
token_typeType of the multi-pay token such as TransArmor.Required
exp_monthCard expiration month in 2-digit format.
Format: mm
Required
exp_yearCard expiration year in 2- or 4-digit format.
Format: yy or yyyy
Required
apikeyPublic Ecommerce API key associated with a specific merchant and developer app. Use Retrieve an Ecommerce API key or PAKMS key to generate this key.Required

In the response, a <<mul returns. This token is alphanumeric and begins with clv_. Example: clv_1ABCDefgHI23jKL4m5nOPqR

Request and response example—Create a multi-pay Clover token

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 '{
  "external_token": {
    "transarmor_token_attribute": {
      "exp_month": "12",
      "exp_year": "2027"
    },
    "token_value": 1234567890,
    "token_type": "TRANSARMOR"
  }
}
'
{  
    "id": "clv_1ABCDefgHI23jKL4m5nOPqR",  
    "object": "token",  
    "": {  
        "last4": ""  
    }  
}

Option 1: Create a charge with an existing TransArmor token

  1. Send a POST request to the v1/charges endpoint.
  2. Enter values in the following required parameters:
    1. amount
    2. currency
    3. source
  3. Under the stored_credentials object, select SUBSEQUENT as the sequence.
    The response returns a multi-pay TransArmor token. You can use this token for recurring and multi-pay transactions.

Request and response example—Create a charge with a TA token

curl --request POST \
     --url 'https://scl-sandbox.dev.clover.com/v1/charges' \
     --header 'Accept: application/json' \
     --header 'Authorization: Bearer ab86****-****-****-****-*****9867833' \
     --header 'Content-Type: application/json' \
     --header 'x-forwarded-for: {client_ip}' \
     --data '{
    "ecomind":"ecom"
    "amount": 122,
    "currency": "USD",
    "capture": false,
    "source": "clv_1ABCDefgHI23jKL4m5nOPqR",
    "stored_credentials": {
        "initiator": "MERCHANT",
        "sequence": "SUBSEQUENT",
        "is_scheduled": false
     }'
{
    "id": "3NHSD5ESJE0JE",
…
    "saved_credentials_on_file": {
        "tokenType": "TRANSARMOR",
        "value": "122754**********"
    }
…
}

Option 2: Pay for an order with an existing TransArmor token

  1. Send a POST request to v1/orders/{orderId}/pay endpoint.
  2. Enter values in the following required parameters:
    1. orderId
    2. source
  3. Under the stored_credentials object, select SUBSEQUENT as the sequence.
    In the response, a multi-pay TransArmor token returns. You can use this token for recurring and multi-pay transactions.

Request and response example—Pay for an order with a TA token

curl --location 'https://scl-sandbox.dev.clover.com/v1/orders/3NHSD5ESJE0JE/pay' \
--header 'Authorization: Bearer ab86****-****-****-****-*****9867833' \
--header 'X-Clover-Merchant-Id: A2J94abcde851' \
--header 'Content-Type: application/json' \
--data '{
    "source": "clv_1ABCDefgHI23jKL4m5nOPqR",
    "stored_credentials": {
        "initiator": "MERCHANT",
        "sequence": "FIRST",
        "is_scheduled": false
    }
}'
{
    "id": "3NHSD5ESJE0JE",
…
    "saved_credentials_on_file": {
        "tokenType": "TRANSARMOR",
        "value": "122754**********"
    }
…
}