Discussions

Ask a Question

How can I set selected_courier_id attribute? Does it needs to be nested within an object body?

I've tried top level declaration of the same attribute but it still defaults to the best value for money Courier. API version: 2023.01

API shipment request failure - Denmark export to Spain

Hello, We recently tried to book a shipment, via our API, going from Denmark to Spain. I expected that our DHL rates, on our own courier account DHL DK Export (302392238) would be returned and the shipment booked successfully. It appears we are able to book shipments, with this account, when it's a domestic (DK to DK) shipment, but DK to EU or rest of world is problematic. Our request: {"origin_address":{"line_1":"Bredgade 65","city":"Copenhagen K","postal_code":" 1260","country_alpha2":"DK","contact_email":"[email protected]","contact_phone":"+45 71 99 51 24","company_name":"Elhanati","contact_name":"Dave Marsland"},"destination_address":{"line_1":"Carrer de les Oliveres 9","line_2":"can macia","city":"Sant Pere de Ribes","postal_code":"08810","country_alpha2":"ES","contact_email":"[email protected]","contact_phone":"+34 633 67 88 27","company_name":"Karolin y Manuel Trockels Mora","contact_name":"Karolin y Manuel Trockels Mora"},"order_data":{"platform_name":"Finematter","platform_order_number":"FM4205-F1"},"incoterms":"DDP","shipping_settings":{"buy_label_synchronous":true,"buy_label":true},"parcels":\[{"box":{"length":8,"width":23,"height":14},"total_actual_weight":0.184,"items":[{"quantity":1,"description":"Esmeralda duo emerald and diamond ring (54 mm)","hs_code":711319,"actual_weight":0.1,"origin_country_alpha2":"DK","declared_currency":"EUR","declared_customs_value":1149.59,"sku":"FM-ELH-ELH/SO/1010EM-54","category":"jewelry"}]}]} The response: {"shipment":{"easyship_shipment_id":"ESDK146994583","consignee_tax_id":null,"courier":null,"created_at":"2023-06-02T09:34:38Z","currency":"GBP","delivery_state":"not_created","destination_address":{"city":"Sant Pere de Ribes","company_name":"Karolin y Manuel Trockels Mora","contact_email":"[email protected]","contact_name":"Karolin y Manuel Trockels Mora","contact_phone":"+34633678827","country_alpha2":"ES","line_1":"Carrer de les Oliveres 9","line_2":"can macia","postal_code":"08810","state":null},"eei_reference":null,"incoterms":null,"insurance":{"is_insured":false,"insured_amount":0,"insured_currency":"GBP"},"label_generated_at":null,"label_paid_at":null,"label_state":"not_created","last_failure_http_response_messages":\[],"metadata":{},"order_created_at":null,"order_data":{"platform_name":"Finematter","platform_order_number":"FM4205-F1","order_tag_list":\[],"seller_notes":null,"buyer_notes":null},"origin_address":{"city":"Copenhagen K","company_name":"Elhanati","contact_email":"[email protected]","contact_name":"Dave Marsland","contact_phone":"+45 71 99 51 24","country_alpha2":"DK","line_1":"Bredgade 65","line_2":null,"postal_code":" 1260","state":null},"parcels":\[{"box":{"id":null,"name":null,"outer_dimensions":{"length":8,"width":23,"height":14},"slug":null,"type":"box","weight":0},"items":[{"actual_weight":0.1,"category":"Jewelry","contains_battery_pi966":null,"contains_battery_pi967":null,"contains_liquids":null,"declared_currency":"EUR","declared_customs_value":1149.59,"description":"Esmeralda duo emerald and diamond ring (54 mm)","dimensions":{"length":0,"width":0,"height":0},"hs_code":"71131900","origin_country_alpha2":"DK","origin_currency":"GBP","origin_customs_value":980.7335603469579,"quantity":1,"sku":"FM-ELH-ELH/SO/1010EM-54"}],"total_actual_weight":0.184}],"pickup_state":"not_requested","rates":\[],"regulatory_identifiers":{"eori":null,"ioss":null,"vat_number":null},"return":false,"return_address":{"city":"Copenhagen K","company_name":"Elhanati","contact_email":"[email protected]","contact_name":"Dave Marsland","contact_phone":"+45 71 99 51 24","country_alpha2":"DK","line_1":"Bredgade 65","line_2":null,"postal_code":" 1260","state":null},"sender_address":{"city":"Copenhagen K","company_name":"Elhanati","contact_email":"[email protected]","contact_name":"Dave Marsland","contact_phone":"+45 71 99 51 24","country_alpha2":"DK","line_1":"Bredgade 65","line_2":null,"postal_code":" 1260","state":null},"set_as_residential":false,"shipment_state":"created","shipping_documents":\[],"tracking_page_url":"<https://www.trackmyshipment.co/shipment-tracking/ESDK146994583","trackings":[],"updated_at":"2023-06-02T09:34:38Z","warehouse_state":"none"},"meta":{"status":"partial_success","errors":["Sorry>, we couldn't find any shipping solutions based on the information provided."],"unavailable_couriers":\[]}}

Prefering drop off

is there a way to "force" selection of drop off even for rates includes "courier_does_pickup": ture ?

Error when generating label via shipment

I'm trying to use the sandbox and test generating a label at the same time as a shipment, however when I query the shipment after creation and get the label I get the error: "last_failure_http_response_messages": \[ { "code": "NoMethodError", "content": "undefined method \`\[]' for nil:NilClass" } ], Could you have a look and let me know what the call is missing/the cause? Thanks!

different results across web/protal and our site (API)

Our site is integarted via API with easyship for some time now. We see consistent results for identical shipments across the easyship portal and our site - as expected. At your (easyship's) suggestion I created and different new (easyship) account and changed the access key to the new account (on our test environment). In testing with the new account we see** inconsistent **results for identical shipments across the easyship portal and our site. Results on our site (via API) are fewer and and lot more expensive. Could that be because the new account is not funded yet? Other reason? The new account ID is CIL602749

Multi-parcel rates - only one courier returned (BUG?)

Using the API docs for Rate Request (<https://developers.easyship.com/reference/rates_request>), I've noticed that if I add more than one parcel to the payload the response only returns one courier (UPS). If I have only one parcel, then I get many couriers returned in the response (CanPar, UPS, Canada Post, Purolator… etc). I'm wondering if this is a bug, because I'm pretty sure some of these couriers offer multi-parcel shipments, so why doesn't this work for rates. Any ideas? Suggestions? I'm using my production key for this, as the sandbox key isn't very reliable for returning consistent results. Thanks for the help. :)

Why is the post to https://api.easyship.com/2023-01/rates onlyl returning one rate

The API reference states: The Rates API allows you to request a list of shipping quotes for a prospective Shipment. The response will also indicate which Courier is the cheapest, fastest and best value for money, which is a combination of speed, price and reliability. However I am only getting one rate back, which has: "cost_rank": 1.0, "courier_id": "d70f503c-905b-4e28-a015-d27069a09e0c", "courier_name": "Evri - Parcelshop", "courier_remarks": "Pickup option available in checkout", "currency": "GBP", "ddp_handling_fee": 0.0, "delivery_time_rank": 1.0, Why are other ranked rate options not being returned?

Creating Shipment, Why can't destination_address.contact_phone be blank?

https://developers.easyship.com/reference/shipments_create clearly shows that the phone contact is not required for destination address but when creating a shipment in sandbox is can't be null or blank. I do not want to collect phone numbers of my customers just to ship to them. Why is it not consistent?

Unable to genrate label with vague error message "undefined method `[]' for nil:NilClass"

Hello, we are unable to generate label and we are receiving "undefined method `[]' for nil:NilClass" error. We also noticed that the country in the response for the origin address is United States although it is sent in the request as GB (United Kingdom). Can someone please help us generate a label? The request: ``` { "origin_address": { "name": "Customer", "company_name": "Customer", "line_1": "84 hartley green gardens", "line_2": "", "state": "billinge", "city": "wigan", "postal_code": "wn57ga", "country_alpha2": "GB", "phone_number": "+3106-89826441", "email_address": "[email protected]" }, "output_currency": "USD", "platform_name": "Open Border - #L11962-gb-3", "platform_order_number": "#L11962-gb-3", "taxes_duties_paid_by": "receiver", "is_insured": false, "destination_country_alpha2": "GB", "destination_city": "wigan", "destination_state": "billinge", "destination_postal_code": "wn57ga", "destination_address_line_1": "85 hartley green gardens", "destination_address_line_2": "", "destination_name": "Luminskin TEST", "destination_company_name": "Luminskin TEST", "destination_phone_number": "+3106-89826441", "destination_email_address": "[email protected]", "items": [ { "actual_weight": 0.0453592, "height": 0, "width": 0, "length": 0, "category": "Accessory", "declared_currency": "USD", "declared_customs_value": 0.01, "quantity": 1, "sku": "S1A", "description": "S1A", "origin_country_alpha2": "KR", "hs_code": "330499" } ], "box": { "length": 1, "width": 1, "height": 1 }, "buy_label_synchronous": true, "format": "url", "label": "4x6", "consignee_tax_id": "", "allow_courier_fallback": false } ``` This is the response: ``` { "shipment": { "created_at": "2023-02-10T04:30:28.874Z", "updated_at": "2023-02-10T04:30:29.852Z", "order_created_at": null, "easyship_shipment_id": "ESUS130419122", "origin_address": { "id": "f5511da8-9e27-475b-be7f-59d4c3cec809", "company_name": "Customer", "contact_name": "Customer", "contact_email": "[email protected]", "contact_phone": "+3106-89826441", "line_1": "84 hartley green gardens", "line_2": "", "postal_code": "wn57ga", "city": "wigan", "state": "billinge", "country": { "name": "United States" }, "default_values": { "pickup": false, "billing": false, "sender": false, "return": false } }, "store_name": "Open Border", "set_as_residential": false, "destination_name": "Luminskin TEST", "destination_company_name": "Luminskin TEST", "consignee_tax_id": "", "destination_address_line_1": "85 hartley green gardens", "destination_address_line_2": null, "destination_city": "wigan", "destination_state": "billinge", "destination_postal_code": "WN5 7GA", "destination_phone_number": "+310689826441", "destination_email_address": "[email protected]", "order_notes": null, "buyer_notes": null, "seller_notes": null, "order_tag_list": [], "platform_order_number": "#L11962-gb-3", "platform_name": "Open Border - #L11962-gb-3", "total_customs_value": 0.01, "total_actual_weight": 0.045, "total_dimensional_weight": 0.0, "total_volumetric_weight": 0.045, "is_insured": false, "currency": "USD", "shipment_state": "created", "pickup_state": "not_requested", "delivery_state": "not_created", "label_state": "technical_failed", "warehouse_state": "none", "label_url": null, "tracking_number": "ESUS130419122", "tracking_page_url": "https://www.trackmyshipment.co/shipment-tracking/ESUS130419122", "label_generated_at": null, "label_response": { "errors": [ "undefined method `[]' for nil:NilClass" ], "status": "failure", "cost": 12.99, "available_balance": 37.01 }, "origin_country": { "name": "United States", "alpha2": "US" }, "destination_country": { "name": "United Kingdom", "alpha2": "GB" }, "items": [ { "id": "ee1ebd88-b0f4-4540-b83c-2432d018c3d4", "description": "S1A", "sku": "S1A", "width": 0.0, "length": 0.0, "height": 0.0, "actual_weight": 0.045, "dimensional_weight": 0.0, "volumetric_weight": 0.045, "declared_customs_value": 0.01, "declared_currency": "USD", "origin_customs_value": 0.01, "origin_currency": "USD", "category": null, "quantity": 1 } ], "box": { "name": null, "length": "1.0", "width": "1.0", "height": "1.0" }, "selected_courier": { "id": "1422eb90-f90a-4afa-a7b2-83657ee54582", "name": "FedEx Cross Border Untracked", "min_delivery_time": "10", "max_delivery_time": "20", "shipment_charge": 12.99, "fuel_surcharge": 0.0, "remote_area_surcharge": 0.0, "remote_area_surcharges": {}, "other_surcharges": {}, "oversized_surcharge": 0.0, "additional_services_surcharge": 0.0, "residential_full_fee": 0.0, "residential_discounted_fee": 0.0, "shipment_charge_total": 12.99, "warehouse_handling_fee": 0.0, "insurance_fee": 0.0, "import_tax_charge": 0.0, "import_tax_non_chargeable": 0.0, "import_duty_charge": 0.0, "ddp_handling_fee": 0.0, "total_charge": 12.99, "is_above_threshold": true, "effective_incoterms": "DDU", "estimated_import_tax": 2.6, "estimated_import_duty": 0.0, "courier_does_pickup": null, "courier_dropoff_url": "https://tools.usps.com/find-location.htm?", "available_handover_options": "dropoff,free_pickup", "courier_remarks": null, "payment_recipient": "Easyship" }, "is_merged": false, "discount": { "code": null, "amount": 0, "expires_at": null, "percentage": null, "origin_amount": 0 } } } ```

why does this rates request api call return an error?

POST /2023-01/rates HTTP/1.1 Accept: application/json Content-Type: application/json Authorization: Bearer prod_4jZAQeqvVWAlL2pJWu2Zfe7GRu++0oymSxwI1fbzrCc= Host: api.easyship.com Content-Length: 1104 {"origin_address":{"line_1":"13734 Bermuda Cay Ct","state":"FL","city":"Jacksonville","postal_code":"32225","country_alpha2":"US","company_name":"Quick Shaver LLC","contact_name":"Wes Krosnick","contact_phone":"9043801159","contact_email":"[email protected]"},"destination_address":{"line_1":"19 Gaywood Cr","state":"AL","city":"Jacksonville","postal_code":"32225","contact_name":"George Brown","contact_phone":"‭9045531910‬","country_alpha2":"US","contact_email":"[email protected]"},"insurance":{"is_insured":false},"courier_selection":{"apply_shipping_rules":true},"shipping_settings":{"units":{"weight":"kg","dimension":"cm"}},"parcels":[{"box":{"slug":"Bubble Shipping Bag","length":17,"width":9,"height":4},"items":[{"quantity":1,"dimensions":{"length":17,"width":9,"height":4},"description":"Shaver","category":"health_beauty","sku":"SKU1","hs_code":"8510.10.0000","contains_battery_pi966":true,"contains_battery_pi967":false,"contains_liquids":false,"origin_country_alpha2":"US","actual_weight":0.907,"declared_currency":"USD","declared_customs_value":59.95}],"total_actual_weight":2}]}