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

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

#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.

  • 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:



139
140
141
142
143
# File 'lib/peddler/apis/shipping_v2.rb', line 139

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.

  • 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:



334
335
336
337
338
# File 'lib/peddler/apis/shipping_v2.rb', line 334

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.

  • 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:



43
44
45
46
47
48
# File 'lib/peddler/apis/shipping_v2.rb', line 43

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.

  • 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:



236
237
238
239
240
241
242
243
# File 'lib/peddler/apis/shipping_v2.rb', line 236

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

  • 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.

  • 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:



301
302
303
304
305
306
307
308
309
310
311
# File 'lib/peddler/apis/shipping_v2.rb', line 301

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.

  • 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:



157
158
159
160
161
162
163
164
165
# File 'lib/peddler/apis/shipping_v2.rb', line 157

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.

  • 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:



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

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.

  • 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:



188
189
190
191
192
193
194
# File 'lib/peddler/apis/shipping_v2.rb', line 188

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.

  • 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:



283
284
285
286
287
288
289
# File 'lib/peddler/apis/shipping_v2.rb', line 283

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.

  • 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:



252
253
254
255
256
257
258
# File 'lib/peddler/apis/shipping_v2.rb', line 252

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.

  • 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:



23
24
25
26
27
# File 'lib/peddler/apis/shipping_v2.rb', line 23

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.

  • 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:



119
120
121
122
123
124
125
126
127
128
129
# File 'lib/peddler/apis/shipping_v2.rb', line 119

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.

  • 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:



95
96
97
98
99
100
101
102
103
# File 'lib/peddler/apis/shipping_v2.rb', line 95

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.

  • 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:



268
269
270
271
272
273
274
# File 'lib/peddler/apis/shipping_v2.rb', line 268

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.

  • 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:



205
206
207
208
209
# File 'lib/peddler/apis/shipping_v2.rb', line 205

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.

  • 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:



78
79
80
81
82
# File 'lib/peddler/apis/shipping_v2.rb', line 78

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.

  • 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:



64
65
66
67
68
# File 'lib/peddler/apis/shipping_v2.rb', line 64

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.

  • 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:



321
322
323
324
# File 'lib/peddler/apis/shipping_v2.rb', line 321

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.

  • 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:



219
220
221
222
223
224
225
# File 'lib/peddler/apis/shipping_v2.rb', line 219

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