Creating Order Object

Creating the Order Object

  • Order object must be in JSON format. The order contains basic information, the products included in the order and some information about these products. Each parameter is explained separately below.

Parameters

Order Parameters

ParameterDescriptionType
CustomerNameName of the user who placed the orderstring
CustomerSurnameLast name of the user who placed the orderstring
CustomerIdID of the user registered to your system, otherwise leave blankstring
CustomerPhonePhone number of the user who placed the orderstring
CustomerPhone22nd phone number of the user who placed the orderstring
AddressThe address of the user who placed the orderstring
AddressDescriptionAddress description of the user who placed the orderstring
RegionDistrict-district information of the user who placed the orderstring
cityCity information of the user who placed the orderstring
PaymentMethodIdPayment type informationint
PaymentNotePayment notestring
DiscountTotal discount amount in the orderint
OrderNoteOrder notestring
WebOrderIdOrder ID in your own systemstring
OrderTotalOrder Total Amountint
ParentIdID of the main productint
ParameterDescriptionTypeRequired?
QuantityQuantity of the product in the orderintYes
NameName of the product in the orderstringYes
ProductUnitIdID of the unit in the orderintYes
ProductCodeProduct code in the orderstringNo
OrderDetailNoteProduct notestringNo
FeaturesFeature list of the product in the orderList<Object>No
IsMenuIndicates if the product in the order is a menubooleanNo
MenuIdMenu ID of the product in the orderintNo
ParentIdID of the main product in the orderstringNo

Usage of MenuId and ParentId

A product's MenuId and ParentId values should not be the same. If a product in the order is included under a different menu, it should have its own ParentId value. Otherwise, ParentId should not be sent or should be specified as null.

Example Usage

  • Products with Menu

    • Hamburger is a menu, so it has its own MenuId value.
    • Cola is included under the Hamburger Menu, so its ParentId value should be the same as the Hamburger's MenuId.
Products with Menu
[
    {
        "Quantity": 1,
        "ProductUnitId": 123,
        "IsMenu": true,
        "MenuId": 1,
        "ParentId": null
    },
    {
        "Quantity": 1,
        "ProductUnitId": 234,
        "IsMenu": false,
        "MenuId": null,
        "ParentId": 1
    }
]
  • Independent Products

    • If Cola is not linked to any menu, the ParentId parameter should not be sent.
Independent Products
[
    {
        "Quantity": 1,
        "ProductUnitId": 123,
        "IsMenu": false,
        "MenuId": null,
        "ParentId": null
    },
    {
        "Quantity": 1,
        "ProductUnitId": 234,
        "IsMenu": false,
        "MenuId": null,
        "ParentId": null
    }
]

Example Order Object

Example Order Object
{
    "CustomerName": "Christian",
    "CustomerSurname": "Luyindama",
    "CustomerId": "44545",
    "CustomerPhone": "5554443444",
    "CustomerPhone2": "5554443441",
    "Address": "Adres bilgisi...",
    "AddressDescription": "Adres tarif",
    "Region": "Ataşehir",
    "City": "İstanbul",
    "PaymentMethodId": 3,
    "PaymentNote": "temassız çalışmıyorr",
    "Discount": 20,
    "OrderNote": "ıslak mendil getirin",
    "WebOrderId": "746364",
    "OrderTotal": "20.00",
    "OrderDetails": [
            {
                "Quantity": 1,
                "ProductCode": null,
                "Name": "Efsane Menu",
                "OrderDetailNote": null,
                "IsMenu": true,
                "ProductUnitId": 7324219,
                "MenuId": 1
            },
            {
                "Quantity": 1,
                "ProductCode": null,
                "Name": "Cheeseburger",
                "OrderDetailNote": null,
                "IsMenu": false,
                "ProductUnitId": 7324216,
                "ParentId": "1"
            },
            {
                "Quantity": 1,
                "ProductCode": null,
                "Name": "Kola",
                "OrderDetailNote": null,
                "IsMenu": false,
                "ProductUnitId": 7324245,
                "ParentId": "1"
            },
            {
                "Quantity": 1,
                "ProductCode": null,
                "Name": "Brownie",
                "OrderDetailNote": null,
                "IsMenu": false,
                "ProductUnitId": 7324214
            }
        ]
}