Class: Peddler::APIs::Invoices20240619

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/invoices_2024_06_19.rb,
lib/peddler/apis/invoices_2024_06_19/error.rb,
lib/peddler/apis/invoices_2024_06_19/export.rb,
lib/peddler/apis/invoices_2024_06_19/invoice.rb,
lib/peddler/apis/invoices_2024_06_19/error_list.rb,
lib/peddler/apis/invoices_2024_06_19/invoice_error.rb,
lib/peddler/apis/invoices_2024_06_19/attribute_option.rb,
lib/peddler/apis/invoices_2024_06_19/invoice_document.rb,
lib/peddler/apis/invoices_2024_06_19/invoices_document.rb,
lib/peddler/apis/invoices_2024_06_19/invoices_attributes.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoice_response.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoices_response.rb,
lib/peddler/apis/invoices_2024_06_19/transaction_identifier.rb,
lib/peddler/apis/invoices_2024_06_19/carrier_details_context.rb,
lib/peddler/apis/invoices_2024_06_19/export_invoices_request.rb,
lib/peddler/apis/invoices_2024_06_19/export_invoices_response.rb,
lib/peddler/apis/invoices_2024_06_19/government_invoice_request.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoices_export_response.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoices_exports_response.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoices_document_response.rb,
lib/peddler/apis/invoices_2024_06_19/govt_invoice_document_response.rb,
lib/peddler/apis/invoices_2024_06_19/get_invoices_attributes_response.rb,
lib/peddler/apis/invoices_2024_06_19/government_invoice_status_response.rb

Overview

The Selling Partner API for Invoices.

Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.

Constant Summary collapse

Error =

The error response that is returned when the request is unsuccessful.

Structure.new do
  # @return [String] An error code that identifies the type of error that occurred.
  attribute(:code, String, null: false)

  # @return [String] A message that describes the error condition.
  attribute(:message, String, null: false)

  # @return [String] Additional details that can help the caller understand or fix the issue.
  attribute?(:details, String)
end
Export =

Detailed information about the export.

Structure.new do
  # @return [String] When the export generation fails, this attribute contains a description of the error.
  attribute?(:error_message, String, from: "errorMessage")

  # @return [String] The export identifier.
  attribute?(:export_id, String, from: "exportId")

  # @return [Time] The date and time when the export generation finished. Vales are in [ISO
  #   8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
  attribute?(:generate_export_finished_at, Time, from: "generateExportFinishedAt")

  # @return [Time] The date and time when the export generation started. Values are in [ISO
  #   8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
  attribute?(:generate_export_started_at, Time, from: "generateExportStartedAt")

  # @return [Array<String>] The identifier for the export documents. To get the information required to retrieve
  #   the export document's contents, pass each ID in the `getInvoicesDocument` operation.
  #
  # This list is empty until the status is `DONE`.
  attribute?(:invoices_document_ids, [String], from: "invoicesDocumentIds")

  # @return [String]
  attribute?(:status, String)
end
Invoice =

Provides detailed information about an invoice.

Structure.new do
  # @return [Time] The date and time the invoice is issued. Values are in [ISO
  #   8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
  attribute?(:date, Time)

  # @return [String] If the invoice is in an error state, this attribute displays the error code.
  attribute?(:error_code, String, from: "errorCode")

  # @return [String] The invoice identifier that is used by an external party. This is typically the government
  #   agency that authorized the invoice.
  attribute?(:external_invoice_id, String, from: "externalInvoiceId")

  # @return [String] The response message from the government authority when there is an error during invoice
  #   issuance.
  attribute?(:gov_response, String, from: "govResponse")

  # @return [String] The invoice identifier.
  attribute?(:id, String)

  # @return [String] The classification of the invoice type. This varies across marketplaces. Use the
  #   `getInvoicesAttributes` operation to check `invoiceType` options.
  attribute?(:invoice_type, String, from: "invoiceType")

  # @return [String] Use this identifier in conjunction with `externalInvoiceId` to identify invoices from the
  #   same seller.
  attribute?(:series, String)

  # @return [String] The invoice status classification. Use the `getInvoicesAttributes` operation to check invoice
  #   status options.
  attribute?(:status, String)

  # @return [Array<TransactionIdentifier>] List with identifiers for the transactions associated to the invoice.
  attribute?(:transaction_ids, [TransactionIdentifier], from: "transactionIds")

  # @return [String] Classification of the transaction that originated this invoice. Use the
  #   `getInvoicesAttributes` operation to check `transactionType` options.
  attribute?(:transaction_type, String, from: "transactionType")
end
ErrorList =

A list of error responses that are returned when a request is unsuccessful.

Structure.new do
  # @return [Array<Error>] List of errors.
  attribute(:errors, [Error], null: false)
end
InvoiceError =

An invoice creation error occurrence.

Structure.new do
  # @return [String] A text description of the error.
  attribute?(:description, String)

  # @return [String] The code of the error.
  attribute?(:error_code, String, from: "errorCode")
end
AttributeOption =

The definition of the attribute option.

Structure.new do
  # @return [String] The description of the attribute value.
  attribute?(:description, String)

  # @return [String] The possible values for the attribute option.
  attribute?(:value, String)
end
InvoiceDocument =

Object containing the documentId and a S3 pre-signed URL to download the specified document file.

Structure.new do
  # @return [String] A pre-signed URL to download the invoice document in its original format. This URL expires
  #   after 30 seconds.
  attribute?(:invoice_document_url, String, from: "invoiceDocumentUrl")
end
InvoicesDocument =

An object that contains the ‘documentId` and an S3 pre-signed URL that you can use to download the specified file.

Structure.new do
  # @return [String] The identifier of the export document.
  attribute?(:invoices_document_id, String, from: "invoicesDocumentId")

  # @return [String] A pre-signed URL that you can use to download the invoices document in zip format. This URL
  #   expires after 30 seconds.
  attribute?(:invoices_document_url, String, from: "invoicesDocumentUrl")
end
InvoicesAttributes =

An object that contains the invoice attributes definition.

Structure.new do
  # @return [Array<AttributeOption>] A list of all the options that are available for the invoice status
  #   attribute.
  attribute?(:invoice_status_options, [AttributeOption], from: "invoiceStatusOptions")

  # @return [Array<AttributeOption>] A list of all the options that are available for the invoice type attribute.
  attribute?(:invoice_type_options, [AttributeOption], from: "invoiceTypeOptions")

  # @return [Array<AttributeOption>] A list of all the options that are available for the transaction identifier
  #   name attribute.
  attribute?(:transaction_identifier_name_options, [AttributeOption], from: "transactionIdentifierNameOptions")

  # @return [Array<AttributeOption>] A list of all the options that are available for the transaction type
  #   attribute.
  attribute?(:transaction_type_options, [AttributeOption], from: "transactionTypeOptions")
end
GetInvoiceResponse =

Success.

Structure.new do
  # @return [Invoice]
  attribute?(:invoice, Invoice)
end
GetInvoicesResponse =

Success.

Structure.new do
  # @return [Array<Invoice>] A list of invoices.
  attribute?(:invoices, [Invoice])

  # @return [String] This token is returned when the number of results exceeds the specified `pageSize` value. To
  #   get the next page of results, call the `getInvoices` operation and include this token with the previous call
  #   parameters.
  attribute?(:next_token, String, from: "nextToken")
end
TransactionIdentifier =

The identifier for a transaction.

Structure.new do
  # @return [String] The transaction identifier.
  attribute?(:id, String)

  # @return [String] The transaction identifier name. Use the `getInvoicesAttributes` operation to check
  #   `transactionIdentifierName` options.
  attribute?(:name, String)
end
CarrierDetailsContext =

Additional information about a carrier.

Structure.new do
  # @return [String] The address of the carrier, as registered in state and federal tax authorities.
  attribute?(:address, String)

  # @return [String] Type of additional information.
  attribute?(:context_type, String, from: "contextType")

  # @return [String] Tax Identification number of the carrier.
  attribute?(:federal_tax_id, String, from: "federalTaxId")

  # @return [String] The name of the carrier, as registered in state and federal tax authorities.
  attribute?(:name, String)

  # @return [String] The code of the federal subdivision in which the carrier is registered.
  attribute?(:region_code, String, from: "regionCode")

  # @return [String] The regional tax registration number of the carrier.
  attribute?(:region_tax_id, String, from: "regionTaxId")

  # @return [String] The identifier for the carrier vehicle as printed in its registration plate.
  attribute?(:vehicle_license_plate, String, from: "vehicleLicensePlate")

  # @return [String] The code of the federal subdivision in which the carrier vehicle is registered.
  attribute?(:vehicle_registration_region_code, String, from: "vehicleRegistrationRegionCode")
end
ExportInvoicesRequest =

The information required to create the export request.

Structure.new do
  # @return [String] The ID of the marketplace from which you want the invoices.
  attribute(:marketplace_id, String, null: false, from: "marketplaceId")

  # @return [Date] 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 time of the request.
  attribute?(:date_end, Date, from: "dateEnd")

  # @return [Date] 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.
  attribute?(:date_start, Date, from: "dateStart")

  # @return [String] The external ID of the invoices you want included in the response.
  attribute?(:external_invoice_id, String, from: "externalInvoiceId")

  # @return [String]
  attribute?(:file_format, String, from: "fileFormat")

  # @return [String] The marketplace-specific classification of the invoice type. Use the `getInvoicesAttributes`
  #   operation to check `invoiceType` options.
  attribute?(:invoice_type, String, from: "invoiceType")

  # @return [String] The series number of the invoices you want included in the response.
  attribute?(:series, String)

  # @return [Array<String>] A list of statuses that you can use to filter invoices. Use the
  #   `getInvoicesAttributes` operation to check invoice status options.
  #
  # Min count: 1
  attribute?(:statuses, [String])

  # @return [TransactionIdentifier]
  attribute?(:transaction_identifier, TransactionIdentifier, from: "transactionIdentifier")

  # @return [String] The marketplace-specific classification of the transaction type for which the invoice was
  #   created. Use the `getInvoicesAttributes` operation to check `transactionType` options
  attribute?(:transaction_type, String, from: "transactionType")
end
ExportInvoicesResponse =

Success.

Structure.new do
  # @return [String] The export identifier.
  attribute?(:export_id, String, from: "exportId")
end
GovernmentInvoiceRequest =

Information required to create the government invoice.

Structure.new do
  # @return [String] Marketplace specific classification of the invoice type. Check 'invoiceType' options using
  #   'getInvoicesAttributes' operation.
  attribute(:invoice_type, String, null: false, from: "invoiceType")

  # @return [String] The government invoices creation request will match the national authoritative source of the
  #   given marketplace.
  attribute(:marketplace_id, String, null: false, from: "marketplaceId")

  # @return [String] The unique shipment identifier to get an invoice for.
  attribute(:shipment_id, String, null: false, from: "shipmentId")

  # @return [String] Marketplace specific classification of the transaction type that originated the invoice.
  #   Check 'transactionType' options using 'getInvoicesAttributes' operation.
  attribute(:transaction_type, String, null: false, from: "transactionType")

  # @return [Array<CarrierDetailsContext>] Object that contains additional invoice creation information
  attribute?(:contexts, [CarrierDetailsContext])

  # @return [String] The unique InboundPlan identifier in which the shipment is contained and for which the
  #   invoice will be created.
  attribute?(:inbound_plan_id, String, from: "inboundPlanId")
end
GetInvoicesExportResponse =

Success.

Structure.new do
  # @return [Export]
  attribute?(:export, Export)
end
GetInvoicesExportsResponse =

Success.

Structure.new do
  # @return [Array<Export>] A list of exports.
  attribute?(:exports, [Export])

  # @return [String] This token is returned when the number of results exceeds the specified `pageSize` value. To
  #   get the next page of results, call the `getInvoices` operation and include this token with the previous call
  #   parameters.
  attribute?(:next_token, String, from: "nextToken")
end
GetInvoicesDocumentResponse =

Success.

Structure.new do
  # @return [InvoicesDocument]
  attribute?(:invoices_document, InvoicesDocument, from: "invoicesDocument")
end
GovtInvoiceDocumentResponse =

Success.

Structure.new do
  # @return [InvoiceDocument]
  attribute?(:invoice_document, InvoiceDocument, from: "invoiceDocument")
end
GetInvoicesAttributesResponse =

Success.

Structure.new do
  # @return [InvoicesAttributes]
  attribute?(:invoices_attributes, InvoicesAttributes, from: "invoicesAttributes")
end
GovernmentInvoiceStatusResponse =

Success.

Structure.new do
  # @return [Array<InvoiceError>] The errors that occurred during invoice creation.
  attribute?(:invoice_errors, [InvoiceError], from: "invoiceErrors")

  # @return [String] Government Invoice ID of a successfully authorized invoice.
  attribute?(:invoice_external_document_id, String, from: "invoiceExternalDocumentId")

  # @return [String]
  attribute?(:status, String)
end

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#endpoint_uri, #http, #initialize, #sandbox, #sandbox?

Constructor Details

This class inherits a constructor from Peddler::API

Instance Method Details

#create_government_invoice(body, rate_limit: 0.0167) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Submits an asynchronous government invoice creation request.

Parameters:

  • body (Hash)

    Information required to create the government invoice.

  • rate_limit (Float) (defaults to: 0.0167)

    Requests per second

Returns:



105
106
107
108
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 105

def create_government_invoice(body, rate_limit: 0.0167)
  path = "/tax/invoices/2024-06-19/governmentInvoiceRequests"
  post(path, body:, rate_limit:)
end

#create_invoices_export(body, rate_limit: 0.167) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Creates an invoice export request.

Parameters:

  • body (Hash)

    Information required to create the export request.

  • rate_limit (Float) (defaults to: 0.167)

    Requests per second

Returns:



48
49
50
51
52
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 48

def create_invoices_export(body, rate_limit: 0.167)
  path = "/tax/invoices/2024-06-19/exports"
  parser = -> { ExportInvoicesResponse }
  post(path, body:, rate_limit:, parser:)
end

#get_government_invoice_document(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil, file_format: nil, rate_limit: 0.0167) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns an invoiceDocument object containing an invoiceDocumentUrl .

Parameters:

  • marketplace_id (String)

    The invoices returned will match the marketplace that you specify.

  • transaction_type (String)

    Marketplace specific classification of the transaction type that originated the invoice. Check ‘transactionType’ options using ‘getInvoicesAttributes’ operation.

  • shipment_id (String)

    The unique shipment identifier to get an invoice for.

  • invoice_type (String)

    Marketplace specific classification of the invoice type. Check ‘invoiceType’ options using ‘getInvoicesAttributes’ operation.

  • inbound_plan_id (String) (defaults to: nil)

    The unique InboundPlan identifier in which the shipment is contained and for which the invoice will be created.

  • file_format (String) (defaults to: nil)

    Requested file format. Default is XML

  • rate_limit (Float) (defaults to: 0.0167)

    Requests per second

Returns:



151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 151

def get_government_invoice_document(marketplace_id, transaction_type, shipment_id, invoice_type,
  inbound_plan_id: nil, file_format: nil, rate_limit: 0.0167)
  path = "/tax/invoices/2024-06-19/governmentInvoiceRequests/#{percent_encode(shipment_id)}"
  params = {
    "marketplaceId" => marketplace_id,
    "transactionType" => transaction_type,
    "invoiceType" => invoice_type,
    "inboundPlanId" => inbound_plan_id,
    "fileFormat" => file_format,
  }.compact
  parser = -> { GovtInvoiceDocumentResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_government_invoice_status(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil, rate_limit: 0.0167) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the status of an invoice generation request.

Parameters:

  • marketplace_id (String)

    The invoices status will match the marketplace that you specify.

  • transaction_type (String)

    Marketplace specific classification of the transaction type that originated the invoice. Check ‘transactionType’ options using ‘getInvoicesAttributes’ operation.

  • shipment_id (String)

    The unique shipment identifier to get an invoice for.

  • invoice_type (String)

    Marketplace specific classification of the invoice type. Check ‘invoiceType’ options using ‘getInvoicesAttributes’ operation.

  • inbound_plan_id (String) (defaults to: nil)

    The unique InboundPlan identifier in which the shipment is contained and for which the invoice will be created.

  • rate_limit (Float) (defaults to: 0.0167)

    Requests per second

Returns:



123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 123

def get_government_invoice_status(marketplace_id, transaction_type, shipment_id, invoice_type,
  inbound_plan_id: nil, rate_limit: 0.0167)
  path = "/tax/invoices/2024-06-19/governmentInvoiceRequests"
  params = {
    "marketplaceId" => marketplace_id,
    "transactionType" => transaction_type,
    "shipmentId" => shipment_id,
    "invoiceType" => invoice_type,
    "inboundPlanId" => inbound_plan_id,
  }.compact
  parser = -> { GovernmentInvoiceStatusResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

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.

Parameters:

  • marketplace_id (String)

    The marketplace from which you want the invoice.

  • invoice_id (String)

    The invoice identifier.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



232
233
234
235
236
237
238
239
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 232

def get_invoice(marketplace_id, invoice_id, rate_limit: 2.0)
  path = "/tax/invoices/2024-06-19/invoices/#{percent_encode(invoice_id)}"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = -> { GetInvoiceResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_invoices(marketplace_id, transaction_identifier_name: nil, page_size: nil, date_end: nil, transaction_type: nil, transaction_identifier_id: nil, date_start: nil, series: nil, next_token: nil, sort_order: nil, invoice_type: nil, statuses: nil, external_invoice_id: nil, sort_by: nil, rate_limit: 0.1) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns invoice details for the invoices that match the filters that you specify.

Parameters:

  • transaction_identifier_name (String) (defaults to: nil)

    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.

  • page_size (Integer) (defaults to: nil)

    The maximum number of invoices you want to return in a single call. Minimum: 1 Maximum: 200

  • date_end (String) (defaults to: nil)

    The latest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is the current date-time.

  • marketplace_id (String)

    The response includes only the invoices that match the specified marketplace.

  • transaction_type (String) (defaults to: nil)

    The marketplace-specific classification of the transaction type for which the invoice was created. Use the ‘getInvoicesAttributes` operation to check `transactionType` options.

  • transaction_identifier_id (String) (defaults to: nil)

    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.

  • date_start (String) (defaults to: nil)

    The earliest invoice creation date for invoices that you want to include in the response. Dates are in [ISO 8601](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 (String) (defaults to: nil)

    Return invoices with the specified series number.

  • next_token (String) (defaults to: nil)

    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.

  • sort_order (String) (defaults to: nil)

    Sort the invoices in the response in ascending or descending order.

  • invoice_type (String) (defaults to: nil)

    The marketplace-specific classification of the invoice type. Use the ‘getInvoicesAttributes` operation to check `invoiceType` options.

  • statuses (Array<String>) (defaults to: nil)

    A list of statuses that you can use to filter invoices. Use the ‘getInvoicesAttributes` operation to check invoice status options. Min count: 1

  • external_invoice_id (String) (defaults to: nil)

    Return invoices that match this external ID. This is typically the Government Invoice ID.

  • sort_by (String) (defaults to: nil)

    The attribute by which you want to sort the invoices in the response.

  • rate_limit (Float) (defaults to: 0.1)

    Requests per second

Returns:



199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 199

def get_invoices(marketplace_id, transaction_identifier_name: nil, page_size: nil, date_end: nil,
  transaction_type: nil, transaction_identifier_id: nil, date_start: nil, series: nil, next_token: nil,
  sort_order: nil, invoice_type: nil, statuses: nil, external_invoice_id: nil, sort_by: nil, rate_limit: 0.1)
  path = "/tax/invoices/2024-06-19/invoices"
  params = {
    "transactionIdentifierName" => transaction_identifier_name,
    "pageSize" => page_size,
    "dateEnd" => date_end,
    "marketplaceId" => marketplace_id,
    "transactionType" => transaction_type,
    "transactionIdentifierId" => transaction_identifier_id,
    "dateStart" => date_start,
    "series" => series,
    "nextToken" => next_token,
    "sortOrder" => sort_order,
    "invoiceType" => invoice_type,
    "statuses" => stringify_array(statuses),
    "externalInvoiceId" => external_invoice_id,
    "sortBy" => sort_by,
  }.compact
  parser = -> { GetInvoicesResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_invoices_attributes(marketplace_id, rate_limit: 1.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns marketplace-dependent schemas and their respective set of possible values.

Parameters:

  • marketplace_id (String)

    The marketplace identifier.

  • rate_limit (Float) (defaults to: 1.0)

    Requests per second

Returns:



20
21
22
23
24
25
26
27
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 20

def get_invoices_attributes(marketplace_id, rate_limit: 1.0)
  path = "/tax/invoices/2024-06-19/attributes"
  params = {
    "marketplaceId" => marketplace_id,
  }.compact
  parser = -> { GetInvoicesAttributesResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_invoices_document(invoices_document_id, rate_limit: 0.0167) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

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.

Parameters:

  • invoices_document_id (String)

    The export document identifier.

  • rate_limit (Float) (defaults to: 0.0167)

    Requests per second

Returns:



36
37
38
39
40
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 36

def get_invoices_document(invoices_document_id, rate_limit: 0.0167)
  path = "/tax/invoices/2024-06-19/documents/#{percent_encode(invoices_document_id)}"
  parser = -> { GetInvoicesDocumentResponse }
  get(path, rate_limit:, parser:)
end

#get_invoices_export(export_id, rate_limit: 2.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns invoice export details (including the ‘exportDocumentId`, if available) for the export that you specify.

Parameters:

  • export_id (String)

    The unique identifier for the export.

  • rate_limit (Float) (defaults to: 2.0)

    Requests per second

Returns:



93
94
95
96
97
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 93

def get_invoices_export(export_id, rate_limit: 2.0)
  path = "/tax/invoices/2024-06-19/exports/#{percent_encode(export_id)}"
  parser = -> { GetInvoicesExportResponse }
  get(path, rate_limit:, parser:)
end

#get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil, status: nil, rate_limit: 0.1) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns invoice exports details for exports that match the filters that you specify.

Parameters:

  • marketplace_id (String)

    The returned exports match the specified marketplace.

  • date_start (String) (defaults to: nil)

    The earliest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default is 30 days ago.

  • next_token (String) (defaults to: nil)

    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.

  • page_size (Integer) (defaults to: nil)

    The maximum number of invoices to return in a single call. Minimum: 1 Maximum: 100

  • date_end (String) (defaults to: nil)

    The latest export creation date and time for exports that you want to include in the response. Values are in [ISO 8601](developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format. The default value is the time of the request.

  • status (String) (defaults to: nil)

    Return exports matching the status specified.

  • rate_limit (Float) (defaults to: 0.1)

    Requests per second

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 72

def get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil,
  status: nil, rate_limit: 0.1)
  path = "/tax/invoices/2024-06-19/exports"
  params = {
    "marketplaceId" => marketplace_id,
    "dateStart" => date_start,
    "nextToken" => next_token,
    "pageSize" => page_size,
    "dateEnd" => date_end,
    "status" => status,
  }.compact
  parser = -> { GetInvoicesExportsResponse }
  get(path, params:, rate_limit:, parser:)
end