Shipping Address

This page explains the functionality that allows you to change the shipping address during the order flow cycle in your Order Management System (OMS).

Restrictions

There are some restrictions to this functionality, depending on the order type:

  • HD/SFS - For Home Delivery (HD) or Ship From Store (SFS) processes it is possible to change the Shipping Address information during the order flow cycle up until the moment any of the lines of your order are part of the shipment request sent to the logistics provider. If you want to add a UI restriction, search by using the service specification, magento.logistics.shipment_request_repository, in a shipment request.
  • ISPU - Is not applicable to a In Store Pick Up process.

If the order is already in the logistics stage and the SI wants to change it, the shipment request must be cancelled before changing it.

Configuration

You can modify the shipping address functionality in your Configuration Portal. Both the integration and the UI are configurable. It is possible to enable or disable this functionality for a certain role, depending on the rights for that role.

Roles & Permissions

Integration

To initiate a shipping address change, use the update_shipping_address command:

{
    "shipping_address_modification": {
        "new_shipping_address": {
            “reference”: “Reference-1”,
            "address1": "Llacuna 56",
            "address2": "",
            "city": "Barcelona",
            “state”: “Barcelona”,
            “zip”: “08007”,
            "company_name": "",
            "country_code": "US",
            "custom_attributes": [],
            "email": "newmail@example.com",
            "first_name": "New Name",
            "last_name": "New Surname",
            "phone": "600000000",
            "state": "MI",
            "zip": "49628-7978",
            “latitude”: “41,3851”,
            “longitude”: “2,1734”,
            “custom_attributes”: [
                {
                  “name”: “delivery_note”,
                  “value”: “next door”
                }
            ]
        },
        "order_id": "000000029",
        "sales_channel_id": "ST1",
        "user": "UserName"
    }
}

When the action is performed successfully, our system will generate an event that could be consumed by any integration, with the name shipping_address_updated, with exactly the same content as the previous one.

As this request is a synchronous one, if a failure occurs you will see a response message listing the reason of the non-expected behavior.

The following is an example of a failure response:

{
    "jsonrpc":"2.0",
    "id":1,
    "error": {
        "message":"Feature with name \u0027updateShippingAddress\u0027, is not enabled.",
        "code":-32602
    }
}