Class: Peddler::APIs::ShippingV2

Inherits:
Peddler::API show all
Defined in:
lib/peddler/apis/shipping_v2.rb,
lib/peddler/apis/shipping_v2/item.rb,
lib/peddler/apis/shipping_v2/rate.rb,
lib/peddler/apis/shipping_v2/error.rb,
lib/peddler/apis/shipping_v2/event.rb,
lib/peddler/apis/shipping_v2/weight.rb,
lib/peddler/apis/shipping_v2/address.rb,
lib/peddler/apis/shipping_v2/carrier.rb,
lib/peddler/apis/shipping_v2/geocode.rb,
lib/peddler/apis/shipping_v2/package.rb,
lib/peddler/apis/shipping_v2/promise.rb,
lib/peddler/apis/shipping_v2/service.rb,
lib/peddler/apis/shipping_v2/benefits.rb,
lib/peddler/apis/shipping_v2/location.rb,
lib/peddler/apis/shipping_v2/item_list.rb,
lib/peddler/apis/shipping_v2/rate_item.rb,
lib/peddler/apis/shipping_v2/rate_list.rb,
lib/peddler/apis/shipping_v2/date_range.rb,
lib/peddler/apis/shipping_v2/dimensions.rb,
lib/peddler/apis/shipping_v2/error_list.rb,
lib/peddler/apis/shipping_v2/tax_detail.rb,
lib/peddler/apis/shipping_v2/charge_list.rb,
lib/peddler/apis/shipping_v2/goods_owner.rb,
lib/peddler/apis/shipping_v2/service_ids.rb,
lib/peddler/apis/shipping_v2/time_of_day.rb,
lib/peddler/apis/shipping_v2/time_window.rb,
lib/peddler/apis/shipping_v2/access_point.rb,
lib/peddler/apis/shipping_v2/package_list.rb,
lib/peddler/apis/shipping_v2/print_option.rb,
lib/peddler/apis/shipping_v2/document_size.rb,
lib/peddler/apis/shipping_v2/liquid_volume.rb,
lib/peddler/apis/shipping_v2/active_account.rb,
lib/peddler/apis/shipping_v2/rate_item_list.rb,
lib/peddler/apis/shipping_v2/active_accounts.rb,
lib/peddler/apis/shipping_v2/carrier_account.rb,
lib/peddler/apis/shipping_v2/channel_details.rb,
lib/peddler/apis/shipping_v2/ineligible_rate.rb,
lib/peddler/apis/shipping_v2/invoice_details.rb,
lib/peddler/apis/shipping_v2/operating_hours.rb,
lib/peddler/apis/shipping_v2/tax_detail_list.rb,
lib/peddler/apis/shipping_v2/carrier_accounts.rb,
lib/peddler/apis/shipping_v2/charge_component.rb,
lib/peddler/apis/shipping_v2/claim_proof_urls.rb,
lib/peddler/apis/shipping_v2/excluded_benefit.rb,
lib/peddler/apis/shipping_v2/get_rates_result.rb,
lib/peddler/apis/shipping_v2/linkable_carrier.rb,
lib/peddler/apis/shipping_v2/ndr_request_data.rb,
lib/peddler/apis/shipping_v2/package_document.rb,
lib/peddler/apis/shipping_v2/tracking_summary.rb,
lib/peddler/apis/shipping_v2/access_point_list.rb,
lib/peddler/apis/shipping_v2/excluded_benefits.rb,
lib/peddler/apis/shipping_v2/get_rates_request.rb,
lib/peddler/apis/shipping_v2/included_benefits.rb,
lib/peddler/apis/shipping_v2/print_option_list.rb,
lib/peddler/apis/shipping_v2/service_selection.rb,
lib/peddler/apis/shipping_v2/get_rates_response.rb,
lib/peddler/apis/shipping_v2/request_attributes.rb,
lib/peddler/apis/shipping_v2/collect_on_delivery.rb,
lib/peddler/apis/shipping_v2/get_tracking_result.rb,
lib/peddler/apis/shipping_v2/shipper_instruction.rb,
lib/peddler/apis/shipping_v2/validation_metadata.rb,
lib/peddler/apis/shipping_v2/value_added_service.rb,
lib/peddler/apis/shipping_v2/access_point_details.rb,
lib/peddler/apis/shipping_v2/amazon_order_details.rb,
lib/peddler/apis/shipping_v2/create_claim_request.rb,
lib/peddler/apis/shipping_v2/ineligibility_reason.rb,
lib/peddler/apis/shipping_v2/ineligible_rate_list.rb,
lib/peddler/apis/shipping_v2/carrier_account_input.rb,
lib/peddler/apis/shipping_v2/create_claim_response.rb,
lib/peddler/apis/shipping_v2/get_tracking_response.rb,
lib/peddler/apis/shipping_v2/linkable_account_type.rb,
lib/peddler/apis/shipping_v2/package_document_list.rb,
lib/peddler/apis/shipping_v2/tracking_detail_codes.rb,
lib/peddler/apis/shipping_v2/direct_purchase_result.rb,
lib/peddler/apis/shipping_v2/linkable_carriers_list.rb,
lib/peddler/apis/shipping_v2/amazon_shipment_details.rb,
lib/peddler/apis/shipping_v2/client_reference_detail.rb,
lib/peddler/apis/shipping_v2/dangerous_goods_details.rb,
lib/peddler/apis/shipping_v2/direct_purchase_request.rb,
lib/peddler/apis/shipping_v2/package_document_detail.rb,
lib/peddler/apis/shipping_v2/accessibility_attributes.rb,
lib/peddler/apis/shipping_v2/cancel_shipment_response.rb,
lib/peddler/apis/shipping_v2/client_reference_details.rb,
lib/peddler/apis/shipping_v2/direct_purchase_response.rb,
lib/peddler/apis/shipping_v2/get_access_points_result.rb,
lib/peddler/apis/shipping_v2/purchase_shipment_result.rb,
lib/peddler/apis/shipping_v2/validation_metadata_list.rb,
lib/peddler/apis/shipping_v2/carrier_account_attribute.rb,
lib/peddler/apis/shipping_v2/collections_form_document.rb,
lib/peddler/apis/shipping_v2/exception_operating_hours.rb,
lib/peddler/apis/shipping_v2/one_click_shipment_result.rb,
lib/peddler/apis/shipping_v2/purchase_shipment_request.rb,
lib/peddler/apis/shipping_v2/supported_document_detail.rb,
lib/peddler/apis/shipping_v2/carrier_account_attributes.rb,
lib/peddler/apis/shipping_v2/get_access_points_response.rb,
lib/peddler/apis/shipping_v2/linkable_account_type_list.rb,
lib/peddler/apis/shipping_v2/one_click_shipment_request.rb,
lib/peddler/apis/shipping_v2/purchase_shipment_response.rb,
lib/peddler/apis/shipping_v2/carrier_account_inputs_list.rb,
lib/peddler/apis/shipping_v2/one_click_shipment_response.rb,
lib/peddler/apis/shipping_v2/submit_ndr_feedback_request.rb,
lib/peddler/apis/shipping_v2/value_added_service_details.rb,
lib/peddler/apis/shipping_v2/get_carrier_accounts_request.rb,
lib/peddler/apis/shipping_v2/get_collection_form_response.rb,
lib/peddler/apis/shipping_v2/link_carrier_account_request.rb,
lib/peddler/apis/shipping_v2/package_document_detail_list.rb,
lib/peddler/apis/shipping_v2/excluded_benefit_reason_codes.rb,
lib/peddler/apis/shipping_v2/get_carrier_accounts_response.rb,
lib/peddler/apis/shipping_v2/get_shipment_documents_result.rb,
lib/peddler/apis/shipping_v2/link_carrier_account_response.rb,
lib/peddler/apis/shipping_v2/requested_label_customization.rb,
lib/peddler/apis/shipping_v2/requested_value_added_service.rb,
lib/peddler/apis/shipping_v2/get_additional_inputs_response.rb,
lib/peddler/apis/shipping_v2/unlink_carrier_account_request.rb,
lib/peddler/apis/shipping_v2/unmanifested_shipment_location.rb,
lib/peddler/apis/shipping_v2/collection_forms_history_record.rb,
lib/peddler/apis/shipping_v2/get_shipment_documents_response.rb,
lib/peddler/apis/shipping_v2/unlink_carrier_account_response.rb,
lib/peddler/apis/shipping_v2/generate_collection_form_request.rb,
lib/peddler/apis/shipping_v2/requested_document_specification.rb,
lib/peddler/apis/shipping_v2/supported_document_specification.rb,
lib/peddler/apis/shipping_v2/unmanifested_carrier_information.rb,
lib/peddler/apis/shipping_v2/generate_collection_form_response.rb,
lib/peddler/apis/shipping_v2/get_unmanifested_shipments_request.rb,
lib/peddler/apis/shipping_v2/requested_value_added_service_list.rb,
lib/peddler/apis/shipping_v2/available_value_added_service_group.rb,
lib/peddler/apis/shipping_v2/direct_fulfillment_item_identifiers.rb,
lib/peddler/apis/shipping_v2/get_collection_form_history_request.rb,
lib/peddler/apis/shipping_v2/get_unmanifested_shipments_response.rb,
lib/peddler/apis/shipping_v2/unmanifested_shipment_location_list.rb,
lib/peddler/apis/shipping_v2/collection_forms_history_record_list.rb,
lib/peddler/apis/shipping_v2/get_collection_form_history_response.rb,
lib/peddler/apis/shipping_v2/supported_document_specification_list.rb,
lib/peddler/apis/shipping_v2/unmanifested_carrier_information_list.rb,
lib/peddler/apis/shipping_v2/one_click_shipment_value_added_service.rb,
lib/peddler/apis/shipping_v2/available_value_added_service_group_list.rb,
lib/peddler/apis/shipping_v2/get_carrier_account_form_inputs_response.rb,
lib/peddler/apis/shipping_v2/one_click_shipment_value_added_service_details.rb,
sig/peddler/apis/shipping_v2.rbs

Overview

Amazon Shipping API

The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.

Defined Under Namespace

Classes: AccessPoint, AccessPointDetails, AccessPointList, AccessibilityAttributes, ActiveAccount, ActiveAccounts, Address, AmazonOrderDetails, AmazonShipmentDetails, AvailableValueAddedServiceGroup, AvailableValueAddedServiceGroupList, Benefits, CancelShipmentResponse, Carrier, CarrierAccount, CarrierAccountAttribute, CarrierAccountAttributes, CarrierAccountInput, CarrierAccountInputsList, CarrierAccounts, ChannelDetails, ChargeComponent, ChargeList, ClaimProofURLs, ClientReferenceDetail, ClientReferenceDetails, CollectOnDelivery, CollectionFormsHistoryRecord, CollectionFormsHistoryRecordList, CollectionsFormDocument, CreateClaimRequest, CreateClaimResponse, DangerousGoodsDetails, DateRange, Dimensions, DirectFulfillmentItemIdentifiers, DirectPurchaseRequest, DirectPurchaseResponse, DirectPurchaseResult, DocumentSize, Error, ErrorList, Event, ExceptionOperatingHours, ExcludedBenefit, ExcludedBenefitReasonCodes, ExcludedBenefits, GenerateCollectionFormRequest, GenerateCollectionFormResponse, Geocode, GetAccessPointsResponse, GetAccessPointsResult, GetAdditionalInputsResponse, GetCarrierAccountFormInputsResponse, GetCarrierAccountsRequest, GetCarrierAccountsResponse, GetCollectionFormHistoryRequest, GetCollectionFormHistoryResponse, GetCollectionFormResponse, GetRatesRequest, GetRatesResponse, GetRatesResult, GetShipmentDocumentsResponse, GetShipmentDocumentsResult, GetTrackingResponse, GetTrackingResult, GetUnmanifestedShipmentsRequest, GetUnmanifestedShipmentsResponse, GoodsOwner, IncludedBenefits, IneligibilityReason, IneligibleRate, IneligibleRateList, InvoiceDetails, Item, ItemList, LinkCarrierAccountRequest, LinkCarrierAccountResponse, LinkableAccountType, LinkableAccountTypeList, LinkableCarrier, LinkableCarriersList, LiquidVolume, Location, NdrRequestData, OneClickShipmentRequest, OneClickShipmentResponse, OneClickShipmentResult, OneClickShipmentValueAddedService, OneClickShipmentValueAddedServiceDetails, OperatingHours, Package, PackageDocument, PackageDocumentDetail, PackageDocumentDetailList, PackageDocumentList, PackageList, PrintOption, PrintOptionList, Promise, PurchaseShipmentRequest, PurchaseShipmentResponse, PurchaseShipmentResult, Rate, RateItem, RateItemList, RateList, RequestAttributes, RequestedDocumentSpecification, RequestedLabelCustomization, RequestedValueAddedService, RequestedValueAddedServiceList, Service, ServiceIds, ServiceSelection, ShipperInstruction, SubmitNdrFeedbackRequest, SupportedDocumentDetail, SupportedDocumentSpecification, SupportedDocumentSpecificationList, TaxDetail, TaxDetailList, TimeOfDay, TimeWindow, TrackingDetailCodes, TrackingSummary, UnlinkCarrierAccountRequest, UnlinkCarrierAccountResponse, UnmanifestedCarrierInformation, UnmanifestedCarrierInformationList, UnmanifestedShipmentLocation, UnmanifestedShipmentLocationList, ValidationMetadata, ValidationMetadataList, ValueAddedService, ValueAddedServiceDetails, Weight

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

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

#cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.

Parameters:

  • shipment_id (String) —

    The shipment identifier originally returned by the purchaseShipment operation.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



153
154
155
156
157
# File 'lib/peddler/apis/shipping_v2.rb', line 153

def cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/shipments/#{percent_encode(shipment_id)}/cancel"
  parser = -> { CancelShipmentResponse }
  put(path, rate_limit:, parser:)
end

#create_claim(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

This API will be used to create claim for single eligible shipment.

Parameters:

  • body (Hash) —

    Request body for the createClaim operation

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



373
374
375
376
377
# File 'lib/peddler/apis/shipping_v2.rb', line 373

def create_claim(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/claims"
  parser = -> { CreateClaimResponse }
  post(path, body:, rate_limit:, parser:)
end

#direct_purchase_shipment(body, x_amzn_idempotency_key: nil, locale: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Purchases the shipping service for a shipment using the best fit service offering. Returns purchase related details and documents.

Parameters:

  • body (Hash) —

    DirectPurchaseRequest body

  • x_amzn_idempotency_key (String) (defaults to: nil) —

    A unique value which the server uses to recognize subsequent retries of the same request.

  • locale (String) (defaults to: nil) —

    The IETF Language Tag. Note that this only supports the primary language subtag with one secondary language subtag (i.e. en-US, fr-CA). The secondary language subtag is almost always a regional designation. This does not support additional subtags beyond the primary and secondary language subtags.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_idempotency_key: (String, nil) (defaults to: nil)
  • locale: (String, nil) (defaults to: nil)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



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

def direct_purchase_shipment(body, x_amzn_idempotency_key: nil, locale: nil, x_amzn_shipping_business_id: nil,
  rate_limit: 80.0)
  path = "/shipping/v2/shipments/directPurchase"
  parser = -> { DirectPurchaseResponse }
  post(path, body:, rate_limit:, parser:)
end

#generate_collection_form(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API Call to generate the collection form.

Parameters:

  • body (Hash) —

    GenerateCollectionFormRequest body

  • x_amzn_idempotency_key (String) (defaults to: nil) —

    A unique value which the server uses to recognize subsequent retries of the same request.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_idempotency_key: (String, nil) (defaults to: nil)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



262
263
264
265
266
267
268
269
# File 'lib/peddler/apis/shipping_v2.rb', line 262

def generate_collection_form(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil,
  rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/collectionForms"
  parser = -> { GenerateCollectionFormResponse }
  post(path, body:, rate_limit:, parser:)
end

#get_access_points(access_point_types, country_code, postal_code, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Returns a list of access points in proximity of input postal code.

Parameters:

  • access_point_types (Array<String>) —

    Access point types. Known values: HELIX, CAMPUS_LOCKER, OMNI_LOCKER, ODIN_LOCKER, DOBBY_LOCKER, CORE_LOCKER, 3P, CAMPUS_ROOM.

  • country_code (String) —

    Country code for access point

  • postal_code (String) —

    postal code for access point

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Array[String])
  • (String)
  • (String)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



336
337
338
339
340
341
342
343
344
345
346
# File 'lib/peddler/apis/shipping_v2.rb', line 336

def get_access_points(access_point_types, country_code, postal_code, x_amzn_shipping_business_id: nil,
  rate_limit: 80.0)
  path = "/shipping/v2/accessPoints"
  params = {
    "accessPointTypes" => stringify_array(access_point_types),
    "countryCode" => country_code,
    "postalCode" => postal_code,
  }.compact
  parser = -> { GetAccessPointsResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a static sandbox call.

Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering. Call the getAdditionalInputs operation when the response to a previous call to the getRates operation indicates that additional inputs are required for the rate (shipping offering) that you want to purchase.

Parameters:

  • request_token (String) —

    The request token returned in the response to the getRates operation.

  • rate_id (String) —

    The rate identifier for the shipping offering (rate) returned in the response to the getRates operation.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • (String)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



173
174
175
176
177
178
179
180
181
# File 'lib/peddler/apis/shipping_v2.rb', line 173

def get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/shipments/additionalInputs/schema"
  params = {
    "requestToken" => request_token,
    "rateId" => rate_id,
  }.compact
  parser = -> { GetAdditionalInputsResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_carrier_account_form_inputs(x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API will return a list of input schema required to register a shipper account with the carrier.

Parameters:

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



191
192
193
194
195
196
197
# File 'lib/peddler/apis/shipping_v2.rb', line 191

def (x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/carrierAccountFormInputs"
  parser = -> { GetCarrierAccountFormInputsResponse }
  get(path, rate_limit:, parser:)
end

#get_carrier_accounts(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API will return Get all carrier accounts for a merchant.

Parameters:

  • body (Hash) —

    GetCarrierAccountsRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



208
209
210
211
212
213
214
# File 'lib/peddler/apis/shipping_v2.rb', line 208

def get_carrier_accounts(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/carrierAccounts"
  parser = -> { GetCarrierAccountsResponse }
  put(path, body:, rate_limit:, parser:)
end

#get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API reprint a collection form.

Parameters:

  • collection_form_id (String) —

    collection form Id to reprint a collection.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



315
316
317
318
319
320
321
# File 'lib/peddler/apis/shipping_v2.rb', line 315

def get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/collectionForms/#{percent_encode(collection_form_id)}"
  parser = -> { GetCollectionFormResponse }
  get(path, rate_limit:, parser:)
end

#get_collection_form_history(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API Call to get the history of the previously generated collection forms.

Parameters:

  • body (Hash) —

    GetCollectionFormHistoryRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



280
281
282
283
284
285
286
# File 'lib/peddler/apis/shipping_v2.rb', line 280

def get_collection_form_history(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/collectionForms/history"
  parser = -> { GetCollectionFormHistoryResponse }
  put(path, body:, rate_limit:, parser:)
end

#get_rates(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Returns the available shipping service offerings.

Parameters:

  • body (Hash) —

    GetRatesRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



25
26
27
28
29
# File 'lib/peddler/apis/shipping_v2.rb', line 25

def get_rates(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/shipments/rates"
  parser = -> { GetRatesResponse }
  post(path, body:, rate_limit:, parser:)
end

#get_shipment_documents(shipment_id, package_client_reference_id, format: nil, dpi: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Returns the shipping documents associated with a package in a shipment.

Parameters:

  • shipment_id (String) —

    The shipment identifier originally returned by the purchaseShipment operation.

  • package_client_reference_id (String) —

    The package client reference identifier originally provided in the request body parameter for the getRates operation.

  • format (String) (defaults to: nil) —

    The file format of the document. Must be one of the supported formats returned by the getRates operation.

  • dpi (Number) (defaults to: nil) —

    The resolution of the document (for example, 300 means 300 dots per inch). Must be one of the supported resolutions returned in the response to the getRates operation.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • (String)
  • format: (String, nil) (defaults to: nil)
  • dpi: (Numeric, nil) (defaults to: nil)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



131
132
133
134
135
136
137
138
139
140
141
# File 'lib/peddler/apis/shipping_v2.rb', line 131

def get_shipment_documents(shipment_id, package_client_reference_id, format: nil, dpi: nil,
  x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/shipments/#{percent_encode(shipment_id)}/documents"
  params = {
    "packageClientReferenceId" => package_client_reference_id,
    "format" => format,
    "dpi" => dpi,
  }.compact
  parser = -> { GetShipmentDocumentsResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_tracking(tracking_id, carrier_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Returns tracking information for a purchased shipment.

Parameters:

  • tracking_id (String) —

    A carrier-generated tracking identifier originally returned by the purchaseShipment operation.

  • carrier_id (String) —

    A carrier identifier originally returned by the getRates operation for the selected rate.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • (String)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



105
106
107
108
109
110
111
112
113
# File 'lib/peddler/apis/shipping_v2.rb', line 105

def get_tracking(tracking_id, carrier_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/tracking"
  params = {
    "trackingId" => tracking_id,
    "carrierId" => carrier_id,
  }.compact
  parser = -> { GetTrackingResponse }
  get(path, params:, rate_limit:, parser:)
end

#get_unmanifested_shipments(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

This API Get all unmanifested carriers with shipment locations. Any locations which has unmanifested shipments with an eligible carrier for manifesting shall be returned.

Parameters:

  • body (Hash) —

    GetUmanifestedShipmentsRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



298
299
300
301
302
303
304
# File 'lib/peddler/apis/shipping_v2.rb', line 298

def get_unmanifested_shipments(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/unmanifestedShipments"
  parser = -> { GetUnmanifestedShipmentsResponse }
  put(path, body:, rate_limit:, parser:)
end
Note:

This operation can make a dynamic sandbox call.

This API associates/links the specified carrier account with the merchant.

Parameters:

  • carrier_id (String) —

    An identifier for the carrier with which the seller's account is being linked.

  • body (Hash) —

    LinkCarrierAccountRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 5.0) —

    Requests per second

  • (String)
  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 5.0)

Returns:



227
228
229
230
231
# File 'lib/peddler/apis/shipping_v2.rb', line 227

def (carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 5.0)
  path = "/shipping/v2/carrierAccounts/#{percent_encode(carrier_id)}"
  parser = -> { LinkCarrierAccountResponse }
  post(path, body:, rate_limit:, parser:)
end

#one_click_shipment(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Purchases a shipping service identifier and returns purchase-related details and documents.

Parameters:

  • body (Hash) —

    OneClickShipmentRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



86
87
88
89
90
# File 'lib/peddler/apis/shipping_v2.rb', line 86

def one_click_shipment(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/oneClickShipment"
  parser = -> { OneClickShipmentResponse }
  post(path, body:, rate_limit:, parser:)
end

#purchase_shipment(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

Purchases a shipping service and returns purchase related details and documents.

Note: You must complete the purchase within 10 minutes of rate creation by the shipping service provider. If you make the request after the 10 minutes have expired, you will receive an error response with the error code equal to "TOKEN_EXPIRED". If you receive this error response, you must get the rates for the shipment again.

Parameters:

  • body (Hash) —

    PurchaseShipmentRequest body

  • x_amzn_idempotency_key (String) (defaults to: nil) —

    A unique value which the server uses to recognize subsequent retries of the same request.

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_idempotency_key: (String, nil) (defaults to: nil)
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



70
71
72
73
74
# File 'lib/peddler/apis/shipping_v2.rb', line 70

def purchase_shipment(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/shipments"
  parser = -> { PurchaseShipmentResponse }
  post(path, body:, rate_limit:, parser:)
end

#submit_ndr_feedback(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response

Note:

This operation can make a dynamic sandbox call.

This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.

Parameters:

  • body (Hash) —

    Request body for ndrFeedback operation

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



358
359
360
361
# File 'lib/peddler/apis/shipping_v2.rb', line 358

def submit_ndr_feedback(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  path = "/shipping/v2/ndrFeedback"
  post(path, body:, rate_limit:)
end

This API Unlink the specified carrier account with the merchant.

Parameters:

  • carrier_id (String) —

    carrier Id to unlink with merchant.

  • body (Hash) —

    UnlinkCarrierAccountRequest body

  • x_amzn_shipping_business_id (String) (defaults to: nil) —

    Amazon shipping business to assume for this request. The default is AmazonShipping_UK. Known values: AmazonShipping_US, AmazonShipping_IN, AmazonShipping_UK, AmazonShipping_UAE, AmazonShipping_SA, AmazonShipping_EG, AmazonShipping_IT, AmazonShipping_ES, AmazonShipping_FR, AmazonShipping_JP.

  • rate_limit (Float) (defaults to: 80.0) —

    Requests per second

  • (String)
  • (Hash[untyped, untyped])
  • x_amzn_shipping_business_id: (String, nil) (defaults to: nil)
  • rate_limit: (Float) (defaults to: 80.0)

Returns:



243
244
245
246
247
248
249
# File 'lib/peddler/apis/shipping_v2.rb', line 243

def (carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0)
  cannot_sandbox!

  path = "/shipping/v2/carrierAccounts/#{percent_encode(carrier_id)}/unlink"
  parser = -> { UnlinkCarrierAccountResponse }
  put(path, body:, rate_limit:, parser:)
end