Create a Customer Token with Validated Payment
Details
This section shows you how to create a customer with validated payment details.
Endpoint
Test:
POST
https://apitest.cybersource.com
/pts/v2/payments Production:
POST
https://api.cybersource.com
/pts/v2/payments Production in India:
POST
https://api.in.cybersource.com
/pts/v2/paymentsRequired Fields for Creating a Customer Token with Validated Payment Details Using the
REST API
- orderInformation.amountDetails.currency
- orderInformation.amountDetails.totalAmount
- orderInformation.billTo.address1
- orderInformation.billTo.administrativeArea
- orderInformation.billTo.country
- orderInformation.billTo.email
- orderInformation.billTo.firstName
- orderInformation.billTo.lastName
- orderInformation.billTo.locality
- orderInformation.billTo.postalCode
- paymentInformation.card.expirationMonth
- paymentInformation.card.expirationYear
- paymentInformation.card.number
- paymentInformation.card.type
- processingInformation.actionList
- Set the value toTOKEN_CREATE.
- processingInformation.actionTokenTypes
- Set the value tocustomer.
Related Information
REST Example: Creating a Customer Token with Validated Payment Details
Request
POSThttps://apitest.cybersource.com/pts/v2/payments { "clientReferenceInformation": { "code": "TC50171_3" }, "processingInformation": { "commerceIndicator": "internet", "actionList": [ "TOKEN_CREATE" ], "actionTokenTypes": [ "customer", "paymentInstrument", "shippingAddress" ] }, "orderInformation": { "billTo": { "country": "US", "lastName": "Deo", "address2": "Address 2", "address1": "201 S. Division St.", "postalCode": "48104-2201", "locality": "Ann Arbor", "administrativeArea": "MI", "firstName": "John", "phoneNumber": "999999999", "district": "MI", "buildingNumber": "123", "company": "Visa", "email": "test@cybs.com" }, "shipTo": { "country": "US", "lastName": "Deo", "address2": "Address 2", "address1": "201 S. Division St.", "postalCode": "48104-2201", "locality": "Ann Arbor", "administrativeArea": "MI", "firstName": "John", "phoneNumber": "999999999", "district": "MI", "buildingNumber": "123", "company": "Visa", "email": "test@cybs.com" }, "amountDetails": { "totalAmount": "102.00", "currency": "USD" } }, "paymentInformation": { "card": { "expirationYear": "2031", "number": "4895379987X11515", "securityCode": "089", "expirationMonth": "12", "type": "001" } } }
Response to a Successful Request
{ "_links": { "authReversal": { "method": "POST", "href": "/pts/v2/payments/6760630088136127303955/reversals" }, "self": { "method": "GET", "href": "/pts/v2/payments/6760630088136127303955" }, "capture": { "method": "POST", "href": "/pts/v2/payments/6760630088136127303955/captures" } }, "clientReferenceInformation": { "code": "TC50171_3" }, "id": "6760630088136127303955", "orderInformation": { "amountDetails": { "authorizedAmount": "102.00", "currency": "USD" } }, "paymentAccountInformation": { "card": { "type": "001" } }, "paymentInformation": { "tokenizedCard": { "type": "001" }, "card": { "type": "001" } }, "pointOfSaleInformation": { "terminalId": "111111" }, "processorInformation": { "paymentAccountReferenceNumber": "V0010013019326121174070050420", "approvalCode": "888888", "networkTransactionId": "123456789619999", "transactionId": "123456789619999", "responseCode": "100", "avs": { "code": "X", "codeRaw": "I1" } }, "reconciliationId": "69816012FDTK35GM", "status": "AUTHORIZED", "submitTimeUtc": "2023-02-10T21:03:29Z", "tokenInformation": { "instrumentidentifierNew": false, "instrumentIdentifier": { "state": "ACTIVE", "id": "7030000000014911515" }, "shippingAddress": { "id": "F45FB3E443AF3C57E053A2598D0A9CFF" }, "paymentInstrument": { "id": "F45FC6785E3C31A2E053A2598D0A5346" }, "customer": { "id": "F45FB3E443AC3C57E053A2598D0A9CFF" } } }