API
Skip to main content

Enable payment method tokenization.

POST /checkouts

Creation of the checkout with the following data:

To allow storage of the payment method it is necessary to send the allowRegistration parameter and the uuid of the customer, which can be obtained through view customer

The payment method is only stored with the consent of the customer and after successful payment.

The stored payment methods can be viewed via view payment methods.

Note: Payment method storage is only available for payments with Credit/Debit Card and MBWay and in the basic and default Layout.

{
"payment": {
"amount": 500,
"code": "REFPRODUTO_1",
"summary": "Computador",
"customer": {
"uuid": "e2343605-cf46-43de-b20b-9b7d1c95a9b2" // <== Indicar o uuid do cliente
},
"billingAddress": {
"country": "PT",
"city": "Lisboa",
"street1": "Rua Domingos Monteiro nº 7 A",
"postCode": "1050-074"
},
"paymentMethod": {
"code": "CC",
"details": {
"allowRegistration": true // <== Indicar a possibilidade de armazenar o método de pagamento
}
}
},
"page": {
"language": "PT",
"layout": "basic" // <== Indicar o layout que permite armazenar o método de pagamento
}
}

The response returns the id which identifies the checkout to the API. The checkoutUrl is the link to access the page and make the payment. The paymentId is the id that identifies the payment.

Accessing the checkoutUrl displays the following page:

Checkout registration