Class: Peddler::APIs::ShippingV2
- Inherits:
-
Peddler::API
- Object
- Peddler::API
- Peddler::APIs::ShippingV2
- 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
-
#cancel_shipment(shipment_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Cancels a purchased shipment.
-
#create_claim(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
This API will be used to create claim for single eligible shipment.
-
#direct_purchase_shipment(body, x_amzn_idempotency_key: nil, locale: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Purchases the shipping service for a shipment using the best fit service offering.
-
#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.
-
#get_access_points(access_point_types, country_code, postal_code, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Returns a list of access points in proximity of input postal code.
-
#get_additional_inputs(request_token, rate_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Returns the JSON schema to use for providing additional inputs when needed to purchase a shipping offering.
-
#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.
-
#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.
-
#get_collection_form(collection_form_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
This API reprint a collection form.
-
#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.
-
#get_rates(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Returns the available shipping service offerings.
-
#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
Returns the shipping documents associated with a package in a shipment.
-
#get_tracking(tracking_id, carrier_id, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Returns tracking information for a purchased shipment.
-
#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.
-
#link_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 5.0) ⇒ Peddler::Response
This API associates/links the specified carrier account with the merchant.
-
#one_click_shipment(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Purchases a shipping service identifier and returns purchase-related details and documents.
-
#purchase_shipment(body, x_amzn_idempotency_key: nil, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
Purchases a shipping service and returns purchase related details and documents.
-
#submit_ndr_feedback(body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.
-
#unlink_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
This API Unlink the specified carrier account with the merchant.
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
This operation can make a dynamic sandbox call.
Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.
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
This operation can make a dynamic sandbox call.
This API will be used to create claim for single eligible shipment.
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
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.
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.
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
This operation can make a dynamic sandbox call.
Returns a list of access points in proximity of input postal code.
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
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.
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.
173 174 175 176 177 178 179 |
# File 'lib/peddler/apis/shipping_v2.rb', line 173 def get_carrier_account_form_inputs(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.
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.
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.
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
This operation can make a dynamic sandbox call.
Returns the available shipping service offerings.
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
This operation can make a dynamic sandbox call.
Returns the shipping documents associated with a package in a shipment.
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
This operation can make a dynamic sandbox call.
Returns tracking information for a purchased shipment.
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.
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 |
#link_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 5.0) ⇒ Peddler::Response
This operation can make a dynamic sandbox call.
This API associates/links the specified carrier account with the merchant.
205 206 207 208 209 |
# File 'lib/peddler/apis/shipping_v2.rb', line 205 def link_carrier_account(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
This operation can make a dynamic sandbox call.
Purchases a shipping service identifier and returns purchase-related details and documents.
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
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.
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
This operation can make a dynamic sandbox call.
This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.
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 |
#unlink_carrier_account(carrier_id, body, x_amzn_shipping_business_id: nil, rate_limit: 80.0) ⇒ Peddler::Response
This API Unlink the specified carrier account with the merchant.
219 220 221 222 223 224 225 |
# File 'lib/peddler/apis/shipping_v2.rb', line 219 def unlink_carrier_account(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 |