Create Order

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.

Creating a package order with delivery
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ılmaz places 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-07 in 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 id as TableId. If you don't send TableId, the order will not be linked to any table.
Parameter NameData TypeDescription
CustomerNameStringName of the customer placing the order
CustomerSurnameStringSurname of the customer placing the order
CustomerIdStringID of the customer placing the order in your system (MUS-03)
CustomerPhoneStringPrimary phone number of the customer placing the order
CustomerPhone2StringSecondary phone number of the customer placing the order
AddressStringAddress of the customer placing the order
AddressDescriptionStringDescription for the address of the customer placing the order
RegionStringDistrict name of the customer placing the order
CityStringCity of the customer placing the order
PaymentMethodIdNumberPayment Type
PaymentNoteStringPayment note
DiscountNumberDiscount amount applied to the whole order (Applying a discount)
DiscountRateNumber?Discount rate applied to the whole order (0-100) (Applying a discount)
DiscountIdNumber?ID of the defined discount applied to the whole order (Applying a discount)
OrderNoteStringOrder note
WebOrderIdStringOrder ID in your system (SIP-07)
OrderTotalNumberOrder total amount
TableIdNumber?If sent, the order will be created on the related table. The value should be the table ID returned from the Table list.
OrderTypeNumber?Order type. If not sent, a delivery order is created (Order type)
DeliveryFeeNumberDelivery Fee (Calculating Order Total)
ServiceChargeNumberService charge or other extra service fees (Calculating Order Total)
CustomerLatitudeString?Customer latitude information (##,####). Not required for table orders.
CustomerLongitudeString?Customer longitude information (##,####). Not required for table orders.
OrderDetailsArrayList of order details
[].OrderDetails.ProductUnitIdNumberProduct unit ID (Specifying Product in Order)
[].OrderDetails.ProductCodeStringProduct code (Specifying Product in Order)
[].OrderDetails.QuantityNumberProduct quantity
[].OrderDetails.OrderDetailNoteString?Order detail note
[].OrderDetails.DiscountAmountNumber?Discount amount applied to the item (Applying a discount)
[].OrderDetails.DiscountRateNumber?Discount rate applied to the item (0-100) (Applying a discount)
[].OrderDetails.DiscountIdNumber?ID of the defined discount applied to the item (Applying a discount)
[].OrderDetails.NameString?Product or menu name
[].OrderDetails.IsMenuBooleanIs it a menu? (Menu Products)
[].OrderDetails.MenuIdNumber?Menu ID (Menu Products)
[].OrderDetails.ParentIdString?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.

OrderTypeDescriptionResulting orderPrice used
(omitted)DeliveryDelivery price
2Delivery orderDeliveryDelivery price
3Pickup orderPickupPickup price
(other values)DeliveryDelivery 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; OrderType is ignored.
  • To create a table order you must send TableId. OrderType: 5 on 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 OrderType you send in the request and orderType in the price list are different lists. Pickup is 3 in the request and 5 in 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:

MethodWhole orderItemDescription
AmountDiscountDiscountAmountFixed discount amount
RateDiscountRateDiscountRateRate between 0 and 100
Defined discountDiscountIdDiscountIdID 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 - ServiceCharge

The total discount is the sum of the item discounts and the whole order discount.

Order with a 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, DiscountId uses 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": 10 for the whole order would give 10% of 280, that is 28 TL, not 10% of 300.
  • 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 send Discount: 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 MenuId and ParentId values should not be the same.

Example: Products Containing Menu

  • Hamburger is a menu, so it has its own MenuId value.
  • Since Kola is under Hamburger Menu, the ParentId value should be the same as Hamburger's MenuId value.
Products Containing Menu
"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.

Independent Products
"OrderDetails": [
  {
    "Quantity": 1,
    "ProductUnitId": 123,
    "IsMenu": false,
    "MenuId": null,
    "ParentId": null
  },
  {
    "Quantity": 1,
    "ProductUnitId": 234,
    "IsMenu": false,
    "MenuId": null,
    "ParentId": null
  }
]

Example Response

Saved order response
{
  "orderId": 643287,
  "orderTotal": 18.0,
  "discount": 0.0,
  "insertedDate": "2025-09-26T20:21:40.05",
  "status": 100,
  "message": null
}

Response Parameters

Parameter NameData TypeDescription
orderIdNumberOrder ID in Adisyo system
orderTotalNumberTotal amount of the order
discountNumberTotal discount amount applied in the order
insertedDateDate ISO 8601Date when the order was saved to the system
statusNumberResponse Codes
messageStringOperation result message