Class: Peddler::APIs::Invoices20240619
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::Invoices20240619
- 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,
sig/peddler/apis/invoices_2024_06_19.rbs
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.
Defined Under Namespace
Classes: AttributeOption, CarrierDetailsContext, Error, ErrorList, Export, ExportInvoicesRequest, ExportInvoicesResponse, GetInvoiceResponse, GetInvoicesAttributesResponse, GetInvoicesDocumentResponse, GetInvoicesExportResponse, GetInvoicesExportsResponse, GetInvoicesResponse, GovernmentInvoiceRequest, GovernmentInvoiceStatusResponse, GovtInvoiceDocumentResponse, Invoice, InvoiceDocument, InvoiceError, InvoicesAttributes, InvoicesDocument, TransactionIdentifier
Constant Summary
Constants inherited from Peddler::API
Peddler::API::TRANSIENT_STATUSES
Instance Attribute Summary
Attributes inherited from Peddler::API
#access_token, #base_url, #endpoint, #retries
Instance Method Summary collapse
-
#create_government_invoice(body) ⇒ Peddler::Response
Submit an asynchronous request to create a government invoice.
-
#create_invoices_export(body) ⇒ Peddler::Response
Creates an invoice export request.
-
#get_government_invoice_document(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil, file_format: nil) ⇒ Peddler::Response
Retrieve the URL of an invoice document.
-
#get_government_invoice_status(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil) ⇒ Peddler::Response
Retrieve the status of an invoice generation request.
-
#get_invoice(marketplace_id, invoice_id) ⇒ 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) ⇒ Peddler::Response
Returns invoice details for the invoices that match the filters that you specify.
-
#get_invoices_attributes(marketplace_id) ⇒ Peddler::Response
Returns marketplace-dependent schemas and their respective set of possible values.
-
#get_invoices_document(invoices_document_id) ⇒ Peddler::Response
Returns the invoice document's ID and URL.
-
#get_invoices_export(export_id) ⇒ 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) ⇒ Peddler::Response
Returns invoice exports details for exports that match the filters that you specify.
Methods inherited from Peddler::API
#cannot_sandbox!, #delete, #endpoint_uri, #get, #host_header, #http, #initialize, #must_sandbox!, #parse_base_url, #patch, #percent_encode, #post, #put, #request, #sandbox, #sandbox?, #stringify_array, #timestamp, #user_agent
Constructor Details
This class inherits a constructor from Peddler::API
Instance Method Details
#create_government_invoice(body) ⇒ Peddler::Response
This operation can make a static sandbox call.
Submit an asynchronous request to create a government invoice.
99 100 101 102 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 99 def create_government_invoice(body) path = "/tax/invoices/2024-06-19/governmentInvoiceRequests" post(path, body:) end |
#create_invoices_export(body) ⇒ Peddler::Response
This operation can make a static sandbox call.
Creates an invoice export request.
45 46 47 48 49 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 45 def create_invoices_export(body) path = "/tax/invoices/2024-06-19/exports" parser = -> { ExportInvoicesResponse } post(path, body:, parser:) end |
#get_government_invoice_document(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil, file_format: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve the URL of an invoice document.
143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 143 def get_government_invoice_document(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil, file_format: nil) 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:, parser:) end |
#get_government_invoice_status(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Retrieve the status of an invoice generation request.
116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 116 def get_government_invoice_status(marketplace_id, transaction_type, shipment_id, invoice_type, inbound_plan_id: nil) 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:, parser:) end |
#get_invoice(marketplace_id, invoice_id) ⇒ 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.
222 223 224 225 226 227 228 229 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 222 def get_invoice(marketplace_id, invoice_id) path = "/tax/invoices/2024-06-19/invoices/#{percent_encode(invoice_id)}" params = { "marketplaceId" => marketplace_id, }.compact parser = -> { GetInvoiceResponse } 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) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns invoice details for the invoices that match the filters that you specify.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 190 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) 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:, parser:) end |
#get_invoices_attributes(marketplace_id) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns marketplace-dependent schemas and their respective set of possible values.
19 20 21 22 23 24 25 26 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 19 def get_invoices_attributes(marketplace_id) path = "/tax/invoices/2024-06-19/attributes" params = { "marketplaceId" => marketplace_id, }.compact parser = -> { GetInvoicesAttributesResponse } get(path, params:, parser:) end |
#get_invoices_document(invoices_document_id) ⇒ 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.
34 35 36 37 38 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 34 def get_invoices_document(invoices_document_id) path = "/tax/invoices/2024-06-19/documents/#{percent_encode(invoices_document_id)}" parser = -> { GetInvoicesDocumentResponse } get(path, parser:) end |
#get_invoices_export(export_id) ⇒ 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.
88 89 90 91 92 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 88 def get_invoices_export(export_id) path = "/tax/invoices/2024-06-19/exports/#{percent_encode(export_id)}" parser = -> { GetInvoicesExportResponse } get(path, parser:) end |
#get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil, status: nil) ⇒ Peddler::Response
This operation can make a static sandbox call.
Returns invoice exports details for exports that match the filters that you specify.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/peddler/apis/invoices_2024_06_19.rb', line 68 def get_invoices_exports(marketplace_id, date_start: nil, next_token: nil, page_size: nil, date_end: nil, status: nil) 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:, parser:) end |