It allows you:
to insert new vendor invoices (master document)
to update existing invoices
for update it is necessary to provide all the updatable fields in JSON even if the value is not changed. The missing fields will get their value removed!
to process existent vendor invoices (Change Document Action: Prepare, Complete, Void etc)
Prerequisites:
In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:
to have an Organization active
to have a Vendor active with all the mandatory fields
to have a price list active
Columns that can be used as filters:
Organization
OrderNo
OrderReference
DocumentNo
BPartner
IsPaid
DateInvoiced
Actions can be done:
list_full
create
create_full
update
Vendor Invoice fields (Master)
An Invoice in SocrateCloud has the following structure:
Master document which contains data about header document:
No. document
Invoice date
Vendor
Representative
OrderNo (only used in create methods)
User1_ID
User1 (Name)
PriceList (Name)
PaymentTerm (Name)
FixedDate
DueDate
etc.
Document details which contains the products that are invoiced with informations about:
Product
Quantity
Price
VAT
User1_ID
User1 (Name)
OrderLine_ID (only used in create methods)
InOutLine_ID (only used in create methods)
etc.
List Full:
URL: https://api.socratecloud.com/webapi/rest/invoiceVendor/full/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"data": [
{
"Organization": "DEMO SRL",
"Created": "2023-05-01 09:52:13+0000",
"CreatedBy": "Admin",
"Updated": "2023-05-01 09:52:13+0000",
"UpdatedBy": "Admin",
"DocumentNo": "1000797",
"OrderNo": null,
"OrderReference": null,
"Description": null,
"DocType": "** New **",
"DateInvoiced": "2023-05-01 00:00:00+0000",
"BPartner": "FT1",
"BPartnerName": "FURNIZOR TEST 1",
"Location": "AFRIMESTI",
"Contact": "Contact Furnizor Test",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BankAccount": null,
"PaymentMethod": "On Credit",
"TotalLines": 440,
"GrandTotal": 523.6,
"TrxOrganization_ID": 1005354,
"TrxOrganizationValue": "SERVICE",
"TrxOrganization": "SERVICE",
"Project_ID": 1016474,
"ProjectValue": "HC002",
"Project": "HC002",
"ProjectPhase_ID": 1008789,
"ProjectPhase": "faza_B",
"ProjectTask_ID": 1002893,
"ProjectTask": "subfaza_4",
"Activity_ID": 1000475,
"ActivityValue": "Testare",
"Activity": "Testare",
"Campaign_ID": 1000685,
"CampaignValue": "1000001",
"Campaign": "Campanie testare DEV",
"Asset_ID": 1016210,
"AssetValue": "INV00020",
"Asset": "Auto 1000020",
"User1_ID": 0,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"DocumentStatus": "Drafted",
"DocumentAction": "Complete",
"PaymentMode": "OP",
"PriceList": "Test Price List",
"PaymentTerm": "23 zile",
"FixedDate": true,
"DueDate": "2023-05-24 00:00:00+0000",
"lines": [
{
"Created": "2023-05-01 09:52:24+0000",
"CreatedBy": "Admin",
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"Charge": null,
"Description": null,
"QtyEntered": 4,
"UOM": "Each",
"ListPrice": 180,
"Discount": 38.89,
"PriceEntered": 110,
"LineNetAmt": 440,
"LineTotalAmt": 523.6,
"TaxAmt": 83.6,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1005353,
"TrxOrganizationValue": "VNZ",
"TrxOrganization": "VNZ",
"Project_ID": 1016475,
"ProjectValue": "HC003",
"Project": "HC003",
"ProjectPhase_ID": 1008790,
"ProjectPhase": "A",
"ProjectTask_ID": 1002895,
"ProjectTask": "subf_1",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1000482,
"CampaignValue": "1000000",
"Campaign": "Campanie testare API",
"Asset_ID": 0,
"AssetValue": null,
"Asset": null,
"User1_ID": 0,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"Resource_ID": 1000690,
"ResourceValue": "R1",
"ResourceName": "Resursa test 1",
"OrderLine_ID": "12345",
"InOutLine_ID": "54321"
}
]
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/invoiceVendor/full/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "DEMO SRL",
"OrderNo": null,
"OrderReference": null,
"Description": null,
"DocType": "AP Invoice",
"DateInvoiced": "2023-05-01 00:00:00+0000",
"BPartner": "FT1",
"BPartnerName": "FURNIZOR TEST 1",
"Location": "AFRIMESTI",
"Contact": "Contact Furnizor Test",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BankAccount": null,
"PaymentMethod": "On Credit",
"TrxOrganization_ID": 1005354,
"TrxOrganizationValue": "SERVICE",
"TrxOrganization": "SERVICE",
"Project_ID": 1016474,
"ProjectValue": "HC002",
"Project": "HC002",
"ProjectPhase_ID": 1008789,
"ProjectPhase": "faza_B",
"ProjectTask_ID": 1002893,
"ProjectTask": "subfaza_4",
"Activity_ID": 1000475,
"ActivityValue": "Testare",
"Activity": "Testare",
"Campaign_ID": 1000685,
"CampaignValue": "1000001",
"Campaign": "Campanie testare DEV",
"Asset_ID": 1016210,
"AssetValue": "INV00020",
"Asset": "Auto 1000020",
"User1_ID": null,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"DocumentStatus": "Drafted",
"DocumentAction": "Complete",
"PaymentMode": "OP",
"PriceList": "Test Price List",
"PaymentTerm": "Test Payment Term",
"FixedDate": true,
"DueDate": "2023-05-24 00:00:00+0000",
"lines": [
{
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"Charge": null,
"Description": null,
"QtyEntered": 4,
"UOM": "Each",
"ListPrice": 180,
"Discount": 38.89,
"PriceEntered": 110,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1005353,
"TrxOrganizationValue": "VNZ",
"TrxOrganization": "VNZ",
"Project_ID": 1016475,
"ProjectValue": "HC003",
"Project": "HC003",
"ProjectPhase_ID": 1008790,
"ProjectPhase": "A",
"ProjectTask_ID": 1002895,
"ProjectTask": "subf_1",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1000482,
"CampaignValue": "1000000",
"Campaign": "Campanie testare API",
"Asset_ID": null,
"AssetValue": null,
"Asset": null,
"User1_ID": null,
"User1": null,
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"Resource_ID": 1000690,
"ResourceValue": "R1",
"ResourceName": "Resursa test 1",
"OrderLine_ID": "12345",
"InOutLine_ID": "54321"
}
]
}
URL: https://api.socratecloud.com/webapi/rest/invoiceVendor/create/{version}?accessToken={access_token}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "DEMO SRL",
"OrderNo": null,
"OrderReference": null,
"Description": null,
"DocType": "AP Invoice",
"DateInvoiced": "2023-05-01 00:00:00+0000",
"BPartner": "FT1",
"Location": "AFRIMESTI",
"Contact": "Contact Furnizor Test",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BankAccount": null,
"PaymentMethod": "On Credit",
"TrxOrganizationValue": "SERVICE",
"ProjectValue": "HC002",
"ProjectPhase": "faza_B",
"ProjectTask": "subfaza_4",
"ActivityValue": "Testare",
"CampaignValue": "1000001",
"AssetValue": "INV00020",
"User1": null,
"Employee": "ANGAJAT DEMO 1",
"DocumentStatus": "Drafted",
"DocumentAction": null,
"PaymentMode": "OP",
"PriceList": "Test Price List",
"PaymentTerm": "Test Payment Term",
"FixedDate": true,
"DueDate": "2023-05-24 00:00:00+0000"
}
URL: https://api.socratecloud.com/webapi/rest/invoiceVendor/update/{version}?accessToken={access_token}&DocumentNo={document_no}
Method: POST
Return: document no for success or error message (start with "ERROR: ")
Data format:
{
"Organization": "DEMO SRL", // NOT UPDATABLE !!! (business logic reason)
"OrderNo": null, // NOT UPDATABLE !!!
"OrderReference": null,
"Description": null,
"DocType": "AP Invoice",
"DateInvoiced": "2023-05-02 00:00:00+0000",
"BPartner": "FT1", // NOT UPDATABLE !!! (business logic reason)
"Location": "AFRIMESTI",
"Contact": "Contact Furnizor Test 2",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BankAccount": null,
"PaymentMethod": "On Credit",
"TrxOrganizationValue": "VANZARI",
"ProjectValue": "HC003",
"ProjectPhase": "faza_C",
"ProjectTask": "subfaza_1",
"ActivityValue": "Cercetare",
"Campaign": "Campanie cercetare",
"AssetValue": "INV00022",
"User1": null,
"Employee": "ANGAJAT DEMO 2",
"DocumentAction": null,
"PaymentMode": "OP",
"PriceList": "Test Price List",
"PaymentTerm": "Test Payment Term",
"FixedDate": true,
"DueDate": "2023-05-24 00:00:00+0000"
}
Note: If you don't transmit a field, then the value of that field will be deleted!! (except of not updatable fields) !!!
URL: https://api.socratecloud.com/webapi/rest/invoiceVendor/process/{version}?accessToken={access_token}&DocumentNo={document_no}&DocumentAction={document_action}
Method: POST
Optional parameters:
VoidReason - Void reason name as defined in SocrateCloud. Applicable only for DocumentAction = 'Void' or 'Reverse - Correct'.
Return: Document status for success or error message (start with "ERROR: ")