This endpoint is used to attach a document to an existing payment.
The uploaded file is linked to the payment and can be made available for download directly from the Asaas invoice. This is useful when the payment needs to include supporting materials such as a contract, invoice, spreadsheet, media file, or any other file related to the transaction.
Main request parameters
-
id: Unique identifier of the payment in Asaas.
-
availableAfterPayment: Defines when the document will be available to the payer.
true: the file will only be accessible after the payment has been confirmedfalse: the file will be accessible regardless of payment status
-
type: Type of document being uploaded. Possible values are:
INVOICECONTRACTMEDIADOCUMENTSPREADSHEETPROGRAMOTHER
-
file: File to be attached to the payment.
Upload behavior
Once the request is successfully completed, the document becomes linked to the specified payment and can later be retrieved through the list or retrieve endpoints.
The availableAfterPayment setting directly affects the payer’s access to the file. This should be defined according to your integration’s business rules.
When to use
Use this endpoint when you need to:
- attach supporting documents to a payment
- make contracts, invoices, spreadsheets, or media files available to the payer
- control whether the document should be accessible before or only after payment
Next step in the flow
After uploading the document, your application can:
- list the documents linked to the payment
- retrieve a specific document
- update the document settings
- delete the document if needed
404Not found
