Get access token
Get access token for XI intercept.
URL
/cnbs/v1/tokenization/access_token
Method(s)
GET | POST
Overview
High level summary of required operations:
- The first call is needed to get a valid access token along with the tokenization endpoint URI via an AJAX call to the CNBS API.
- The action here is “01”
- The endpoint is /tokenization/access_token
- After successful access token retrieval the actual 3rd party tokenization API needs to be called via AJAX.
- The payload for token retrieval will have to include the credit card details in a specific packet format.
- In the success handler of the token retrieval AJAX call another call to the CNBS API is made to get the actual response from the 3rd party tokenization service.
- The action here is “02”
- The endpoint is /tokenization/response
Parameters
Required
- Action (action)
- 01 = Get Access Token
- Payment Method (payment_method)
- CC = Credit Card
- EC = Electronic Check
- TO = Token (3DS Call with Token Integration)
Optional - needed for 3DS
- Redirect URL (redirect_uri)
- the URI used to redirect back to the UI after 3DS processing
- Amount (amount)
- without any decimalization (e.g. 1.00 USD must be entered as 100)
- Currency Code ISO 4217 (currency_code)
- e.g. USD = 840
- Field Name CCNUM (fn_ccnum)
- Field Name VALTM (fn_valtm)
- Field Name VALTY (fn_valty)
- Billing Address 1 (billing_address1)
- Billing City (billing_city)
- Billing Postal Code (billing_postal_code)
- Billing Country ISO 3166-1 Code (billing_country_code)
- e.g. US = 840
- Billing State (billing_state)
- Billing Phone (billing_phone)
- Billing First Name (billing_first_name)
- Billing Last Name (billing_last_name)
- Billing email (billing_email)
- Mobile Phone No (mobile_phone)
- Order Number (order_number)
- Shipping Address 1 (shipping_address1)
- Shipping City (shipping_city)
- Shipping Postal Code (shipping_postal_code)
- Shipping Country Code (shipping_country_code)
- Shipping State (shipping_state)
- Work Phone No (work_phone)
- 3DS Version (threeds_version)
- Payment Card Token (payment_card_token)
- Payment Card Expiration Month (expiration_month)
- Payment Card Expiration year (expiration_year)
Sample Implementation
Example POST
JSON Payload:
{ "action": "01", "payment_method": "CC" }
cURL
curl -X POST "https://<<your.server.here>>/cnbs/v1/tokenization/access_token?sap-client=800&sap-language=EN&apiid=CNBSMV01P" -H "accept: application/json" -H "content-type: application/json" -H "cnbssysid: gPuM1VyY1dxlTE2MEs2yajJUkX3/4+2Pw1alRw4BOtI=" -d "{ \"action\": \"01\", \"payment_method\": \"CC\"}"
Example GET
cURL
curl -X GET "https://<<your.server.here>>/cnbs/v1/tokenization/access_token?sap-client=800&sap-language=EN&apiid=CNBSMV01R&action=01&payment_method=CC" -H "accept: application/json" -H "content-type: application/json" -H "cnbssysid: gPuM1VyY1dxlTE2MEs2yajJUkX3/4+2Pw1alRw4BOtI=" -H "authorization: Basic Q05CU0FQSUlDRjpjbmJzNHlvdTE="
Response
- Merchant GUID (merchant_guid)
- Unique Merchant GUID of this acess token.
- Access Token (access_token)
- Access token to get the reponse payload from the 3rd party payment provicer
- Tokenization URI (paymetric_xi_url)
- 3rd party payment provider tokenization endpoint.
- Status (status)
- Message Type (message_type)
- SAP Message Type.
- Errors:
- E = Error
- A = Abort
- X = Exception
- Others:
- S = Success
- W = Warning
- I = Information
- Message Identifier (message_identification)
- SAP Message ID.
- Message Number (message_number)
- SAP Message Number.
- Message Line (message_line_string)
- SAP Message Text.
Example Response
JSON:
{ "merchant_guid": "711c8483-d37f-4d82-bb9d-0273a560a96d", "access_token": "2e62de4a-15d8-4e06-bf13-00a6cd2c9fc9", "paymetric_xi_url": "https://qaapp02.xisecurenet.com/DIeComm", "status": { "message_type": "S", "message_identification": "/CNBS/X_API", "message_number": 10, "message_line_string": "Request successfully processed" } }