Start a token acquisition session (usually similar to a checkout session)
POST
/cms/customer/payment/acquire
const url = 'https://api.example.com/cms/customer/payment/acquire';const options = { method: 'POST', headers: { 'API-Key': '<API-Key>', Authorization: 'Bearer <token>', Token: '<Token>', 'Content-Type': 'application/json' }, body: '{"payment_method":"example","source":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.example.com/cms/customer/payment/acquire \ --header 'API-Key: <API-Key>' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Token: <Token>' \ --data '{ "payment_method": "example", "source": "example" }'Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
payment_method
required
Payment method for token creation
string
source
Touch’n Go: “web” (desktop) or “wap” (mobile browser). The response is the TNGD authorization URL to redirect the customer to; TNGD then redirects to the configured binding return URL with authCode and authState, which that page posts to /cms/customer/payment/setup.
string
Example generated
{ "payment_method": "example", "source": "example"}Responses
Section titled “Responses”Payment token created
Media typeapplication/json
object
response
Token creation response from the payment gateway
object
Example generated
{ "response": {}}Unauthorized
Forbidden