How to migrate from the Payments API to the Orders API
The migration of Automatic Payments integrations from the Payments API to the Orders API involves transferring the management of Customers and Cards to the Profiles structure, initially, and then using the Orders API for payment processing.
See below how to perform this migration correctly.
Create profiles for already stored customers
Previously, in the Payments flow, customer data and their tokenized cards were stored and managed only through the CustomersAPI and CardsAPI APIs.
The new Orders API for Automatic Payments, on the other hand, requires the creation of a payment profile for each customer when sending recurring payments, retrieving the information stored by Customers and Cards. These profiles simplify the reuse of payment data: they contain the payment methods associated with a customer and function as a template for future automatic charges.
Additionally, the Profiles structure performs automatic validation of a customer's payment methods, avoiding the need to process validation payments and, in case of rejected payments, makes new processing attempts with the remaining payment methods that compose it, improving the approval rate.
It is possible to create profiles for previously stored customers using the customer_id and the card_id of their saved cards by following the steps below.
Upon completing these steps for all your pre-existing customers, they will be properly configured in the Profiles API and you can start making automatic charges efficiently through the Orders API. Go to the documentation to learn how to process payments.
