Introduction - Payments
Learn the step-by-step process to create charges in Asaas.
You will create charges through the Asaas API, choose the payment method, and track the status until reconciliation.
Charges register amounts receivable in the Asaas account and provide payment methods for the customer, such as Pix, bank slip (boleto), credit card, debit card, or wire transfer (TED), depending on the configuration used.
When to use charges
Use charges when your integration needs to generate an amount receivable for a customer already registered in Asaas.
Some common scenarios include:
- one-off sales;
- billing for services rendered;
- monthly fees or recurring payments controlled by your application;
- transparent checkout, with data sent from the back-end;
- sending an invoice for the customer to pay on a hosted page;
- generating charges with Pix, boleto, or credit card.
If the goal is to allow the customer to choose products, review a purchase summary, or access a hosted payment page with more context, also consider using Payment Link or Checkout.
Before creating a charge
Before creating a charge:
- register a customer in Asaas;
- store the customer identifier, sent in the
customerfield; - define the payment method;
- define the charge amount;
- define the due date;
- choose how to track the charge status after creation.
The customer field represents the customer's ID in Asaas. It is returned when the customer is created and must be stored by your application for use in subsequent operations.
Basic creation flow
In a typical integration, the charge flow follows this journey:
Create customer
↓
Store the customer ID
↓
Create charge
↓
Display or send the invoice to the customer
↓
Track the charge status
↓
Reconcile the payment in the source systemCreate a charge
-
Create a customer and store the returned ID.
-
Create the charge providing the main fields, such as:
customer: customer's ID in Asaas;billingType: payment method;value: charge amount;dueDate: due date inYYYY-MM-DDformat.
-
Choose the charge's payment method. See the guides:
-
If you want to allow the customer to choose the payment method, create a charge with multiple payment options.
-
To use the integration as a transparent checkout, send the charge data through the back-end to the API.
-
To use a hosted payment page, use the charge's Invoice or create a Payment Link.
-
Optionally, configure automatic redirection after payment on Invoices and Payment Links.
Charge tracking
After creation, track the charge through the status returned by the API or through webhooks.
This tracking is important to identify events such as:
- charge created and awaiting payment;
- payment confirmed or received;
- overdue charge;
- charge canceled or removed;
- failure in card payments.
To reduce manual queries and keep your system up to date, we recommend configuring Webhooks to automatically receive status changes.
Important precautions
- Store the charge ID returned by the API for queries, updates, and reconciliation.
- Avoid creating duplicate charges during reprocessing or automatic retries.
- Validate the amount, due date, and customer before sending the request.
- For card charges, handle failure returns and guide the customer to review the payment details.
- For boleto or Pix charges, consider the due date and expiration rules of the payment method.
- If the charge is linked to internal processes, use your own application's identifiers to facilitate reconciliation.
Optional: charge notifications
You can configure the notifications your customer will receive by email, SMS, or WhatsApp.
Available notifications include:
- notice of charge received;
- notice before the due date;
- notice on the due date;
- notice of overdue charge;
- periodic notice after the due date;
- notice of updated charge;
- sending of the digitable line on the due date.
Notifications help reduce delinquency, but should be configured according to your integration's journey and the communication your company wants to maintain with the customer.
Next steps
After understanding the basic charge flow, see the specific guides for the payment method to be used:
Updated 1 day ago
