Tokens

Token Controller

Search Tokens

get

If you have enabled the multi merchant feature, then your search will include tokens for all related merchants

Query parameters
token-idanyOptional

ID of the token. This is Clearent's identifier

merchant-legacy-token-idanyOptional

If you provide a field called 'merchant-legacy-token-id' as a url parameter you can retrieve the token that corresponds with your identifier

updated-start-dateanyOptional

filters the tokens list by the updated date/time. Setting updated start date will return tokens that were processed after this date/time. Setting both updated start and end date creates a range

updated-end-dateanyOptional

use with updated start date to create range

date-filteranyOptional

Preset date filters. Provide updated-start-date and updated-end-date if custom_range is selected

date-formatanyOptional

If updated-start-date and updated-end-date are provided the date-format is required

pageanyOptional

page number

page-sizeanyOptional

page-size

isDescendinganyOptional

list results in descending order, default is true

Header parameters
api-keyanyRequired

api-key-value

Responses
200
Success
get
GET //rest/v2/tokens HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
<?xml version="1.0"?>
<object>
	<payloadType>text</payloadType>
	<tokens>
		<token>
			<authorization-code>ACH789</authorization-code>
			<avs-address>123 example</avs-address>
			<avs-zip>123456</avs-zip>
			<card-type>VISA</card-type>
			<created>09/19/2016 08:06:78</created>
			<description>joint checking</description>
			<exp-date>0919</exp-date>
			<last-four-digits>5678</last-four-digits>
			<merchant-id>text</merchant-id>
			<merchant-legacy-token-id>text</merchant-legacy-token-id>
			<software-vendor-name>text</software-vendor-name>
			<status>Active</status>
			<times-used>5</times-used>
			<token-id>10009993322221111</token-id>
			<token-status>Open</token-status>
			<updated>09/19/2016 08:06:78</updated>
			<avs-result-code>X</avs-result-code>
			<customer-first-name>John</customer-first-name>
			<customer-key>customer123</customer-key>
			<customer-last-name>Doe</customer-last-name>
			<default>false</default>
			<token-update-status>UPDATED</token-update-status>
		</token>
	</tokens>
</object>

Create a token

post
Header parameters
api-keyanyRequired

api key

Body
avs-addressstringOptional

Address Associated with the Card data (Needed for qualification)

Example: 123 example Street
avs-zipstringOptional

ZipCode Associated with the Card data (Needed for qualification)

Example: 85284
cardstringOptional

Card Number required if Encrypted Track Data, or Track Data not Passed

Example: 4111111111111111
card-typestring · enumRequired

Type of Card

Example: VISAPossible values:
cscstringOptional

csc of the card number

Example: 999
customer-keystringOptional

customer associated to token

defaultbooleanOptional

true if this should be the default method to charge customers

descriptionstringOptional

Description of token

Example: joint acct
encrypted-track-datastringOptional

can replace card as required field, if used must set track-format

exp-datestringRequired

MMYY that card expires

Example: 0932
last-four-digitsstringOptional

last 4 digits of the card number

require-avsstringOptional

defaults to true, set to false if you want to create the token regardless of AVS response

Example: false
require-card-inquirystringOptional

defaults to true, set to false if you do NOT want to validate the card with the card brands when creating a token

Example: true
statusstringOptional

Status of token (used for modifications)

track-formatstring · enumOptional

required if track2-data or encrypted-track-data is passed.

Possible values:
track2-datastringOptional

can replace card as required field, if used must set track-format

Responses
200
Successful Token Creation
post
POST //rest/v2/tokens HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/xml
Accept: */*
Content-Length: 363

"<?xml version=1.0?>
<avs-address>123 example Street</avs-address>
<avs-zip>85284</avs-zip>
<card>4111111111111111</card>
<card-type>VISA</card-type>
<csc>999</csc>
<customer-key>text</customer-key>
<default>false</default>
<description>joint acct</description>
<encrypted-track-data>text</encrypted-track-data>
<exp-date>0932</exp-date>
<last-four-digits>text</last-four-digits>
<require-avs>false</require-avs>
<require-card-inquiry>true</require-card-inquiry>
<status>text</status>
<track-format>TRACK2</track-format>
<track2-data>text</track2-data>
"
<?xml version="1.0"?>
<object>
	<payloadType>text</payloadType>
	<tokenResponse>
		<authorization-code>ACH789</authorization-code>
		<avs-address>123 example</avs-address>
		<avs-zip>123456</avs-zip>
		<card-type>VISA</card-type>
		<created>09/19/2016 08:06:78</created>
		<description>joint checking</description>
		<exp-date>0919</exp-date>
		<last-four-digits>5678</last-four-digits>
		<merchant-id>text</merchant-id>
		<merchant-legacy-token-id>text</merchant-legacy-token-id>
		<software-vendor-name>text</software-vendor-name>
		<status>Active</status>
		<times-used>5</times-used>
		<token-id>10009993322221111</token-id>
		<token-status>Open</token-status>
		<updated>09/19/2016 08:06:78</updated>
		<avs-result-code>X</avs-result-code>
		<customer-first-name>John</customer-first-name>
		<customer-key>customer123</customer-key>
		<customer-last-name>Doe</customer-last-name>
		<default>false</default>
		<token-update-status>UPDATED</token-update-status>
	</tokenResponse>
</object>

Get Token

get
Path parameters
token-idanyRequired

token-id

Header parameters
api-keyanyRequired

api key

Responses
200
Success
get
GET //rest/v2/tokens/{token-id} HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
<?xml version="1.0"?>
<object>
	<payloadType>text</payloadType>
	<tokenResponse>
		<authorization-code>ACH789</authorization-code>
		<avs-address>123 example</avs-address>
		<avs-zip>123456</avs-zip>
		<card-type>VISA</card-type>
		<created>09/19/2016 08:06:78</created>
		<description>joint checking</description>
		<exp-date>0919</exp-date>
		<last-four-digits>5678</last-four-digits>
		<merchant-id>text</merchant-id>
		<merchant-legacy-token-id>text</merchant-legacy-token-id>
		<software-vendor-name>text</software-vendor-name>
		<status>Active</status>
		<times-used>5</times-used>
		<token-id>10009993322221111</token-id>
		<token-status>Open</token-status>
		<updated>09/19/2016 08:06:78</updated>
		<avs-result-code>X</avs-result-code>
		<customer-first-name>John</customer-first-name>
		<customer-key>customer123</customer-key>
		<customer-last-name>Doe</customer-last-name>
		<default>false</default>
		<token-update-status>UPDATED</token-update-status>
	</tokenResponse>
</object>

Delete Token

delete
Path parameters
token-idanyRequired

token-id

Header parameters
api-keyanyRequired

api key

Responses
200
Success
delete
DELETE //rest/v2/tokens/{token-id} HTTP/1.1
Host: gateway-sb.clearent.net
Accept: */*
<?xml version="1.0"?>
<object>
	<payloadType>text</payloadType>
	<tokenResponse>
		<authorization-code>ACH789</authorization-code>
		<avs-address>123 example</avs-address>
		<avs-zip>123456</avs-zip>
		<card-type>VISA</card-type>
		<created>09/19/2016 08:06:78</created>
		<description>joint checking</description>
		<exp-date>0919</exp-date>
		<last-four-digits>5678</last-four-digits>
		<merchant-id>text</merchant-id>
		<merchant-legacy-token-id>text</merchant-legacy-token-id>
		<software-vendor-name>text</software-vendor-name>
		<status>Active</status>
		<times-used>5</times-used>
		<token-id>10009993322221111</token-id>
		<token-status>Open</token-status>
		<updated>09/19/2016 08:06:78</updated>
		<avs-result-code>X</avs-result-code>
		<customer-first-name>John</customer-first-name>
		<customer-key>customer123</customer-key>
		<customer-last-name>Doe</customer-last-name>
		<default>false</default>
		<token-update-status>UPDATED</token-update-status>
	</tokenResponse>
</object>

Update a token

put
Header parameters
api-keyanyRequired

api key

Body
avs-addressstringOptional

Address Associated with the Card data (Needed for qualification)

Example: 123 example Street
avs-zipstringOptional

ZipCode Associated with the Card data (Needed for qualification)

Example: 85284
defaultbooleanOptional

true if this card should be the default card to charge customers

descriptionstringOptional

Description of token

Example: joint acct
Responses
200
Successful Token Update
put
PUT //rest/v2/tokens/{tokenId} HTTP/1.1
Host: gateway-sb.clearent.net
Content-Type: application/xml
Accept: */*
Content-Length: 97

"<?xml version=1.0?>
<avs-address>123 example Street</avs-address>
<avs-zip>85284</avs-zip>
<default>false</default>
<description>joint acct</description>
"
<?xml version="1.0"?>
<object>
	<payloadType>text</payloadType>
	<tokenResponse>
		<authorization-code>ACH789</authorization-code>
		<avs-address>123 example</avs-address>
		<avs-zip>123456</avs-zip>
		<card-type>VISA</card-type>
		<created>09/19/2016 08:06:78</created>
		<description>joint checking</description>
		<exp-date>0919</exp-date>
		<last-four-digits>5678</last-four-digits>
		<merchant-id>text</merchant-id>
		<merchant-legacy-token-id>text</merchant-legacy-token-id>
		<software-vendor-name>text</software-vendor-name>
		<status>Active</status>
		<times-used>5</times-used>
		<token-id>10009993322221111</token-id>
		<token-status>Open</token-status>
		<updated>09/19/2016 08:06:78</updated>
		<avs-result-code>X</avs-result-code>
		<customer-first-name>John</customer-first-name>
		<customer-key>customer123</customer-key>
		<customer-last-name>Doe</customer-last-name>
		<default>false</default>
		<token-update-status>UPDATED</token-update-status>
	</tokenResponse>
</object>

Was this helpful?