Class: Peddler::APIs::DeliveryByAmazon20220701

Inherits:
Peddler::API
  • Object
show all
Defined in:
lib/peddler/apis/delivery_by_amazon_2022_07_01.rb,
lib/peddler/apis/delivery_by_amazon_2022_07_01/error.rb,
lib/peddler/apis/delivery_by_amazon_2022_07_01/error_list.rb,
lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_request.rb,
lib/peddler/apis/delivery_by_amazon_2022_07_01/submit_invoice_response.rb,
lib/peddler/apis/delivery_by_amazon_2022_07_01/get_invoice_status_response.rb,
sig/peddler/apis/delivery_by_amazon_2022_07_01.rbs

Overview

Selling Partner API for Delivery Shipment Invoicing

The Selling Partner API for Delivery Shipment Invoicing helps you programmatically retrieve shipment invoice information in the Brazil marketplace for a selling partner’s orders.

Defined Under Namespace

Classes: Error, ErrorList, GetInvoiceStatusResponse, SubmitInvoiceRequest, SubmitInvoiceResponse

Instance Attribute Summary

Attributes inherited from Peddler::API

#access_token, #endpoint, #retries

Instance Method Summary collapse

Methods inherited from Peddler::API

#cannot_sandbox!, #delete, #endpoint_uri, #get, #http, #initialize, #must_sandbox!, #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

#get_invoice_status(marketplace_id, invoice_type, program_type, order_id: nil, shipment_id: nil, rate_limit: 1.133) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the invoice status for the order or shipment you specify. You must specify either an orderId or shipmentId as query parameter. If both parameters are supplied, orderId takes precedence over shipmentId.

Parameters:

  • order_id (String) (defaults to: nil)

    The order identifier.

  • shipment_id (String) (defaults to: nil)

    The shipment identifier.

  • marketplace_id (String)

    The marketplace identifier.

  • invoice_type (String)

    The invoice's type.

  • program_type (String)

    The Amazon program that seller is currently enrolled.

  • rate_limit (Float) (defaults to: 1.133)

    Requests per second

  • (String)
  • (String)
  • (String)
  • order_id: (String, nil) (defaults to: nil)
  • shipment_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 1.133)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/peddler/apis/delivery_by_amazon_2022_07_01.rb', line 44

def get_invoice_status(marketplace_id, invoice_type, program_type, order_id: nil, shipment_id: nil,
  rate_limit: 1.133)
  path = "/delivery/2022-07-01/invoice/status"
  params = {
    "orderId" => order_id,
    "shipmentId" => shipment_id,
    "marketplaceId" => marketplace_id,
    "invoiceType" => invoice_type,
    "programType" => program_type,
  }.compact
  parser = -> { GetInvoiceStatusResponse }
  get(path, params:, rate_limit:, parser:)
end

#submit_invoice(body, order_id: nil, shipment_id: nil, rate_limit: 1.133) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Submits a shipment invoice for a given order or shipment. You must specify either an orderId or shipmentId as query parameter. If both parameters are supplied, orderId takes precedence over shipmentId.

Parameters:

  • order_id (String) (defaults to: nil)

    The identifier for the order.

  • shipment_id (String) (defaults to: nil)

    The identifier for the shipment.

  • body (Hash)

    The request body that specifies invoice, program and marketplace values.

  • rate_limit (Float) (defaults to: 1.133)

    Requests per second

  • (Hash[untyped, untyped])
  • order_id: (String, nil) (defaults to: nil)
  • shipment_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 1.133)

Returns:



23
24
25
26
27
28
29
30
31
# File 'lib/peddler/apis/delivery_by_amazon_2022_07_01.rb', line 23

def submit_invoice(body, order_id: nil, shipment_id: nil, rate_limit: 1.133)
  path = "/delivery/2022-07-01/invoice"
  params = {
    "orderId" => order_id,
    "shipmentId" => shipment_id,
  }.compact
  parser = -> { SubmitInvoiceResponse }
  post(path, body:, params:, rate_limit:, parser:)
end