Invoices API v2024-06-19 Use Case Guide

Learn how to use the Invoices API.

You can use the Selling Partner API for Invoices to retrieve and manage a variety of invoice-related operations that can help selling partners manage their bookkeeping.

Important

This API is only able to retrieve Brazilian FBA invoices. You cannot use this API for any other invoice types.

Key features

  • Search invoices by their attributes
  • Export and download invoices

Tutorial: Export invoice files

Learn how to export and download invoice files.

Prerequisites

To complete this tutorial, you must have:

  • Authorization from the selling partner for whom you are making calls. For more information, refer to Authorizing Selling Partner API applications.
  • The Tax Invoicing role assigned to your developer profile.
  • The Tax Invoicing role selected on the App registration page for your application.

Step 1. Create an invoice export

Call the createInvoicesExport operation and specify the marketplace, date range, and any optional parameters you want to include.

If the request is successful, the response includes an exportId value.

Tip

To reduce export processing time, use short date intervals for dateStart and dateEnd. The optimal range is one day.

Step 2. Verify that export processing is complete

Periodically call the getInvoicesExport operation. Pass the exportId value that you received in Step 1 until processing is complete (processingStatus is CANCELLED, DONE, or FATAL). At this point, the response includes an exportDocumentId value if invoice data is available.

Step 3. Get the invoice document URL

Call the getInvoicesDocument operation, passing the exportDocumentId value from Step 2.

The response contains a pre-signed URL that you can use to access the invoice export. If the contents are compressed, the compressional algorithm is provided. The URL expires after 30 seconds.


OSZAR »