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

ScenarioHow to send
The customer is already registered in Asaascustomer
The customer is not registered yet, but your application already has the datacustomerData
Your application does not have the dataDo not send customer or customerData

Use customer for an already registered customer

If 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

If 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


Did this page help you?