How to provide customer data
When creating a checkout, you have three ways to provide customer information:
Using the customerData
field (manual data)
Ideal when you haven’t registered the customer in Asaas yet or want to pre-fill the checkout automatically.
You provide the data directly in the request body.
Example:
"customerData": {
"name": "Ana Paula",
"cpfCnpj": "12345678900",
"email": "[email protected]",
"phone": "47988887777",
"address": "Rua das Flores",
"addressNumber": 123,
"complement": "Casa",
"postalCode": "89000000",
"province": "Centro",
"city": 4205407
}
This information will already be filled in on the checkout page, making payment easier and reducing friction for the customer.
Using the customer
field (ID of an existing customer)
Ideal when the customer has already been registered via the API or the Asaas dashboard.
You only need to provide the customer ID (e.g., cus_000005821234
), and Asaas will automatically retrieve the stored information.
Example:
"customer": "cus_000005821234"
The checkout will be generated with the customer’s data pre-filled, such as name, email, CPF, address, etc., as stored in the record.
Important
- You must use only one of the two fields:
customerData
orcustomer
.- Providing both at the same time is not allowed.
- If using
customer
, make sure the customer already exists in the Asaas database.
Letting your customer enter the data
If you don’t send either of the above fields, your customer will be able to enter their own information directly on the checkout page.
Updated about 9 hours ago