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
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
-
#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, #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
This operation can make a dynamic sandbox call.
Cancels a purchased shipment. Returns an empty object if the shipment is successfully cancelled.
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
This operation can make a dynamic sandbox call.
This API will be used to create claim for single eligible shipment.
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
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.
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.
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
This operation can make a dynamic sandbox call.
Returns a list of access points in proximity of input postal code.
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
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.
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.
191 192 193 194 195 196 197 |
# File 'lib/peddler/apis/shipping_v2.rb', line 191 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.
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.
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.
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
This operation can make a dynamic sandbox call.
Returns the available shipping service offerings.
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
This operation can make a dynamic sandbox call.
Returns the shipping documents associated with a package in a shipment.
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
This operation can make a dynamic sandbox call.
Returns tracking information for a purchased shipment.
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.
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 |
#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.
227 228 229 230 231 |
# File 'lib/peddler/apis/shipping_v2.rb', line 227 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.
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
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.
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
This operation can make a dynamic sandbox call.
This API submits the NDR (Non-delivery Report) Feedback for any eligible shipment.
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 |
#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.
243 244 245 246 247 248 249 |
# File 'lib/peddler/apis/shipping_v2.rb', line 243 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 |