Automatically issue invoices for subscriptions

When you create a setting, Asaas will automatically generate invoices for the charges of this subscription using the values defined in this setting.

POST /v3/subscriptions/{id}/invoiceSettings
Check the complete reference of this endpoint.

Invoices will be generated together with the creation of charges, with their issue dates defined based on the value sent by the effectiveDatePeriod parameter.

If the subscription already has charges, invoices will only be generated for the charges that fit the defined setting.

The available issue periods are:

  • ON_PAYMENT_CONFIRMATION - Issue only when each charge is paid.
  • ON_PAYMENT_DUE_DATE - On the due date of each charge.
  • BEFORE_PAYMENT_DUE_DATE - 5, 10, 15, 30, or 60 days before the due date.
  • ON_DUE_DATE_MONTH - On the 1st day of the same month of the due date of each charge.
  • ON_NEXT_MONTH - On the 1st day of the month following the month of the due date of each charge.

You can inform the desired municipal service by sending the unique identifier of your municipality's service through the municipalServiceId attribute, which can be obtained through our section on municipal services.

If the list of services is not available, you must manually obtain the code of the desired municipal service from your city hall and send it through the municipalServiceCode attribute.

🚧

Attention

  • If the period BEFORE_PAYMENT_DUE_DATE is selected, the daysBeforeDueDate parameter, which determines how many days before the due date the invoice will be generated, must also be sent.
  • The valid values for the daysBeforeDueDate parameter are the integers: 5, 10, 15, 30, or 60.
  • The receivedOnly parameter is only necessary when using the ON_NEXT_MONTH period; if not sent, it will be set to the default value false.