How to provide customer data
Provide customer data in Checkout
When creating a Checkout, choose how the payer's data will be filled in: using an already registered customer, sending the data in the request, or letting the payer fill it in.
Choose how to provide the data
| Scenario | How to send |
|---|---|
| The customer is already registered in Asaas | customer |
| The customer is not registered yet, but your application already has the data | customerData |
| Your application does not have the data | Do not send customer or customerData |
Use customer for an already registered customer
customer for an already registered customerIf the customer already exists in Asaas, send their ID:
{
"customer": "cus_000005821234"
}The Checkout will use the existing data in the customer's registration to fill in the journey.
Use this model when your application already stores the customer's Asaas ID.
Use customerData to send the data at creation
customerData to send the data at creationIf the customer is not registered yet, but your application already has their data, send customerData:
{
"customerData": {
"name": "Ana Paula",
"cpfCnpj": "12345678900",
"email": "[email protected]",
"phone": "47988887777",
"address": "Rua das Flores",
"addressNumber": 123,
"complement": "House",
"postalCode": "89000000",
"province": "Centro",
"city": 4205407
}
}The data sent will be used to fill in the corresponding fields on the Checkout screen.
See the fields available in customerData in the Checkout creation reference.
Attention
- You must use only one of the two fields: customerData or customer.
- Providing both at the same time is not allowed.
- If you use customer, make sure the customer already exists in the Asaas database.
Let the payer fill in the data
If you send neither customer nor customerData, the payer must enter their own data directly on the Checkout screen.
Use this model when your application does not have the necessary information before starting the payment journey.
Next steps
Updated 17 days ago
