Order Add

Add order and order rows.

URL : /api/v1/xorder

Method : POST

Auth required : Key-Value pairs on Header

Example : https://demo.calybra.com/api/v1/xorder

Request

Body request example

   {
    "Number": 10,                                               //optional: if omitted self incremented
    "Date": "2022-10-06T00:00:00",                              //optional: if omitted today
    "CompanyId": "f1490524-9499-45c7-a823-31606731ae52",        //optional: can be used alternatively to CompanyCode (if both omitted use MyCompanyId)
    "CompanyCode": "TMP403",                                    //optional: can be used alternatively to CompanyId (if both omitted use MyCompanyId)
    "Notes": "",                                                //optional
    "InternalNotes": "",                                        //optional
    "RequestedDeliveryDate": "2022-10-07T00:00:00",             //optional: if omitted today 
    "PlannedDate": "2022-10-07T00:00:00",                       //optional: if omitted equal to RequestedDeliveryDate
    "CreateMissingItems": false,                                //optional: default false, if true items will be created from row information
    "PlanPreparation": false,                                   //optional: default false, if true all recipes will be planned in realtime in Calybra scales
    "Rows": [
        {
            "RowNumber": 1,                                     //optional: if omitted self incremented
            "ItemCode": "P100",
            "Description": "Filone Integrale 1 kg",             //optional: if omitted retrieved from items or ** NO DESCRIPTION **
            "Quantity": 15.000,                                 //requested
            "Price": 0.00000,                                   //optional: zero if omitted
            "Discount": 0.000,                                  //optional: zero if omitted
            "MeasureUnitId": "n",                               //ValidMeasureUnits = { "g", "kg", "n", "l" }; "l" => Liters
            "Notes": "note riga 1 di test"                      //optional: can be a keyvalue pairs like "Batch:123aa,Id:12345" => if Batch is provided will be used to plan preparations
        },
        {
            "RowNumber": 2,
            "ItemCode": "P101",
            "Description": "Filone Bianco e Patate 1 kg",       
            "Quantity": 15.000,
            "Price": 0.00000,
            "Discount": 0.000,
            "MeasureUnitId": "n",
            "Notes": "note riga 1 di test"
        }
    ],
    "OrderTypeId": "975a16f4-25a6-4c9f-900f-e75d1bb963fe",      //optional: can be used alternatively to OrderTypeDescription (if both omitted take First OrdType.CustomerOrder)
    "OrderTypeDescription": "Ordine Cliente"                    //optional: can be used alternatively to OrderTypeId (if both omitted take First OrdType.CustomerOrder)
}

Success Response

Code : 200 OK

Content example

{
    "OrderId": "02116ec1-3e33-45fe-be38-7970dfa2f74b",
    "Number": 10,
    "Date": "2022-10-06T00:00:00",
    "CompanyId": "f1490524-9499-45c7-a823-31606731ae52",
    "CompanyCode": "TMP403",
    "Notes": null,
    "InternalNotes": null,
    "RequestedDeliveryDate": "2022-10-07T00:00:00",
    "Rows": [
        {
            "RowNumber": 1,
            "ItemCode": "P100",
            "Description": "Filone Integrale 1 kg",
            "Quantity": 15.000,
            "Price": 0.00000,
            "Discount": 0.000,
            "MeasureUnitId": "n",
            "Notes": "note riga 1 di test",
            "ItemId": "6255ebbd-8bbf-4857-8a8e-3ca9258270cd",
            "PlannedDate": null
        },
        {
            "RowNumber": 2,
            "ItemCode": "P101",
            "Description": "Filone Bianco e Patate 1 kg",
            "Quantity": 15.000,
            "Price": 0.00000,
            "Discount": 0.000,
            "MeasureUnitId": "n",
            "Notes": "note riga 1 di test",
            "ItemId": "8ba4e22a-7a0a-4b74-814d-105d2145b699",
            "PlannedDate": null
        }
    ],
    "OrderTypeId": "975a16f4-25a6-4c9f-900f-e75d1bb963fe",
    "OrderTypeDescription": "Ordine Cliente",
    "Messages": null,
    "OrderState": "Received"
}

Copyright © 2017-2018. All right reserved