Create Order
POST /SaveOrder
Creates a new order in Adisyo
Example Requests
For delivery or takeaway orders, address and optionally location (lat/long) fields are used.
curl -X POST 'https://ext.adisyo.com/api/External/v2/SaveOrder' \
--header "x-api-key: ..." \
--header "x-api-secret: ..." \
--header "x-api-consumer: ..." \
--header 'Content-Type: application/json' \
--data '{
"CustomerName": "Ahmet",
"CustomerSurname": "Yılmaz",
"CustomerId": "MUS-03",
"CustomerPhone": "5551234567",
"CustomerPhone2": "5559876543",
"Address": "Atatürk Mahallesi, Çiçek Sokak No:12 Daire:4",
"AddressDescription": "Building opposite Migros, red door",
"Region": "Ataşehir",
"City": "İstanbul",
"PaymentMethodId": 3,
"PaymentNote": "Payment will be made with credit card on delivery",
"Discount": 0,
"OrderTotal": 127.00,
"DeliveryFee": 15,
"OrderNote": "Please bring the order hot, also include wet wipes and napkins",
"WebOrderId": "SIP-08",
"CustomerLatitude": "40,987654",
"CustomerLongitude": "29,123456",
"OrderDetails": [
{
"ProductUnitId": 2359421,
"Quantity": 2,
"OrderDetailNote": "Large size, I prefer without spices"
},
{
"ProductUnitId": 2359422,
"Quantity": 1
}
]
}'Request Parameters
Let's explain the order saving requests above through the following example scenario:
- Your restaurant has a website.
- A customer named
Ahmet Yılmazplaces an order through your website.- If this customer is not previously registered in your system, you should first save them to your own database and send the customer ID you created (in the example
MUS-03) to the Adisyo API.- Suppose the order created is saved as
SIP-07in your own system. If you send this order to Adisyo with this reference number, we can use it for tracking the operation and subsequent steps.- If you want this order to appear on a specific table in Adisyo, first get the table list from the Table list endpoint and send the selected table's
idasTableId. If you don't sendTableId, the order will not be linked to any table.
| Parameter Name | Data Type | Description |
|---|---|---|
CustomerName | String | Name of the customer placing the order |
CustomerSurname | String | Surname of the customer placing the order |
CustomerId | String | ID of the customer placing the order in your system (MUS-03) |
CustomerPhone | String | Primary phone number of the customer placing the order |
CustomerPhone2 | String | Secondary phone number of the customer placing the order |
Address | String | Address of the customer placing the order |
AddressDescription | String | Description for the address of the customer placing the order |
Region | String | District name of the customer placing the order |
City | String | City of the customer placing the order |
PaymentMethodId | Number | Payment Type |
PaymentNote | String | Payment note |
Discount | Number | Discount amount applied to the whole order (Applying a discount) |
DiscountRate | Number? | Discount rate applied to the whole order (0-100) (Applying a discount) |
DiscountId | Number? | ID of the defined discount applied to the whole order (Applying a discount) |
OrderNote | String | Order note |
WebOrderId | String | Order ID in your system (SIP-07) |
OrderTotal | Number | Order total amount |
TableId | Number? | If sent, the order will be created on the related table. The value should be the table ID returned from the Table list. |
OrderType | Number? | Order type. If not sent, a delivery order is created (Order type) |
DeliveryFee | Number | Delivery Fee (Calculating Order Total) |
ServiceCharge | Number | Service charge or other extra service fees (Calculating Order Total) |
CustomerLatitude | String? | Customer latitude information (##,####). Not required for table orders. |
CustomerLongitude | String? | Customer longitude information (##,####). Not required for table orders. |
OrderDetails | Array | List of order details |
[].OrderDetails.ProductUnitId | Number | Product unit ID (Specifying Product in Order) |
[].OrderDetails.ProductCode | String | Product code (Specifying Product in Order) |
[].OrderDetails.Quantity | Number | Product quantity |
[].OrderDetails.OrderDetailNote | String? | Order detail note |
[].OrderDetails.DiscountAmount | Number? | Discount amount applied to the item (Applying a discount) |
[].OrderDetails.DiscountRate | Number? | Discount rate applied to the item (0-100) (Applying a discount) |
[].OrderDetails.DiscountId | Number? | ID of the defined discount applied to the item (Applying a discount) |
[].OrderDetails.Name | String? | Product or menu name |
[].OrderDetails.IsMenu | Boolean | Is it a menu? (Menu Products) |
[].OrderDetails.MenuId | Number? | Menu ID (Menu Products) |
[].OrderDetails.ParentId | String? | ID of the menu or product it belongs to (Menu Products) |
Order type
An order is recorded in Adisyo as one of three types: delivery, pickup or table. The order type also determines which price the products are calculated from.
OrderType | Description | Resulting order | Price used |
|---|---|---|---|
| (omitted) | — | Delivery | Delivery price |
2 | Delivery order | Delivery | Delivery price |
3 | Pickup order | Pickup | Pickup price |
| (other values) | — | Delivery | Delivery price |
- If you do not send
OrderType, the order is recorded as delivery. The field is optional; you do not need to change your existing integration. - When
TableId(greater than 0) is sent the order is always a table order and the table price applies;OrderTypeis ignored. - To create a table order you must send
TableId.OrderType: 5on its own does not create a table order.
Pricing in a pickup order
In a pickup order the products are priced from the row whose orderType is 5 under productUnits[].prices[] in the Product list response (1 is the table price, 3 the delivery price). You must calculate OrderTotal and the line amounts from that price; a total based on the delivery price will not match and the request is rejected.
⚠️ The
OrderTypeyou send in the request andorderTypein the price list are different lists. Pickup is3in the request and5in the price list.
If the product has no pickup price row the request is rejected; it does not fall back to the delivery price.
Calculating Order Total
You can send extra fees added to the order total amount through 2 separate values.
If a separate payment is received for delivery, you can send this through the DeliveryFee field.
For example, for an order where product items are 40 and delivery fee is 15 TL, it should be sent as OrderTotal: 55, DeliveryFee: 15.
Also, extra service fees or similar additional fees should be sent through the ServiceCharge field.
For example, for a restaurant that charges 10 for packaging fee and 20 for extra service fee,
In an order where product items are also 90 TL, it should be sent as ServiceCharge: 30, OrderTotal: 120 TL.
If there is also a 20 TL delivery fee in this order, OrderTotal: 140 and DeliveryFee: 20 TL should be.
Applying a discount
A discount can be applied to the whole order and to individual items. At both levels one of three methods is used:
| Method | Whole order | Item | Description |
|---|---|---|---|
| Amount | Discount | DiscountAmount | Fixed discount amount |
| Rate | DiscountRate | DiscountRate | Rate between 0 and 100 |
| Defined discount | DiscountId | DiscountId | ID of a discount defined in Adisyo. Sent on its own, the amount/rate is read from the definition; sent together with an amount or a rate, the value you send is applied |
See the Discount list page for the list of defined discounts.
To apply or change a discount after the order has been created, use the Order discount endpoint.
Order total with a discount
OrderTotal is the amount the customer pays after discounts. It must be consistent with the sum of the order items as follows:
Sum of order items = OrderTotal + total discount - DeliveryFee - ServiceChargeThe total discount is the sum of the item discounts and the whole order discount.
{
"Discount": 30,
"OrderTotal": 250,
"OrderDetails": [
{
"ProductUnitId": 2359421,
"Quantity": 1,
"DiscountRate": 10
},
{
"ProductUnitId": 2359422,
"Quantity": 2
}
]
}In the example above, assume the unit prices in Adisyo are 200 TL and 50 TL:
- Sum of order items:
200 + (2 x 50) = 300 - Item discount: 10% of
200=20 - Whole order discount:
30 - Total discount:
20 + 30 = 50 OrderTotal:300 - 50 = 250
Rules
- When an amount or a rate is sent alongside
DiscountId, the value you send is applied; the discount is still recorded as that defined discount. Sent on its own,DiscountIduses the value from its definition. - An amount and a rate cannot be sent at the same time, not even together with
DiscountId. Exactly one of them must be chosen at each level. - A rate based whole order discount is applied to the amount remaining after the item discounts. In the example above, sending
"DiscountRate": 10for the whole order would give 10% of280, that is28TL, not 10% of300. - The discount applied to an item cannot exceed the item total.
- A discount cannot be applied to menu sub items. To discount a menu, send it on the menu itself, that is the parent item (Menu Products).
- If the whole order discount exceeds the order total the request is not rejected; the discount is capped at the order total and the order is saved as
0. The formula above must still hold, so when applying a 300 TL coupon to a 200 TL order for example, cap the discount yourself and sendDiscount: 200,OrderTotal: 0.
Specifying Product in Order
Based on the product list obtained from the Product List endpoint, you need to choose only one of the ProductUnitId or ProductCode fields in the product details of the orders you will create.
When creating the product list in the order, you need to fill only one of these fields and send the other as null or without any value.
Menu Products
If a product in the order is under a different menu, it should have its own ParentId value.
Otherwise, ParentId should not be sent or should be specified as null.
Note: A product's
MenuIdandParentIdvalues should not be the same.
Example: Products Containing Menu
Hamburgeris a menu, so it has its ownMenuIdvalue.- Since
Kolais underHamburger Menu, theParentIdvalue should be the same asHamburger's MenuIdvalue.
"OrderDetails": [
{
"Quantity": 1,
"ProductUnitId": 123,
"IsMenu": true,
"MenuId": 1,
"ParentId": null
},
{
"Quantity": 1,
"ProductUnitId": 234,
"IsMenu": false,
"MenuId": null,
"ParentId": "1"
}
]Example: Independent Products
If Kola is not connected to any menu, the ParentId parameter should not be sent.
"OrderDetails": [
{
"Quantity": 1,
"ProductUnitId": 123,
"IsMenu": false,
"MenuId": null,
"ParentId": null
},
{
"Quantity": 1,
"ProductUnitId": 234,
"IsMenu": false,
"MenuId": null,
"ParentId": null
}
]Example Response
{
"orderId": 643287,
"orderTotal": 18.0,
"discount": 0.0,
"insertedDate": "2025-09-26T20:21:40.05",
"status": 100,
"message": null
}Response Parameters
| Parameter Name | Data Type | Description |
|---|---|---|
orderId | Number | Order ID in Adisyo system |
orderTotal | Number | Total amount of the order |
discount | Number | Total discount amount applied in the order |
insertedDate | Date ISO 8601 | Date when the order was saved to the system |
status | Number | Response Codes |
message | String | Operation result message |