The GUID in these calls should be obtained from Login API
Endpoint URL
Based URL address depends on domain address on which the backend is deployed
Method | URL |
---|---|
POST | {base url}/api/Document/SaveDocument |
Query parameters
Type | Params | Values |
---|---|---|
HEADER | Guid | {GUID obtained from login call} |
BODY | DocumentType | check document type below |
BODY | customerId/supplierId | depends on what type of document select supplier id or client id should be given |
BODY | incidentTypeId | id of the incident type |
BODY | workflowId | id of the workflow |
BODY | orderDate | Date of the order |
BODY | attachedFiles | array of the attachments |
BODY | detailLines | array of the detail lines |
BODY | lineType | line type of the line provided below |
BODY | glAccountId/inventoryItemId | AccountId if the line type is glAccount and inventoryItemId if line type is stk item |
BODY | description | description of the line |
BODY | price | price of the line |
BODY | quantity | quantity of the line |
BODY | taxId | tax id of the line |
Line type
GLAccount = 0 StkItem = 1
Document type
Purchase Order = 0 Cash Advance = 1 Expense Claim = 2 Return To Supplier = 3 Sales Order = 4 Credit Note = 7 Sales Order Quotation = 8
Example requests
https://backend/api/Document/SaveDocument
body call:
{
"documentType": 4,
"customerId": 5,
"delMethodId": 0,
"incidentTypeID": 7,
"workflowId": 5,
"orderDate": "2021-10-21T14:20:32.343Z",
"attachedFiles": [],
"detailLines": [
{
"lineType": 0,
"gLAccountId": 1187,
"description": "DC - Delivery charges",
"price": 1000,
"quantity": 1,
"confirmedQty": 1,
"taxId": 1,
"projectId": 1
}
]
}
Example responses:
{
"id": 656,
"message": "new document saved id = 656",
"orderNum": "SO0029"
}