Detokenization Integration
To begin using this service, you simply need to make a few modifications to the code that is constructing your HTTPS POST to the 3rd-party endpoint.
- Update the URL to POST to TokenEx
- Add HTTP Header for the intended URL
- TX_URL
- Add your Authentication Headers
- TX_TokenExID
- TX_APIKey
- Wrap the field in the HTTP Body with three curly braces
- example:
{{{424242XXXXXX4242}}}
- example:
- (Optional) To inject a CVV that was previously collected by TokenEx,
insert the cvv placeholder as shown below.
The placeholder is the lowercase string "cvv" wrapped with three sets of curly braces.
- example:
{{{cvv}}}
- example:
HTTP Request Headers
Header | Description |
---|---|
TX_TokenExID | Your TokenEx ID. |
TX_APIKey | Your API Key. |
TX_URL | The endpoint URL to which TokenEx should POST the detokenized request. |
TX_Headers | (Optional) Comma-separated list of desired headers received from the endpoint |
TX_CacheCvv | (Optional) Sending 'true' will cache the CVV for 5 minutes allowing additional attempts with the CVV after a failed transaction |
Detokenization Examples - JSON
- JSON with Token
- JSON with Token and CVV
- JSON with Token, CVV and CacheCvv = true
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: application/json
TX_URL: https://www.example.com
TX_TokenExID: YourTokenExID
TX_APIKey: YourAPIKey
{
"card": {
"type": "MC ",
"number": "{{{545454587415454}}}",
"expDate": "1126",
"cardValidationNum": "123"
}
}
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: application/json
TX_URL: https://www.example.com
TX_TokenExID: XXXXXXXXXX
TX_APIKey: XXXXXXXXXX
{
"card": {
"type": "MC ",
"number": "{{{545454XXXXXX5454}}}",
"expDate": "1112",
"cardValidationNum": "{{{cvv}}}"
}
}
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: application/json
TX_URL: https://www.example.com
TX_TokenExID: XXXXXXXXXX
TX_APIKey: XXXXXXXXXX
TX_CacheCvv: true
{
"card": {
"type": "MC ",
"number": "{{{545454XXXXXX5454}}}",
"expDate": "1126",
"cardValidationNum": "{{{cvv}}}"
}
}
Detokenization Examples - XML
- XML with Token
- XML with Token and CVV
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: text/xml
TX_URL: https://www.example.com
TX_TokenExID: YourTokenExID
TX_APIKey: YourAPIKey
<card>
<type>MC</type>
<number>{{{545454587415454}}}</number>
<expDate>1126</expDate>
<cardValidationNum>123</cardValidationNum>
</card>
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: text/xml
TX_URL: https://www.example.com
TX_TokenExID: XXXXXXXXXX
TX_APIKey: XXXXXXXXXX
<card>
<type>MC</type>
<number>{{{545454XXXXXX5454}}}</number>
<expDate>1126</expDate>
<cardValidationNum>{{{cvv}}}</cardValidationNum>
</card>
Detokenization Examples - Form POST
- Form POST with Token
- POST with Token and CVV
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: application/x-www-form-URLencoded
TX_URL: https://www.example.com
TX_TokenExID: YourTokenExID
TX_APIKey: YourAPIKey
type=MC&number={{{545454587415454}}}&expDate=1112&cardValidationNum=123
POST https://test-api.tokenex.com/TransparentGatewayAPI HTTP/1.1
Content-Type: application/x-www-form-URLencoded
TX_URL: https://www.example.com
TX_TokenExID: XXXXXXXXXX
TX_APIKey: XXXXXXXXXX
type=MC&number={{{545454XXXXXX5454}}}&expDate=1112&cardValidationNum={{{cvv}}}