Document Add

Add document and document rows.

URL : /api/v1/xdocument

Method : POST

Auth required : Key-Value pairs on Header

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

Request

Body request example

   {
    "Number": 10,                                               //optional: if null, string empty or "AUTO" take it from document numerators
    "Date": "2022-10-06T00:00:00",                              
    "CompanyId": "c7a1092a-f106-4439-93b7-7c370d6a05bd",        //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
    "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
    "Rows": [
        {
            "RowNumber": 1,                                     //optional: if omitted self incremented
            "ItemCode": "P100",                                 //if no match with items will cause a notification
            "ItemSupplierCode": null,                           //free for external use
            "Description": "Filone Integrale 1 kg",             //optional: if omitted retrieved from items or ** NO DESCRIPTION **
            "Quantity": 15.000,                                 //requested
            "Batch": "L231010",                                 //requested
            "BatchDueDate": "2023-10-07T00:00:00,               //optional: null if omitted
            "Price": 2.20000,                                   //optional: zero if omitted
            "Discount": 0.000,                                  //optional: zero if omitted
            "MeasureUnitId": "n",                               //ValidMeasureUnits = { "g", "kg", "n", "l" }; "l" => Liters
            "VatPercentage": 10.000,                                
            "Ingredient": null,                                 //optional: description of the product (ingredient) to be automatically assigned only if item WILL BE CREATED
            "Notes": "note riga 1 di test"
        }
    ],
    "DocumentTypeId": "9e55170b-2cc1-4095-91dc-6e51ae30f195",   //optional: can be used alternatively to DocumentTypeDescription (if both omitted take First DocType.DeliveryDocument)
    "DocumentTypeDescription": "Delivery Document"              //optional: can be used alternatively to DocumentTypeId (if both omitted take First DocType.DeliveryDocument)
}

Success Response

Code : 200 OK

Content example

{
    "DocumentId": "35a12853-3f21-446c-af30-aeaa3171652e",
    "Number": 10,
    "Date": "2023-04-19T00:00:00",
    "CompanyId": "c7a1092a-f106-4439-93b7-7c370d6a05bd",
    "CompanyCode": null,
    "CompanyName": "Customer 1 ltd",
    "Notes": null,
    "InternalNotes": null,
    "Rows": [
        {
            "RowNumber": 1,
            "ItemCode": "P100",
            "ItemSupplierCode": null,
            "Description": "Filone Integrale 1 kg",
            "Quantity": 15,
            "MeasureUnitId": "n",
            "Batch": "L231010",
            "BatchDueDate": "2023-10-07T00:00:00",
            "Price": 2.20000,
            "Discount": 0.000,
            "VatPercentage": 10.000,
            "Notes": "note riga 1 di test",
            "Ingredient": null,
            "ProductId": "247dc67c-7094-42bd-ab95-87d7cafc2d32",
            "ItemId": "5ab332c0-ffca-41ab-9698-eb420a57b57a"
        }
    ],
    "DocumentTypeId": "9e55170b-2cc1-4095-91dc-6e51ae30f195",
    "DocumentTypeDescription": "Delivery Document"
}

Copyright © 2017-2018. All right reserved