How to Change Status of a Shipment

Modified on Sat, 1 Feb at 9:24 PM

Our API allows you to update shipment statuses for better tracking and management. The updateOrder endpoint supports updating the status of an order to specific allowed statuses, including:

  • Picked Up
  • Delivered
  • Returned

This guide explains how to use the updateOrder endpoint to change shipment statuses.


Instructions


Step 1: API Endpoint

  • The endpoint to update shipment status is:
    POST
    https://api.tryoto.com/rest/v2/updateOrder


Step 2: Authorization

  • Include a valid Bearer Token in the request headers for authentication.


Step 3: Example Request

  • Here is an example of a request to update a shipment’s status to "delivered":

    Using cURL:

    curl --location 'https://api.tryoto.com/rest/v2/updateOrder' \

    --data-raw '{

        "orderId": "202111081227",

        "ref1": "1234ABCDE",

        "pickupLocationCode": "12364",

        "deliveryOptionId": "12364",

        "storeName": "Brand A English",

        "payment_method": "paid",

        "amount": 100,

        "amount_due": 0,

        "shippingAmount":20,

        "subtotal":100,

        "currency": "SAR",

        "customsValue":"12",

        "customsCurrency":"USD",

        "shippingNotes": "be careful. it is fragile",

        "packageSize": "small",

        "packageCount": 2,

        "packageWeight": 1,

        "boxWidth": 10,

        "boxLength": 10,

        "boxHeight": 10,

        "orderDate": "30/12/2020 15:45",

        "deliverySlotDate": "31/12/2020",

        "deliverySlotTo": "12pm",

        "deliverySlotFrom": "2:30pm",

        "customer": {

            "name": "عبدالله الغامدي",

            "email": "[email protected]",

            "mobile": "546607389",

            "address": "6832, Abruq AR Rughamah District, Jeddah 22272 3330, Saudi Arabia",

            "district": "Al Hamra",

            "city": "Riyadh",

            "country": "SA",

            "postcode": "12345",

            "lat": "40.706333",

            "lon": "29.888211",

            "refID":"1000012",

            "W3WAddress":"alarmed.cards.stuffy"

        },

        "items": [

            {

                "productId": 112,

                "name": "test product",

                "price": 100,

                "quantity": 1,

                "sku": "test-product",

                "image": "http://...."

            },

            {

                "name": "test product 2",

                "price": 100,

                "quantity": 1,

                "sku": "test-product-2",

                "image": "http://...."

            }

        ]

    }'


Step 4: Example Response

  • A successful response will look like this:

    {

      "success": true,

      "message": "Successfully updated"

    }


This endpoint works only for the mentioned statuses, for updating shipments to other statuses ; kindly contact support.





Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article