Nuvei - Create token
To save a tokenized payment card, a token must get created first. The token is necessary for a session card and for saving a payment card on a customer's master account.
URL
/cnbs/v1/nuvei/token
Method
POST
Parameters
Required
- Payer (payer_data)
- Customer Number (customer_number)
- Company Code (company_code)
- Account Type (account_type)
- ach … Automated Clearing House (eCheck)
- cc … Credit card
Sample Implementation
Example
cURL
curl -X POST "https://<<your.server.here>>/cnbs/v1/nuvei/token?sap-client=800&sap-language=EN&apiid=CNBSMV01R_NUVEI" -H "accept: application/json" -H "cnbssysid: W1B//vRKywJ2sPUVQG4CQ16Sf9XSN+N4Fkc6Bfmky3k=" -H "authorization: Basic Q05CU0FQSUlDRjpjbmJzNHlvdTE=" "Content-Type: application/json" -d "{ \"payer_data\": { \"customer_number\": \"3000\", \"company_code\": \"3000\" }, \"account_type\": \"cc\"}"
Response
- Access Token (access_token)
- Valid To (valid_to)
- Access token valid until
- Nuvei Connect API Credentials (cred)
- Credentials (credentials)
- Expiration (expiration)
- Credentials valid until
- Connect API endpoint (site_url)
- Gateway (gateway)
- Currency (currency)
- Billing Info (billing_info)
- Name: (name)
- E-Mail address: (email_address)
- City: (city)
- Address: (address)
- State: (state)
- Postal Code City: (zip)
- Country: (country)
- Language: (language)
- Account Type: (account_type)
- ach … Automated Clearing House (eCheck)
- cc … Credit card
- Profile ID: (profile_id)
- If already tokenized card(s) exist, they are assigned to the same profile ID. When the Nuvei API to tokenize a card will be called, an existing profile ID must be supplied.
- 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
{ "access_token": "000C29F0318A1FD082C21372F08C2B84", "valid_to": 20250425000450, "cred": { "credentials": "fc0879e6-b3af-4638-a85e-ab13bafdd55f", "expiration": "2025-03-26T07:34:50.8732704Z", "site_url": "https://api.dev.nuveiconnect.com", "gateway": "payaconnect", "currency": "USD", "billing_info": { "name": "Smith Inc. LLC", "email_address": "demo@cnbssoftware.com", "city": "MAYWOOD", "address": "1 2800 South 25th Ave", "state": "IL", "zip": "60153", "country": "US", "language": "en", "account_type": "cc", "profile_id": "11f0001eb6a9a1848808d175" } }, "status": { "message_type": "S", "message_identification": "/CNBS/X_API", "message_number": 10, "message_line_string": "Request successfully processed" } }