Token API V2 -> V4 migration guide


The following guide will help you migrate from Token API V2 to Token API V4. We advise you to do so, as V2 won't be maintained anymore.

A list of all migration guides can be found here: Go to migration guides


Note: Everything colored with red was removed in API V4, while the new functionalities added in V4 are colored with green.

Endpoints

Endpoint HTTP method V2 V4
Create token POST order/token/v2/merchantToken api/v4/token
Get token GET order/token/v2/merchantToken api/v4/token/:token
Get multiple token info GET order/token/v2/merchantToken
Get history for token GET order/token/v2/merchantToken/:token/history
Cancel token DELETE order/token/v2/merchantToken/:token api/v4/token/:token


Create token endpoint

Request parameters mapping
V2 V4 Details
refNo payuPaymentReference
merchant it was moved in X-Header-Merchant, see authentication section
timestamp it was moved in X-Header-Date header (date format changed), see authentication section
signature it was moved in X-Header-Signature header, see authentication section

Response parameters mapping
V2 V4 Details
response.token token
response.cardUniqueIdentifier cardUniqueIdentifier
meta.status.message message
meta.response.httpCode code It is also the HTTP response code received
meta.status.code status Values migrated from being numeric, to literal. eg. Success was 0, now its `SUCCESS`
response.fxCurrency Was populated only for orders created with FX
meta.response.httpMessage
meta.version
expirationDate
cardHolderName
tokenStatus
lastFourDigits
cardExpirationDate


Get token endpoint

Request parameters mapping
V2 V4 Details
token token Path parameter
merchant it was moved in X-Header-Merchant header, see authentication section
timestamp it was moved in X-Header-Date header (date format changed), see authentication section
signature it was moved in X-Header-Signature header, see authentication section

Response parameters mapping
V2 V4 Details
token.tokenStatus tokenStatus
token.tokenExpirationDate expirationDate
token.cardHolderName cardHolderName
token.cardNumberMask
token.cardExpirationDate cardExpirationDate
token.cardType
token.cardBank
token.cardProgramName
meta.status.message message
meta.response.httpCode code It is also the HTTP response code received
meta.status.code
meta.response.httpMessage
meta.version
status
lastFourDigits
token
cardUniqueIdentifier
networkToken.lastFourDigits
networkToken.expirationDate


Cancel token endpoint

Request parameters mapping
V2 V4 Details
token token Path parameter
cancelReason
merchant it was moved in X-Header-Merchant header, see authentication section
timestamp it was moved in X-Header-Date header (date format changed), see authentication section
signature it was moved in X-Header-Signature header, see authentication section

Response parameters mapping

On API V2, for success, HTTP code 204 is returned with no body, while in API V4 HTTP code 200 is returned, with the following fields:

code
message
status
token
cardUniqueIdentifier
expirationDate
cardHolderName
tokenStatus
lastFourDigits


Authentication

Deprecated V4
Can be done in two ways:
  • Header authentication: Authorization and X-timestamp headers
  • Request parameter authentication: merchant, timestamp and signature parameters
The signature is passed in the requests X-Header-Signature header, that has to be sent together with X-Header-Date and X-Header-Merchant headers. Read more about how its calculated here