Endpoint responsible for updating the registration information of an existing customer in Asaas using their unique identifier (id).
The update is used to keep data synchronized between the source system and Asaas, ensuring that future charges, notifications, and consultations use the customer’s most recent information.
When to use
Use this endpoint whenever your integration needs to update registration data of a customer already created in Asaas.
Some common scenarios include:
- change of name, email, phone, or mobile phone;
- address update;
- change of registered CPF or CNPJ;
- inclusion of additional emails for notifications;
- change of the customer identifier in the source system;
- update of the charge notification sending configuration;
- data synchronization between ERP, CRM, e-commerce, or proprietary platform and Asaas.
Before the update, it is necessary to know the customer identifier (id) in Asaas, normally obtained during creation or through customer consultation.
When not to use
Do not use this endpoint to:
- create a new customer;
- remove a customer;
- restore a removed customer;
- change charges already created;
- change subscriptions already created;
- change financial data of payments already issued;
- update specific customer notifications in batch;
- replace the customer creation flow.
If the customer does not yet exist in Asaas, use the customer creation endpoint.
If you need to change specific charge notifications, use the customer notification endpoints.
How the update works
The update modifies only the customer registration informed by the identifier sent in the request.
This endpoint does not create new customers or change charges, subscriptions, invoices, or other existing resources. However, the updated information may be used by operations performed after the registration change.
The update must be treated as a registration change of the existing customer, keeping the same id.
Behavior of sent fieldsSend in the body only the fields that need to be updated.
Fields sent in the request will be considered in the registration update. Therefore, avoid sending empty, null, or default values if the intention is to preserve the customer’s current information.
Missing, empty, or null fields
When assembling the update request, pay attention to how fields are handled:
| Situation | Recommended behavior |
|---|---|
| Field will not be changed | Do not send the field in the request body. |
| Field will be updated | Send the field with the desired new value. |
| Empty or null field | Avoid sending it, unless your integration has validated this behavior and really wants to change or clear the information. |
| Field with invalid value | The request may return a validation error. |
AttentionBefore sending empty or null data in an update, validate the behavior in Sandbox.
This prevents accidentally overwriting important registration data, especially in automatic synchronizations with ERP, CRM, or e-commerce.
Request parameter
This endpoint uses the customer identifier in the request path.
| Parameter | Required | Description |
|---|---|---|
id | Yes | Unique identifier of the customer to be updated. |
The id must correspond to an existing customer in the authenticated Asaas account.
Identifier example:
cus_000005401844This identifier is returned when the customer is created and can also be obtained through customer listing or consultation.
Body parameters
The body fields must be sent according to the registration data that needs to be updated.
| Field | Type | Description |
|---|---|---|
name | string | Customer name. |
cpfCnpj | string | Customer CPF or CNPJ. |
email | string | Customer email. |
phone | string | Landline phone. |
mobilePhone | string | Mobile phone. |
address | string | Street address. |
addressNumber | string | Address number. |
complement | string | Address complement. |
province | string | Neighborhood. |
postalCode | string | Address ZIP code. |
externalReference | string | Customer identifier in the source system. |
notificationDisabled | boolean | Defines whether sending charge notifications will be disabled for the customer. |
additionalEmails | string | Additional emails for sending charge notifications, separated by commas. |
municipalInscription | string | Customer municipal registration. |
stateInscription | string | Customer state registration. |
observations | string | Additional observations about the customer. |
groupName | string | Name of the group to which the customer belongs. |
company | string | Company. |
foreignCustomer | boolean | Inform true if the payer is foreign. |
Parameters that deserve attention
Although all parameters are documented in the technical reference, some fields usually have greater impact during the integration:
- id — identifies which customer will be updated.
- cpfCnpj — must correctly represent the customer’s document.
- email — may be used in communications and notifications.
- phone and mobilePhone — may be used in communications and validations.
- postalCode, address, addressNumber, and province — impact the customer’s address registration.
- externalReference — facilitates synchronization between Asaas and the source system.
- notificationDisabled — defines whether the customer will continue receiving charge notifications.
- additionalEmails — adds extra recipients for charge notifications.
- foreignCustomer — must be informed for foreign customers when applicable.
Best practiceUse
externalReferenceto relate the customer in Asaas to the corresponding record in your system.This facilitates consultations, reconciliation, and future synchronizations.
Permission and authentication
To use this endpoint, the request must be authenticated with a valid API Key from the Asaas account.
The key used must belong to the same environment as the request:
- Sandbox API Key for Sandbox calls;
- Production API Key for Production calls.
If the API Key is missing, invalid, or belongs to another environment, the request may return an authorization error.
Request example
curl --request PUT \
--url https://api-sandbox.asaas.com/v3/customers/cus_000005401844 \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'access_token: $ASAAS_API_KEY' \
--data '{
"name": "John Doe",
"email": "[email protected]",
"phone": "90999999999",
"mobilePhone": "90999999999",
"address": "Av. Paulista",
"addressNumber": "150",
"complement": "Suite 201",
"province": "Downtown",
"postalCode": "01310000",
"externalReference": "12987382",
"notificationDisabled": false,
"additionalEmails": "[email protected],[email protected]",
"observations": "great payer, no issues so far",
"foreignCustomer": false
}'
NoteThe identifier
cus_000005401844is only illustrative.Use the real customer ID returned by the Asaas API.
Response example
In case of success, the API returns the updated customer data.
{
"object": "customer",
"id": "cus_000005401844",
"dateCreated": "2024-07-12",
"name": "John Doe",
"email": "[email protected]",
"phone": "90999999999",
"mobilePhone": "90999999999",
"address": "Av. Paulista",
"addressNumber": "150",
"complement": "Suite 201",
"province": "Downtown",
"city": 12565,
"cityName": "São Paulo",
"state": "SP",
"country": "Brazil",
"postalCode": "01310000",
"cpfCnpj": "24971563792",
"personType": "FISICA",
"deleted": false,
"additionalEmails": "[email protected],[email protected]",
"externalReference": "12987382",
"notificationDisabled": false,
"observations": "great payer, no issues so far",
"foreignCustomer": false
}Main response fields
| Field | Description |
|---|---|
object | Type of object returned. |
id | Unique customer identifier in Asaas. |
dateCreated | Customer creation date. |
name | Updated customer name. |
email | Updated customer email. |
phone | Customer landline phone. |
mobilePhone | Customer mobile phone. |
address | Street address. |
addressNumber | Address number. |
complement | Address complement. |
province | Neighborhood. |
city | City identifier. |
cityName | City name. |
state | State. |
country | Country. |
postalCode | ZIP code. |
cpfCnpj | Customer CPF or CNPJ. |
personType | Customer person type. |
deleted | Indicates whether the customer is removed. |
additionalEmails | Additional emails for notifications. |
externalReference | Customer identifier in the source system. |
notificationDisabled | Indicates whether charge notifications are disabled for the customer. |
observations | Additional observations. |
foreignCustomer | Indicates whether the customer is foreign. |
Usage example
A common scenario occurs when a customer changes their registration data in an ERP, CRM, e-commerce, or proprietary platform.
After updating this information in the source system, the application can use this endpoint to keep the registration synchronized in Asaas as well, avoiding divergences between systems.
Flow example:
Customer updates the registration in the source system
↓
System identifies the change
↓
System retrieves the customer id in Asaas
↓
System sends the changed fields to Asaas
↓
Asaas updates the customer registration
↓
System registers the synchronization as completedPrecautions during synchronization
The update must always use the correct customer identifier.
AttentionIt is recommended to store the
idreturned during customer creation.If it is not available, first use the customer consultation endpoint to locate the correct record before performing the update.
It is also recommended to define a single source of truth for registration data, such as ERP, CRM, or another main system, reducing the risk of improper overwrites between integrations.
Important behaviors
After a successful update:
- the new information becomes part of the customer registration;
- future charges and notifications may use the updated data;
- the customer identifier (
id) remains the same; - the customer is not recreated;
- existing charges are not changed automatically;
- existing subscriptions are not changed automatically;
- resources linked to the customer remain associated with the same
id.
If the informed customer does not exist or the identifier is invalid, the update will not be performed.
Important business rules
Before implementing this endpoint, consider the following rules:
- the customer must exist in Asaas;
- the informed
idmust belong to the authenticated account; - the request must be authenticated with a valid API Key;
- at least one registration datum must be sent for update;
- sent data must respect the expected formats;
additionalEmailsmust use emails separated by commas;notificationDisabledmust be sent as a boolean;foreignCustomermust be sent as a boolean;- fields sent with incorrect values may generate a validation error;
- the update does not create a new customer;
- the update does not remove the customer;
- the update does not automatically change charges, subscriptions, or other resources already issued.
Error handling
Before sending an update, it is recommended to internally validate whether the customer has already been synchronized with Asaas.
Some common errors during the integration include:
| HTTP Status | Possible cause | How to fix |
|---|---|---|
400 Bad Request | Invalid registration data, incorrect format, or incompatible parameters | Review the fields sent in the body |
401 Unauthorized | Missing, invalid API Key, or API Key belonging to the incorrect environment | Confirm the key used and the request environment |
404 Not found | Customer not found for the informed id | Check whether the ID was stored correctly or consult the customer before updating |
| Incorrect customer updated | Use of incorrect id in the request | Validate the relationship between the Asaas id and the customer in the source system |
| Data improperly overwritten | Sending empty, null fields or outdated data from the source system | Send only the fields that really need to be updated |
Whenever possible, handle these scenarios in the application to avoid inconsistencies between systems.
Operational impact
Since this endpoint directly changes the customer registration, it is recommended to use it only when there are effective changes to the registration information.
Unnecessary updates can:
- increase the volume of synchronizations;
- make change auditing difficult;
- overwrite data updated by another system;
- generate divergences between ERP, CRM, e-commerce, and Asaas;
- impact future notifications sent to the customer;
- affect future charges created after the update.
Therefore, keep control over the origin of the change and register when the synchronization was performed.
Best practices
For a safer implementation, it is recommended to:
- store the
idreturned when creating the customer; - use
externalReferenceto relate the customer to the source system; - consult the customer before the update when there is doubt about the current data;
- send only the fields that need to be changed;
- avoid sending empty or null fields without prior validation;
- validate CPF, CNPJ, email, phone, and ZIP code before sending the update;
- maintain a single source of truth for registration data;
- register internal logs of the update;
- handle
400,401, and404errors; - test the flow in Sandbox before operating in Production.
Sandbox precautions
This endpoint can be tested in Sandbox.
During tests, it is recommended to validate:
- update of basic data, such as name, email, and phone;
- address update;
- update of
externalReference; - sending of
additionalEmails; - change of
notificationDisabled; - sending of empty or null fields, if this scenario exists in your integration;
- update attempt with nonexistent
id; - update attempt with API Key from the incorrect environment.
These tests help avoid improper overwrites and synchronization failures in Production.
Related content
This endpoint is usually part of the flow below:
Create customer
↓
Store the returned id
↓
Consult customer, when necessary
↓
Update customer
↓
Create charges, subscriptions, or other operationsIf your integration still does not have the customer identifier, also see:
- Create customer;
- List customers;
- Retrieve customer by ID;
- Remove customer;
- Restore removed customer;
- Retrieve notifications of a customer;
- Update customer notifications.
404Not found
