Learn how to export and download invoice files.
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.
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.
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.
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.