Class: Peddler::APIs::Invoices20240619
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::Invoices20240619
- Defined in:
- lib/peddler/apis/invoices_2024_06_19.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.
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #endpoint, #retries
Instance Method Summary collapse
-
#create_invoices_export(body, rate_limit: 0.167) ⇒ Peddler::Response
Creates an invoice export request.
-
#get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) ⇒ Peddler::Response
Returns invoice data for the specified invoice.
-
#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
Returns invoice details for the invoices that match the filters that you specify.
-
#get_invoices_attributes(marketplace_id, rate_limit: 1.0) ⇒ Peddler::Response
Returns marketplace-dependent schemas and their respective set of possible values.
-
#get_invoices_document(invoices_document_id, rate_limit: 0.0167) ⇒ Peddler::Response
Returns the invoice document’s ID and URL.
-
#get_invoices_export(export_id, rate_limit: 2.0) ⇒ Peddler::Response
Returns invoice export details (including the ‘exportDocumentId`, if available) for the export that you specify.
-
#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
Returns invoice exports details for exports that match the filters that you specify.
Methods inherited from Peddler::API
#endpoint_uri, #http, #initialize, #meter, #retriable, #sandbox, #sandbox?, #typed, #typed?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#create_invoices_export(body, rate_limit: 0.167) ⇒ Peddler::Response
This operation can make a static sandbox call.
Creates an invoice export request.
56 57 58 59 60 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 56 def create_invoices_export(body, rate_limit: 0.167) path = "/tax/invoices/2024-06-19/exports" parser = Peddler::Types::Invoices20240619::ExportInvoicesResponse if typed? meter(rate_limit).post(path, body:, parser:) end |
#get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) ⇒ Peddler::Response
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.
174 175 176 177 178 179 180 181 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 174 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 = Peddler::Types::Invoices20240619::GetInvoiceResponse if typed? meter(rate_limit).get(path, params:, 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
This operation can make a static sandbox call.
Returns invoice details for the invoices that match the filters that you specify.
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 141 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 = Peddler::Types::Invoices20240619::GetInvoicesResponse if typed? meter(rate_limit).get(path, params:, parser:) end |
#get_invoices_attributes(marketplace_id, rate_limit: 1.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns marketplace-dependent schemas and their respective set of possible values.
28 29 30 31 32 33 34 35 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 28 def get_invoices_attributes(marketplace_id, rate_limit: 1.0) path = "/tax/invoices/2024-06-19/attributes" params = { "marketplaceId" => marketplace_id, }.compact parser = Peddler::Types::Invoices20240619::GetInvoicesAttributesResponse if typed? meter(rate_limit).get(path, params:, parser:) end |
#get_invoices_document(invoices_document_id, rate_limit: 0.0167) ⇒ Peddler::Response
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.
44 45 46 47 48 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 44 def get_invoices_document(invoices_document_id, rate_limit: 0.0167) path = "/tax/invoices/2024-06-19/documents/#{percent_encode(invoices_document_id)}" parser = Peddler::Types::Invoices20240619::GetInvoicesDocumentResponse if typed? meter(rate_limit).get(path, parser:) end |
#get_invoices_export(export_id, rate_limit: 2.0) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns invoice export details (including the ‘exportDocumentId`, if available) for the export that you specify.
101 102 103 104 105 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 101 def get_invoices_export(export_id, rate_limit: 2.0) path = "/tax/invoices/2024-06-19/exports/#{percent_encode(export_id)}" parser = Peddler::Types::Invoices20240619::GetInvoicesExportResponse if typed? meter(rate_limit).get(path, 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
This operation can make a static sandbox call.
Returns invoice exports details for exports that match the filters that you specify.
80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 80 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 = Peddler::Types::Invoices20240619::GetInvoicesExportsResponse if typed? meter(rate_limit).get(path, params:, parser:) end |