API
Skip to main content

Payment method tokenization

Tokenization is the process by which confidential payment data of customers can be securely stored by creating a token. To create a token, the following steps must be followed:

  1. Obtain the UUID of the customer;
  2. Purchase through checkout using the registered customer id.

1. Obtain the UUID of the customer

The first step is to obtain the UUID of the customer who wants to register his/her payment method. This can be done through:

2. Complete payment through checkout

For the payment method to be available a successful payment must be completed.

POST /checkouts

{
"payment": {
"amount": 100,
"recurring": {
"amountQualifier": "ESTM" // <== Montante váriável
},
"customer": {
"uuid": "e2343605-cf46-43de-b20b-9b7d1c95a9b2" // <== ID do customer registado
},
"paymentMethod": {
"code": "CC",
"details": {
"createRegistration": true // <== Indicar que é para criar token
}
}
},
"page": {
"language": "PT"
}
}

3. View customer payment methods

Once the payment has been successfully completed, the payment method is added to the payment methods of the customer.

GET ​/customers​/{uuid}​/paymentMethods

{
"apiVersion": "1.0",
"date": "2021-09-24T17:57:42+01:00",
"success": true,
"data": [
{
"type": "CC",
"uuid": "90068f83-7623-4de5-91c7-ac447c504ebf",
"brand": "VISA",
"last4Digitis": "0809",
"holder": "Luís Gonçalves",
"expireMonth": "05",
"expireYear": "2026"
},
{
"type": "MW",
"uuid": "45668f83-7623-4de5-91c7-ac447c504ebf",
"countryCode": "351",
"last3Digitis": "263"
}
]
}