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:
POSThttps://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": "test@test.com", "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.