Invoices V2024_06_19
- class sp_api.api.InvoicesV20240619(marketplace: ~sp_api.base.marketplaces.Marketplaces = Marketplaces.US, *, refresh_token=None, account='default', credentials=None, restricted_data_token=None, proxies=None, verify=True, timeout=None, version=None, credential_providers=None, auth_token_client_class=<class 'sp_api.auth.access_token_client.AccessTokenClient'>)
Invoices SP-API Client :link:
Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.
- get_invoices_attributes(self, **kwargs) ApiResponse
Returns marketplace-dependent schemas and their respective set of possible values.
Usage Plan:
Rate (requests per second)
Burst
1
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoices_attributes()
- Parameters:
marketplaceId (key) – object | required The marketplace identifier.
- Returns:
ApiResponse
- get_invoices_document(self, invoicesDocumentId, **kwargs) ApiResponse
Returns the invoice document’s ID and URL. Use the URL to download the ZIP file, which contains the invoices from the corresponding createInvoicesExport request.
Usage Plan:
Rate (requests per second)
Burst
0.0167
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoices_document("value")
- Parameters:
invoicesDocumentId – object | required The export document identifier.
- Returns:
ApiResponse
- get_invoices_exports(self, **kwargs) ApiResponse
Returns invoice exports details for exports that match the filters that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.1
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoices_exports()
- Parameters:
marketplaceId (key) – object | required The returned exports match the specified marketplace.
dateStart (key) – object | The earliest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 30 days ago.
nextToken (key) – object | The response includes nextToken when the number of results exceeds the specified pageSize value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextToken is null. Note that this operation can return empty pages.
pageSize (key) – object | The maximum number of invoices to return in a single call. Minimum: 1 Maximum: 100
dateEnd (key) – object | The latest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default value is the time of the request.
status (key) – object | Return exports matching the status specified.
- Returns:
ApiResponse
- create_invoices_export(self, **kwargs) ApiResponse
Creates an invoice export request.
Usage Plan:
Rate (requests per second)
Burst
0.167
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().create_invoices_export()
- Parameters:
body – ExportInvoicesRequest | required Information required to create the export request.
- Returns:
ApiResponse
- get_invoices_export(self, exportId, **kwargs) ApiResponse
Returns invoice export details (including the exportDocumentId, if available) for the export that you specify.
Usage Plan:
Rate (requests per second)
Burst
2
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoices_export("value")
- Parameters:
exportId – object | required The unique identifier for the export.
- Returns:
ApiResponse
- get_government_invoice_status(self, **kwargs) ApiResponse
Returns the status of an invoice generation request.
Usage Plan:
Rate (requests per second)
Burst
0.0167
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_government_invoice_status()
- Parameters:
marketplaceId (key) – object | required The invoices status will match the marketplace that you specify.
transactionType (key) – object | required Marketplace specific classification of the transaction type that originated the invoice. Check ‘transactionType’ options using ‘getInvoicesAttributes’ operation.
shipmentId (key) – object | required The unique shipment identifier to get an invoice for.
invoiceType (key) – object | required Marketplace specific classification of the invoice type. Check ‘invoiceType’ options using ‘getInvoicesAttributes’ operation.
inboundPlanId (key) – object | The unique InboundPlan identifier in which the shipment is contained and for which the invoice will be created.
- Returns:
ApiResponse
- create_government_invoice(self, **kwargs) ApiResponse
Submits an asynchronous government invoice creation request.
Usage Plan:
Rate (requests per second)
Burst
0.0167
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().create_government_invoice()
- Parameters:
body – GovernmentInvoiceRequest | required Information required to create the government invoice.
- Returns:
ApiResponse
- get_government_invoice_document(self, shipmentId, **kwargs) ApiResponse
Returns an invoiceDocument object containing an invoiceDocumentUrl .
Usage Plan:
Rate (requests per second)
Burst
0.0167
1
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_government_invoice_document("value")
- Parameters:
marketplaceId (key) – object | required The invoices returned will match the marketplace that you specify.
transactionType (key) – object | required Marketplace specific classification of the transaction type that originated the invoice. Check ‘transactionType’ options using ‘getInvoicesAttributes’ operation.
shipmentId – object | required The unique shipment identifier to get an invoice for.
invoiceType (key) – object | required Marketplace specific classification of the invoice type. Check ‘invoiceType’ options using ‘getInvoicesAttributes’ operation.
inboundPlanId (key) – object | The unique InboundPlan identifier in which the shipment is contained and for which the invoice will be created.
fileFormat (key) – object | Requested file format. Default is XML
- Returns:
ApiResponse
- get_invoices(self, **kwargs) ApiResponse
Returns invoice details for the invoices that match the filters that you specify.
Usage Plan:
Rate (requests per second)
Burst
0.1
20
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoices()
- Parameters:
transactionIdentifierName (key) – object | The name of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the transactionIdentifierId field.Use the getInvoicesAttributes operation to check transactionIdentifierName options.
pageSize (key) – object | The maximum number of invoices you want to return in a single call. Minimum: 1 Maximum: 200
dateEnd (key) – object | The latest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is the current date-time.
marketplaceId (key) – object | required The response includes only the invoices that match the specified marketplace.
transactionType (key) – object | The marketplace-specific classification of the transaction type for which the invoice was created. Use the getInvoicesAttributes operation to check transactionType options.
transactionIdentifierId (key) – object | The ID of the transaction identifier filter. If you provide a value for this field, you must also provide a value for the transactionIdentifierName field.
dateStart (key) – object | The earliest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 24 hours prior to the time of the request.
series (key) – object | Return invoices with the specified series number.
nextToken (key) – object | The response includes nextToken when the number of results exceeds the specified pageSize value. To get the next page of results, call the operation with this token and include the same arguments as the call that produced the token. To get a complete list, call this operation until nextToken is null. Note that this operation can return empty pages.
sortOrder (key) – object | Sort the invoices in the response in ascending or descending order.
invoiceType (key) – object | The marketplace-specific classification of the invoice type. Use the getInvoicesAttributes operation to check invoiceType options.
statuses (key) – object | A list of statuses that you can use to filter invoices. Use the getInvoicesAttributes operation to check invoice status options. Min count: 1
externalInvoiceId (key) – object | Return invoices that match this external ID. This is typically the Government Invoice ID.
sortBy (key) – object | The attribute by which you want to sort the invoices in the response.
- Returns:
ApiResponse
- get_invoice(self, invoiceId, **kwargs) ApiResponse
Returns invoice data for the specified invoice. This operation returns only a subset of the invoices data; refer to the response definition to get all the possible attributes. To get the full invoice, use the createInvoicesExport operation to start an export request.
Usage Plan:
Rate (requests per second)
Burst
2
15
For more information, see “Usage Plans and Rate Limits” in the Selling Partner API documentation.
Examples
literal blocks:
InvoicesV20240619().get_invoice("value")
- Parameters:
marketplaceId (key) – object | required The marketplace from which you want the invoice.
invoiceId – object | required The invoice identifier.
- Returns:
ApiResponse