Recurring Payments Service Customer Token

Customer Token Controller

Get Tokens for a Customer

get
Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Responses
200
OK
get
GET //rest/v2/customers/{customerKey}/tokens HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
{
  "code": 200,
  "emvUrl": "text",
  "exchange-id": "ID_38839393-3938383-484848484",
  "gatewayUrl": "text",
  "links": [
    {
      "href": "/rest/v2/transactions?id=846512",
      "id": 846512,
      "rel": "transaction"
    }
  ],
  "page": {
    "first": false,
    "last": false,
    "number": 4,
    "number-of-elements": 102,
    "size": 4,
    "sort": {
      "field": {
        "ANY_ADDITIONAL_PROPERTY": "text"
      }
    },
    "total-elements": 102,
    "total-pages": 4
  },
  "payload": {
    "payloadType": "text"
  },
  "signature": "text",
  "status": "SUCCESS",
  "urls": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  },
  "vaultUrl": "text"
}

Add an existing token to a customer

post

Plan must have a customer-key from a previously related customer. Use url https://gateway-sb.clearent.net/rest/v2/tokens You can POST application/xml or application/json to the service. Make sure you include a valid api-key in the header.

Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Body
avs-addressstringOptional

Street address associated with the card

Example: 123 example street
avs-zipstringOptional

zip code of street address assoicated with the card

Example: 123445
card-typestring · enumRequired

Type of card

Example: VISAPossible values:
customer-keystringRequired

Customer Identifier

Example: custID-dkke-8383-ek999
defaultbooleanOptional

true if this is the default card for the customer

Example: true
descriptionstringOptional

description of card

Example: joint debit
exp-datestringRequired

Expire date of the card

Example: 0932
last-four-digitsstringRequired

last 4 digits of card number

Example: 5678
token-idstringRequired

Token that represents to card number

Example: 11000383833939380000
Responses
200
OK
post
POST //rest/v2/customers/{customerKey}/tokens HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/json
Accept: */*
Content-Length: 229

{
  "avs-address": "123 example street",
  "avs-zip": 123445,
  "card-type": "VISA",
  "customer-key": "custID-dkke-8383-ek999",
  "default": true,
  "description": "joint debit",
  "exp-date": "0932",
  "last-four-digits": 5678,
  "token-id": 11000383833939380000
}
{
  "avs-address": "123 example street",
  "avs-zip": 123445,
  "card-type": "VISA",
  "customer-key": "custID-dkke-8383-ek999",
  "default": true,
  "description": "joint debit",
  "exp-date": "0932",
  "last-four-digits": 5678,
  "token-id": 11000383833939380000
}

Update a Token

put

You can do an HTTP PUT on the field you want to modify. There are only 3 modifiable fields on a token; customer-key, status (ACTIVE, INACTIVE, DELETED), description. Anything else you want to modify with a token, you will need to delete and re-add. First, you will need to add the token-id, that was returned on the creation of the token, to the end of the URL: https://gateway-sb.clearent.net/rest/v2/tokens/TOKEN-ID-HERE

Path parameters
customerKeyanyRequired

customerKey

Header parameters
api-keyanyRequired

api-key-value

Body
avs-addressstringOptional

Street address associated with the card

Example: 123 example street
avs-zipstringOptional

zip code of street address assoicated with the card

Example: 123445
card-typestring · enumRequired

Type of card

Example: VISAPossible values:
customer-keystringRequired

Customer Identifier

Example: custID-dkke-8383-ek999
defaultbooleanOptional

true if this is the default card for the customer

Example: true
descriptionstringOptional

description of card

Example: joint debit
exp-datestringRequired

Expire date of the card

Example: 0932
last-four-digitsstringRequired

last 4 digits of card number

Example: 5678
token-idstringRequired

Token that represents to card number

Example: 11000383833939380000
Responses
200
OK
put
PUT //rest/v2/customers/{customerKey}/tokens HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/json
Accept: */*
Content-Length: 229

{
  "avs-address": "123 example street",
  "avs-zip": 123445,
  "card-type": "VISA",
  "customer-key": "custID-dkke-8383-ek999",
  "default": true,
  "description": "joint debit",
  "exp-date": "0932",
  "last-four-digits": 5678,
  "token-id": 11000383833939380000
}
{
  "avs-address": "123 example street",
  "avs-zip": 123445,
  "card-type": "VISA",
  "customer-key": "custID-dkke-8383-ek999",
  "default": true,
  "description": "joint debit",
  "exp-date": "0932",
  "last-four-digits": 5678,
  "token-id": 11000383833939380000
}

Was this helpful?