Response Handling

TokenEx Response Headers

HTTP Response HeaderDescription/Detokenize/Tokenize/Proxy/Hash
tx-messageInformative message about the request (number of regex matches, PANs and CVVs associated, etc.).N/ASuppliedSuppliedN/A
tx-tokenize-error-XReports errors in tokenization attempts, where X is an incremented count. Examples: tx-tokenize-error-1, tx-tokenize-error-2, etc.N/ASuppliedSuppliedN/A
tx-thirdpartystatuscodeThe status code received from the third party defined in the tx-url request header.Supplied when authentication is successfulSupplied when authentication is successfulN/AN/A
tx-tokenexstatuscodeThe status code for the request to TokenEx.Supplied when authentication is successfulSupplied when authentication is successfulN/AN/A
tx-total-timeTotal time required to process the request.SuppliedSuppliedN/AN/A
tx-tokenex-timeTime spent processing request within the TokenEx environment.SuppliedSuppliedN/AN/A
tx-destination-timeTime spent waiting for the third-party to respond.SuppliedSuppliedN/AN/A
tx-reference-numberThe reference number associated with your request.SuppliedSuppliedSuppliedN/A



In case of an error, the header values tx-total-time, tx-tokenex-time and tx-destination-time are set to zero.

Error Handling

Errors are reported back to the client by way of an HTTP status code and response body containing error details. It is important that your application extract the error details from the body.

Status CodeDescriptionLikely Issue
400Bad requestValidation error
401UnauthorizedAuthentication/Authorization error
500Internal server errorUnknown error
	"success": false,
	"error": "ErrorCode:Message",
	"referenceNumber": "Reference number returned on each call"