Create a TransArmor token

North America—United States and Canada

Create a TransArmor token to use with create a charge and pay for an order in the Clover Ecommerce network.

Prerequisites

  1. Set up a sandbox developer account.
  2. Create an app in the sandbox. See also Ecommerce app permissions.

Steps

  1. Generate a PAKMS key.
  2. Send a POST request to the v1/token endpoint. See the create a card token tutorial for more information.
    In the response, a single-pay Clover token or c-token(clv_1ABCDefgHI23jKL4m5nOPqR) returns.
  3. Use the single-pay Clover token or c-token with the source parameter of either of the following endpoints to generate a TA token:

Use Create a charge to generate a TA token

Send a POST request to the v1/charges endpoint.

  1. Enter values in the following required parameters in the request:
    1. amount
    2. currency
    3. source (clv_ token - obtained from the response of v1/token)
  2. In intent attribute, select save_credentials_on_file.
  3. Under the stored_credentials object, select FIRST in sequence.
    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"
    }
}

Use Pay for an order to generate a TA token

Send a POST request to v1/orders/{orderId}/pay endpoint.

  1. Enter values in the following required parameters in the request:
    1. orderId
    2. source (clv_ token - obtained from the response of v1/token)
  2. In intent attribute, select save_credentials_on_file.
  3. Under the stored_credentials object, select FIRST in sequence.
    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"
    }
}