It allows you:
to list lines from an existing Customer Invoice (filtered by InvoiceNo and/or OrderNo)
to insert new lines (one by one) into an existing Customer Invoice
to update, delete sales order lines (one by one)
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an open Customer Invoice (document status: Draft, In Progress)
to have products active with all the mandatory fields
the products selected onCustomer Invoice must have prices defined in the Price List selected on the Customer Invoice
Columns that can be used as filters:
DocumentNo (invoice number)
OrderNo
Line
Project (Value)
ProjectPhase (Name)
ProjectTask (Name)
Currency (ISO Code)
DateInvoiced (DateTime)
Product (Value)
ProductName (Name)
Mandatory Parameters when inserting invoice lines:
InvoiceNo
Mandatory Parameters when listing invoice lines:
DocumentNo or OrderNo (at least one of them)
Actions can be done:
insert
update
delete
Customer Invoice line fields
URL: https://api.socratecloud.com/webapi/rest/invoice/line/list/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Created": "2023-05-01 08:50:33+0000",
"CreatedBy": "Admin",
"InvoiceNo": null,
"Invoice_ID": null,
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"ProductCustomerCode": null,
"Charge": null,
"Description": "some description",
"QtyEntered": 3,
"UOM": "Each",
"ListPrice": 100,
"Discount": 0,
"PriceEntered": 100,
"LineNetAmt": 300,
"LineTotalAmt": 357,
"TaxAmt": 57,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1005353,
"TrxOrganizationValue": "VNZ",
"TrxOrganization": "VNZ",
"Project_ID": 1022150,
"ProjectValue": "BC001",
"Project": "BC001",
"ProjectPhase_ID": 1014569,
"ProjectPhase": "B",
"ProjectTask_ID": 1004910,
"ProjectTask": "sub_2",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1000482,
"CampaignValue": "1000000",
"Campaign": "Campanie testare API",
"Asset_ID": 1010657,
"AssetValue": "1000014",
"Asset": "Imobilizare test MAXI",
"User1_ID": 0,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"Resource_ID": 0,
"ResourceValue": null,
"ResourceName": null,
"OrderNo": null,
"DateInvoiced": null,
"Currency": null,
"OrderLine": 0,
"OrderLine_ID": 1234567,
"InOutLine_ID": null
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/invoice/line/create/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: line no for success or error message (start with "ERROR: ")
Data format:
{
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"ProductCustomerCode": null,
"Charge": null,
"Description": "some description",
"QtyEntered": 3,
"UOM": "Each",
"ListPrice": 100,
"Discount": 0,
"PriceEntered": 100,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1005353,
"TrxOrganizationValue": "VNZ",
"TrxOrganization": "VNZ",
"Project_ID": 1022150,
"ProjectValue": "BC001",
"Project": "BC001",
"ProjectPhase_ID": 1014569,
"ProjectPhase": "B",
"ProjectTask_ID": 1004910,
"ProjectTask": "sub_2",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1000482,
"CampaignValue": "1000000",
"Campaign": "Campanie testare API",
"Asset_ID": 1010657,
"AssetValue": "1000014",
"Asset": "Imobilizare test MAXI",
"User1_ID": null,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"Resource_ID": null,
"ResourceValue": null,
"ResourceName": null,
"OrderLine_ID": 1234567,
"InOutLine_ID": null
}
URL: https://api.socratecloud.com/webapi/rest/invoice/line/update/{version}?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}
Method: POST
Return: line no for success or error message (start with "ERROR: ")
Data format:
{
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"ProductCustomerCode": null,
"Charge": null,
"Description": "some description",
"QtyEntered": 3,
"UOM": "Each",
"ListPrice": 100,
"Discount": 0,
"PriceEntered": 110,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1005353,
"TrxOrganizationValue": "VNZ",
"TrxOrganization": "VNZ",
"Project_ID": 1022150,
"ProjectValue": "BC001",
"Project": "BC001",
"ProjectPhase_ID": 1014569,
"ProjectPhase": "B",
"ProjectTask_ID": 1004910,
"ProjectTask": "sub_2",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1000482,
"CampaignValue": "1000000",
"Campaign": "Campanie testare API",
"Asset_ID": 1010657,
"AssetValue": "1000014",
"Asset": "Imobilizare test MAXI",
"User1_ID": null,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"Resource_ID": null,
"ResourceValue": null,
"ResourceName": null
}
URL: https://api.socratecloud.com/webapi/rest/invoice/line/delete/{version}?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}
Method: POST
Return: 'Deleted' for success or error message (start with "ERROR: ")