These docs are for v1.0. Click to read the latest docs for v2024.09.

Discussions

Ask a Question
Back to All

Create Shipment API return cryptic errors in Sandbox env

Hello.
We're having some issues with sandbox environment for our API integration which first appeared 2 days ago.

When creating a new shipment with "buy_label_synchronous": true, we started getting "partial_success" as a status and "undefined method `[]' for nil:NilClass" as errors array in response.
As a result shipping_documents array is empty.

Steps to reproduce:
Api key: sand_api_kay
POST /v2/shipments

Request Body:
{
"destination_address": {
"line_1": "2459 MacLaren Street",
"line_2": "",
"state": "Ontario",
"city": "Ottawa",
"postal_code": "K1P 5M7",
"country_alpha2": "CA",
"company_name": "Company",
"contact_name": "John Doe",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"origin_address": {
"line_1": "2562 Horizon Circle",
"line_2": null,
"state": "Washington",
"city": "Seattle",
"postal_code": "98109",
"country_alpha2": "US",
"contact_name": "Maksym Dukov",
"company_name": "Company",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"metadata": {},
"set_as_residential": false,
"consignee_tax_id": null,
"eei_reference": null,
"incoterms": "DDU",
"order_data": {
"platform_name": null,
"platform_order_number": "1234591",
"seller_notes": null,
"buyer_notes": null
},
"courier_selection": {
"selected_courier_id": "d5082858-4a51-4beb-9d13-84ec5a47c0ce",
"allow_courier_fallback": false,
"apply_shipping_rules": true
},
"shipping_settings": {
"printing_options": {
"format": "url",
"label": "4x6",
"commercial_invoice": "A4",
"packing_slip": "none"
},
"units": {
"weight": "lb",
"dimensions": "in"
},
"buy_label": false,
"buy_label_synchronous": true,
"output_currency": "USD"
},
"parcels": [
{
"items": [
{
"description": "Silk dress",
"category": "fashion",
"quantity": 1,
"declared_currency": "USD",
"actual_weight": 1,
"declared_customs_value": 10,
"dimensions": {
"width": 10,
"height": 10,
"length": 10
}
}
]
}
]
}

Response body:
{
"status": "partial_success",
"errors": [
"undefined method `[]' for nil:NilClass"
],
"shipment": {
"easyship_shipment_id": "ESUS10111713",
"created_at": "2022-09-15T14:26:58.244Z",
"updated_at": "2022-09-15T14:26:59.095Z",
"label_paid_at": "2022-09-15T14:26:58.930Z",
"label_generated_at": null,
"order_created_at": null,
"origin_address": {
"line_1": "2562 Horizon Circle",
"line_2": null,
"state": "Washington",
"city": "Seattle",
"postal_code": "98109",
"country_alpha2": "US",
"contact_name": "Maksym Dukov",
"company_name": "Company",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"sender_address": {
"line_1": "2562 Horizon Circle",
"line_2": null,
"state": "Washington",
"city": "Seattle",
"postal_code": "98109",
"country_alpha2": "US",
"contact_name": "Maksym Dukov",
"company_name": "Company",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"return_address": {
"line_1": "2562 Horizon Circle",
"line_2": null,
"state": "Washington",
"city": "Seattle",
"postal_code": "98109",
"country_alpha2": "US",
"contact_name": "Maksym Dukov",
"company_name": "Company",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"destination_address": {
"line_1": "2459 MacLaren Street",
"line_2": null,
"state": "Ontario",
"city": "Ottawa",
"postal_code": "K1P 5M7",
"country_alpha2": "CA",
"contact_name": "John Doe",
"company_name": "Company",
"contact_phone": "+12025550161",
"contact_email": "[email protected]"
},
"order_data": {
"platform_name": null,
"platform_order_number": "1234591",
"order_tag_list": [],
"seller_notes": null,
"buyer_notes": null
},
"metadata": {},
"set_as_residential": false,
"consignee_tax_id": null,
"eei_reference": null,
"incoterms": "DDU",
"insurance": {
"is_insured": false,
"insured_amount": 49.08,
"insured_currency": "USD"
},
"parcels": [
{
"total_actual_weight": 0.454,
"box": {
"id": null,
"courier_umbrella_name": null,
"courier_origin_country_alpha2": null,
"name": null,
"slug": null,
"outer_length": 25.4,
"outer_width": 25.4,
"outer_height": 25.4,
"weight": 0.0
},
"items": [
{
"description": "Silk dress",
"category": "Fashion",
"sku": null,
"quantity": 1,
"dimensions": {
"length": 25.4,
"width": 25.4,
"height": 25.4
},
"actual_weight": 0.45359237,
"origin_currency": "USD",
"origin_customs_value": 10.0,
"declared_currency": "USD",
"declared_customs_value": 10.0
}
]
}
],
"total_customs_value": 10.0,
"total_actual_weight": 0.45359237,
"shipment_state": "created",
"pickup_state": "not_requested",
"delivery_state": "not_created",
"label_state": "technical_failed",
"warehouse_state": "none",
"trackings": [],
"tracking_page_url": "https://www.trackmyshipment.co/shipment-tracking/ESUS10111713",
"shipping_documents": [],
"currency": "USD",
"selected_courier": {
"id": "d5082858-4a51-4beb-9d13-84ec5a47c0ce"
},
"rates": [
{
"courier_id": "d5082858-4a51-4beb-9d13-84ec5a47c0ce",
"courier_name": "Global Post - Standard",
"min_delivery_time": 6,
"max_delivery_time": 10,
"value_for_money_rank": 1.0,
"delivery_time_rank": 1.0,
"currency": "USD",
"shipment_charge": 39.08,
"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": 39.08,
"warehouse_handling_fee": 0.0,
"insurance_fee": 0.0,
"sales_tax": 0.0,
"provincial_sales_tax": 0.0,
"ddp_handling_fee": 0.0,
"import_tax_charge": 0.0,
"import_tax_non_chargeable": 0.0,
"import_duty_charge": 0.0,
"total_charge": 39.08,
"is_above_threshold": true,
"incoterms": "DDU",
"estimated_import_tax": 5.89,
"estimated_import_duty": 0.0,
"minimum_pickup_fee": 0.0,
"available_handover_options": "dropoff",
"tracking_rating": 0,
"easyship_rating": 1.3,
"courier_remarks": null,
"payment_recipient": "Easyship",
"discount": {
"code": null,
"amount": 0,
"expires_at": null,
"percentage": null,
"origin_amount": 0
}
}
]
}
}