Class: Peddler::API::Invoices20240619
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::API::Invoices20240619
- Defined in:
- lib/peddler/api/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
Instance Method Summary collapse
-
#create_invoices_export(body, rate_limit: 0.167) ⇒ Hash
Creates an invoice export request.
-
#get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) ⇒ Hash
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) ⇒ Hash
Returns invoice details for the invoices that match the filters that you specify.
-
#get_invoices_attributes(marketplace_id, rate_limit: 1.0) ⇒ Hash
Returns marketplace-dependent schemas and their respective set of possible values.
-
#get_invoices_document(invoices_document_id, rate_limit: 0.0167) ⇒ Hash
Returns the invoice document’s ID and URL.
-
#get_invoices_export(export_id, rate_limit: 2.0) ⇒ Hash
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) ⇒ Hash
Returns invoice exports details for exports that match the filters that you specify.
Methods inherited from Peddler::API
#cannot_sandbox!, #endpoint_uri, #http, #initialize, #meter, #must_sandbox!, #retriable, #sandbox, #sandbox?, #use, #via
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#create_invoices_export(body, rate_limit: 0.167) ⇒ Hash
This operation can make a static sandbox call.
Creates an invoice export request.
52 53 54 55 56 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 52 def create_invoices_export(body, rate_limit: 0.167) path = "/tax/invoices/2024-06-19/exports" meter(rate_limit).post(path, body:) end |
#get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) ⇒ Hash
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.
170 171 172 173 174 175 176 177 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 170 def get_invoice(marketplace_id, invoice_id, rate_limit: 2.0) path = "/tax/invoices/2024-06-19/invoices/#{invoice_id}" params = { "marketplaceId" => marketplace_id, }.compact meter(rate_limit).get(path, params:) 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) ⇒ Hash
This operation can make a static sandbox call.
Returns invoice details for the invoices that match the filters that you specify.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 137 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" => statuses, "externalInvoiceId" => external_invoice_id, "sortBy" => sort_by, }.compact meter(rate_limit).get(path, params:) end |
#get_invoices_attributes(marketplace_id, rate_limit: 1.0) ⇒ Hash
This operation can make a static sandbox call.
Returns marketplace-dependent schemas and their respective set of possible values.
24 25 26 27 28 29 30 31 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 24 def get_invoices_attributes(marketplace_id, rate_limit: 1.0) path = "/tax/invoices/2024-06-19/attributes" params = { "marketplaceId" => marketplace_id, }.compact meter(rate_limit).get(path, params:) end |
#get_invoices_document(invoices_document_id, rate_limit: 0.0167) ⇒ Hash
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.
40 41 42 43 44 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 40 def get_invoices_document(invoices_document_id, rate_limit: 0.0167) path = "/tax/invoices/2024-06-19/documents/#{invoices_document_id}" meter(rate_limit).get(path) end |
#get_invoices_export(export_id, rate_limit: 2.0) ⇒ Hash
This operation can make a static sandbox call.
Returns invoice export details (including the ‘exportDocumentId`, if available) for the export that you specify.
97 98 99 100 101 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 97 def get_invoices_export(export_id, rate_limit: 2.0) path = "/tax/invoices/2024-06-19/exports/#{export_id}" meter(rate_limit).get(path) end |
#get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil, status: nil, rate_limit: 0.1) ⇒ Hash
This operation can make a static sandbox call.
Returns invoice exports details for exports that match the filters that you specify.
76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/peddler/api/invoices_2024_06_19.rb', line 76 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 meter(rate_limit).get(path, params:) end |