Discussions

Ask a Question
Back to All

Buy label issue

Hello. I'm having this error when i'm trying to buy a label for a shipment using https://api.easyship.com/label/v1/labels request:

{
"message": "undefined method map' for nil:NilClass", "errors": [ "undefined methodmap' for nil:NilClass"
],
"labels": [],
"total_cost": null,
"available_balance": 100.0
}

I'm having it on both sandbox and prod accounts.

Can you please explain what this error could mean?
Can you please provide a list of possible error codes/errors which can occur on label creation?
Also i see on the UI that for some destinations/weight the system can not find a courier. What will be in the buy label api response in this case?
And what will be in the response if there's not enough money on available balance ?

The shipment was created in postman using https://api.easyship.com/v2/shipments
with following body:
{
"origin_address": {
"line_1": "2509 Plantside Dr",
"line_2": "Unit 401",
"state": "KY",
"city": "Louisville",
"postal_code": "40299",
"country_alpha2": "US",
"contact_name": "Rob",
"company_name": "SV",
"contact_phone": "+8129876619",
"contact_email": "[email protected]"
},
"sender_address": {
"line_1": "2509 Plantside Dr",
"line_2": "Unit 401",
"state": "KY",
"city": "Louisville",
"postal_code": "40299",
"country_alpha2": "US",
"contact_name": "Rob",
"company_name": "SV",
"contact_phone": "+8129876619",
"contact_email": "[email protected]"
},
"return_address": {
"line_1": "2509 Plantside Dr",
"line_2": "Unit 401",
"state": "KY",
"city": "Louisville",
"postal_code": "40299",
"country_alpha2": "US",
"contact_name": "Rob",
"company_name": "SV",
"contact_phone": "+8129876619",
"contact_email": "[email protected]"
},
"destination_address": {
"line_1": "9265 Firestone Blvd, Downey, CA 90241, United States",
"line_2": "Porte A",
"state": "CA",
"city": "Downey",
"postal_code": "90241",
"country_alpha2": "US",
"contact_name": "Sonny Bill",
"company_name": "Sonny Bill",
"contact_phone": "+336638000",
"contact_email": "[email protected]"
},
"metadata": {},
"set_as_residential": false,
"incoterms": "DDU",
"shipping_settings": {
"units": {
"weight": "lb",
"dimensions": "in"
},
"printing_options": {
"format": "pdf",
"label": "4x6",
"commercial_invoice": "A4",
"packing_slip": "none"
},
"buy_label": false,
"buy_label_synchronous": false
},
"parcels": [
{
"total_actual_weight": 10,
"box": {
"slug": null,
"length": 10,
"width": 8,
"height": 5
},
"items": [
{
"description": "Silk dress",
"category": "fashion",
"sku": "test01",
"quantity": 2,
"dimensions": {
"length": 12,
"width": 12,
"height": 12
},
"actual_weight": 10,
"declared_currency": "USD",
"declared_customs_value": 20
}
]
}
]
}