Discussions

Ask a Question
Back to All

Retrieve Rates for Return Shipment

When we try to create a shipment with the flag "return": true for route /2024-09/shipments like this:

{  
    "origin_address": {  
        "line_1": "4501 S Lancaster Rd",  
        "city": "Dallas",  
        "state": "Texas",  
        "postal_code": "75216",  
        "country_alpha2": "US",  
        "contact_name": "Yeni",  
        "contact_phone": "321321231321",  
        "contact_email": "[email protected]",  
        "company_name": "test"  
    },  
    "destination_address": {  
        "line_1": "4500 S Lancaster Rd",  
        "city": "Dallas",  
        "country_alpha2": "US",  
        "state": "Texas",  
        "postal_code": "75216",  
        "contact_name": "Yeni2",  
        "contact_phone": "545645645646",  
        "contact_email": "[email protected]",  
        "company_name": ""  
    },  
    "incoterms": "DDU",  
    "order_data": {  
      "platform_name": "Direct Sales"  
    },  
    "return": true,  
    "courier_settings": {  
        "courier_service_id": "c3e97b11-2842-44f1-84d1-afaa6b3f0a7c",  
        "show_courier_logo_url": false,  
        "apply_shipping_rules": true  
    },  
    "shipping_settings": {  
        "units": {  
            "weight": "kg",  
            "dimensions": "cm"  
        },  
        "buy_label": true,  
        "buy_label_synchronous": true,  
        "printing_options": {  
            "format": "pdf",  
            "label": "A4",  
            "commercial_invoice": "A4",  
            "packing_slip": "A4"  
        }  
    },  
    "parcels": [  
        {  
            "box": null,  
            "items": [  
                {  
                    "description": "test",  
                    "declared_currency": "USD",  
                    "declared_customs_value": 13,  
                    "dimensions": {  
                        "length": 25,  
                        "width": 25,  
                        "height": 25  
                    },  
                    "sku": "test",  
                    "quantity": 1,  
                    "hs_code": "0810.10.00"  
                }  
            ],  
            "total_actual_weight": 1  
        }  
    ]  
}

We use courier_service_id which we retrieve from /2024-09/rates with:

{  
    "origin_address": {  
        "city": "Dallas",  
        "line_1": "4500 S Lancaster Rd",  
        "state": "TX",  
        "postal_code": "75216",  
        "country_alpha2": "US",  
        "contact_name": "Yeni",  
        "contact_phone": "321321231321",  
        "contact_email": "[email protected]",  
        "company_name": "test"  
    },  
    "destination_address": {  
        "line_1": "4501 S Lancaster Rd",  
        "city": "Dallas",  
        "country_alpha2": "US",  
        "state": "TX",  
        "postal_code": "75216",  
        "contact_name": "Yeni2",  
        "contact_phone": "545645645646",  
        "contact_email": "[email protected]"  
    },  
    "shipping_settings": {  
        "units": {  
            "weight": "kg",  
            "dimensions": "cm"  
        }  
    },  
    "parcels": [  
        {  
            "items": [  
                {  
                    "description": "test",  
                    "declared_currency": "USD",  
                    "declared_customs_value": 13,  
                    "category": "toys",  
                    "quantity": 1,  
                    "dimensions": {  
                        "length": 25,  
                        "width": 25,  
                        "height": 25  
                    }  
                }  
            ],  
            "total_actual_weight": 1  
        }  
    ]  
}

And it creates with 202 Response Status, because of "No shipping solutions available based on the information provided".

If we change to return: false - it works.

If we keep return: true but use "courier_service_id": "9db51d64-abef-4980-8648-85e7bf7cb832" - it works too.

The problem is that we can not retrieve any rates by /2024-09/rates with "courier_service_id": "9db51d64-abef-4980-8648-85e7bf7cb832".

It looks like /2024-09/rates returns all rates for direct shipment only.

The question is how we can retrieve rates to apply for shipment with the flag return: true ?

If you want to say that we should use pattern PARCELRETURNITEMCREATE for /2024-09/rates: we do not send shipped by Easyship return and can not use this pattern. And this way the next question - why are we able to create a shipment with return: true without using the pattern PARCELRETURNITEMCREATE?