Orders APIs

Modified on Wed, 1 Oct at 8:41 PM

Create Order

Endpoint URL
POST https://api.tryoto.com/rest/v2/createOrder
Example Request Body

Here is an example of a request body:

{
  "orderId": "1234",
  "pickupLocationCode": "jdd_wh",
  "createShipment": "true",
  "deliveryOptionId": 564,
  "payment_method": "paid",
  "amount": 100,
  "amount_due": 0,
  "currency": "SAR",
  "customsValue": "12",
  "customsCurrency": "USD",
  "packageCount": 2,
  "packageWeight": 1,
  "boxWidth": 10,
  "boxLength": 10,
  "boxHeight": 10,
  "orderDate": "31/12/2022 15:45",
  "deliverySlotDate": "31/12/2020",
  "deliverySlotTo": "12pm",
  "deliverySlotFrom": "2:30pm",
  "senderName": "Sender Company",
  "customer": {
    "name": "\u0639\u0628\u062f\u0627\u0644\u0644\u0647 \u0627\u0644\u063a\u0627\u0645\u062f\u064a",
    "email": "test@test.com",
    "mobile": "546607389",
    "address": "6832, Abruq AR Rughamah District, Jeddah 22272 3330, Saudi Arabia",
    "district": "Al Hamra",
    "city": "Jeddah",
    "country": "SA",
    "postcode": "12345",
    "lat": "40.706333",
    "lon": "29.888211",
    "refID": "1000012"
  },
  "items": [
    {
      "productId": 112,
      "name": "test product",
      "price": 100,
      "rowTotal": 100,
      "taxAmount": 15,
      "quantity": 1,
      "sku": "test-product",
      "image": "http://...."
    },
    {
      "name": "test product 2",
      "price": 100,
      "quantity": 1,
      "sku": "test-product-2"
    }
  ]
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringId of the Order
parentOrderIdnostringparent id of splitted orders.
ref1nostringReference for order optional
pickupLocationCodenostringpredefined pickup address of stores/warehouses, if it doesn't exist then OTO will assign it to a pickup location automatically. it is required when `serviceType` is filled `pickupFromStore`
createShipmentnobooleanif you fill it `true` then automatic shipment will be created for this order.
serviceTypenostring`pickupFromStore` this is optional for orders customer pick it up from store.
forReverseShipmentnobooleanif it is true, order can be reverse shipped without forward shipment
deliveryOptionIdnostringactivated delivery company option id, if this exists OTO try to create shipment with this settings. if not exists try with possible active settings.
storeNamenostringName of the store
pickingTypenoenumPossible values:
PICKUP_BY_DC: Shipping company offers free pickup from origin. BRANCH_DROP_OFF: Package must be delivered to a branch of the shipping company.
payment_methodyesstringPossible values: - _cod_ - _paid_
amountyesdoubleTotal value amount of the order
amount_dueyesdoubleTotal due amount of the order. If order paid amount_due will be 0. Otherwise equal to amount.
currencyyesstringCurrency code of the order currency
shippingAmountnodoubleshipping amount of this order
subtotalnodoubleSubtotal of the order
shippingNotesnostringNotes of customer for shipping. I.e `don’t ring the bell.`
packageSizenostringUsed for specifiying the maximum package size. Possible values smalbox
packageCountnointegerStates how many package in the order
packageWeightnodoubleTotal weight of the order
boxWidthconditionaldoublewidth of the package, it is needed to use Aggregator shipping options
boxLengthconditionaldoublelength of the package, it is needed to use Aggregator shipping options
boxHeightconditionaldoubleheight of the package, it is needed to use Aggregator shipping options
deliverySlotDatenodatePrefered `Delivery` date
deliverySlotFromnostring“From” time for delivery time
deliverySlotTonostring“To” time for delivery time
orderDatenodateTimeDate of the order
senderNamenostringSender name
senderInformationnoobjectSender Data
customeryesobjectCustomer Data
itemsyesarrayItems data
couponCodenotextDiscount or special offer code.
codFeenodoubleCOD Fee
brandIdnolongBrand (Client Store) ID
whoPaysnostringIf implemented, annotates who wil pay for the shipment. Possible values: marketplacePaysDeliveryFee, sellerPaysDeliveryFee
NameRequiredTypeDescription
senderAddressNamenostringName of the sender address
senderIdyesstringId of the sender
senderFullNameyesstringFull name of the sender
senderMobileyesstringMobile number of sender
senderEmailnostringIn format of [test@example.com](https://mailto:test@example.com)
senderCountryyesstringCountry ISO2 code "SA","AE" etc.
senderStatenostringState name of the sender
senderCityyesstringCity name of the sender
senderDistrictnostringDistrict name of the sender
senderPostcodenostringPostal code of the sender's address
senderAdressLineyesstringDetailed address of the sender
latnonumberLatitude, \*if not exist orders may not assigned to pickupLocations automatically
lonnonumberLongitude, \* if not exist orders may not assigned to pickupLocations automatically
NameRequiredTypeDescription
nameyesstringCustomer full name
emailnostringCustomer email address
mobileyesstringMobile number of the customer
addressyesstringAddress of the customer
districtnostringDistrict or area name
cityyesstringCity name
statenostringState name
countryyesstringPossible values can be _SA_,_EG_,_UAE_,_BHR_,_KWT_
shortAddressCodenostringA simplified version of the traditional address transformed into a unique code. It consists of 4 letters (e.g., RAGI) assigned based on postal codes and 4 digits representing the building number (e.g., 2929).
postcodenostringpostal code of address
streetnostringStreet of the customer
latnodoubleLatitude
lonnodoubleLongitude
refIDnostringexp. customerId of ecommerce
W3WAddressnostringif you want to define the address with using [what3words.com](https://what3words.com/clear.clear.clear) you can use this option
NameRequiredTypeDescription
productIdnolongId of the product
nameyesstringName of the product
priceyesdoubleUnit price of the product
rowTotalnodoubletotal amount of this line item
taxAmountnodoubletax amount of this line item
quantityyesdoubleQuantity purchased
serialnumbernostringSerial number of the product
skuyesstringSKU number of the product
imagenostringHttp link of the product main photo
hsCodenostringa standardized numerical method of classifying traded products
itemOriginnostringOrigin of the item

Available Packages: All Packages

This API endpoint is a critical component in e commerce and logistics systems, enabling external applications to initiate and manage new orders seamlessly. This endpoint allows you to submit order details, such as customer information, product data, shipping preferences, and payment methods.

Request Parameters: |

Request Parameters for Sender Information Data |

Request Parameters for Customer Data |

Request Parameters for Items Data |


Update Order

Endpoint URL
POST https://api.tryoto.com/rest/v2/updateOrder
Example Request Body

Here is an example of a request body:

{
  "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/2022 15:45",
  "deliverySlotDate": "31/12/2022",
  "deliverySlotTo": "12pm",
  "deliverySlotFrom": "2:30pm",
  "customer": {
    "name": "\u0639\u0628\u062f\u0627\u0644\u0644\u0647 \u0627\u0644\u063a\u0627\u0645\u062f\u064a",
    "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://...."
    }
  ]
}

Available Packages: All Packages

This API endpoint allows you update order info with this endpoint before shipment creation. If you created a shipment and need to update an information after that you have to cancel the shipment first then you can update.


Update Order Status

Endpoint URL
POST https://api.tryoto.com/rest/v2/updateOrderStatus
Example Request Body

Here is an example of a request body:

{
  "orderIds": [
    30846946
  ],
  "status": "delivered",
  "date": "2024-08-06T21:00:00.000Z",
  "description": "aaaaaa"
}
Request Parameters
NameRequiredTypeDescription
orderIdsyesstringId of the order/s
statusyesstringstatus of the shipment(delivered, returned, pickedUp)
descriptionnostringdescription of the status change
datenodatethe delivery date of the order

Available Packages: Starter, Scale Package, Enterprise Package, Marketplaces

This API endpoint allows you to modify the current status of an order within the system.

You can update the order status to "delivered," "returned," or "picked up" if the order does not have an associated shipment. However, if a shipment exists, only statuses for integrator managed shipments can be updated.

Request Parameters: |


Cancel Order

Endpoint URL
POST https://api.tryoto.com/rest/v2/cancelOrder
Example Request Body

Here is an example of a request body:

{
  "orderId": "1234"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringorderId from which you want to cancel.

Available Packages: All Packages This API endpoint allows users to cancel an existing order under specific conditions. It ensures smooth and efficient handling of cancellations while maintaining the integrity of related processes.

Important Note: If the order has an associated shipment, it cannot be canceled via this endpoint. Shipment related restrictions ensure the system prevents conflicts or inconsistencies in ongoing fulfillment processes.

Request Parameters: |


Get Orders

Endpoint URL
GET https://api.tryoto.com/rest/v2/orders?perPage=2&page=2&status=delivered
Request Parameters
NameRequiredTypeDescription
perPagenonumberOrder count in the response. Max limit 100
pagenonumberPagination number. You can iterate this field to get all items.
minDatenodateStarting "Order Creation Date" of your orders in "yyyy-mm-dd" format.
maxDatenodateEnding "Order Creation Date" of your orders in "yyyy-mm-dd" format.
statusnostringStatus of the orders.

Available Packages: All Packages

This API endpoint is designed to provide a comprehensive overview of orders in your system. This endpoint returns detailed information about each order, including pickup locations, order IDs, item details, and current statuses. It enables seamless tracking and management of orders, ensuring better visibility and control.

Request Parameters: |


Get Order Details

Endpoint URL
GET https://api.tryoto.com/rest/v2/orderDetails
Request Parameters
NameRequiredTypeDescription
orderIdyesstringId of the Order

Available Packages: All Packages

This API endpoint provides detailed information about a specific order. By using this endpoint, you can retrieve comprehensive data about an order including status updates.

Request Parameters: |


Hold Order

Endpoint URL
POST https://api.tryoto.com/rest/v2/holdOrder
Example Request Body

Here is an example of a request body:

{
  "orderId": "OID-20980-1146",
  "onHoldReason": "Fraud",
  "onHoldReasonLang": "en"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringId of the order that you will place on hold.
onHoldReasonyesstringReason for being an order on hold.
onHoldReasonLangyesstringValues can be: eng, tr, ar.

Available Packages: All Packages

This API endpoint allows you to place an order on hold, temporarily pausing its processing. This is useful for scenarios such as payment verification, inventory issues, or customer requests.

Request Parameters: |


Unhold Order

Endpoint URL
POST https://api.tryoto.com/rest/v2/unHoldOrder
Example Request Body

Here is an example of a request body:

{
  "orderId": "OID-9616-98794"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringThe orderId you want to unhold.

Available Packages: All Packages

This API endpoint allows users to release orders that are currently on hold. This endpoint is designed to resume the processing of held orders, making them available for fulfillment or further actions in the order management workflow.

Request Parameters: |


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