It allows you:
to view and to print your invoices - ordered descending by created date and document date, using the print format associated to document type (file type: pdf)
to insert new customer invoices (master and details document)
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 an Role active
Columns that can be used as filters:
LastModified (UTC time format ISO 8601: yyyy-MM-dd HH:mm:ss Z from C_Invoice). The sign used for comparison is ”>” (exclusive). Use this filter to get all the invoices modified after the date/time value sent in this parameter.
eg: LastModified=2014-06-13 12:40:00 +0300 if you are in Romania or LastModified=2014-06-13%2012:40:00%20%2b0300
Organization
OrderNo
OrderReference
DocumentNo
BillBPartner
IsPaid
DateInvoiced
TrackingNo
Created
Updated
Actions can be done:
list
create
update
print invoices
Customer Invoice fields (Master and Details)
An Invoice in SocrateCloud has the following structure:
Master document which contains data about header document:
No. document
Invoice date
Customer
Sales Representative etc.
Document details which contains the products that are invoiced with informations about:
Product
Quantity
Selling price
VAT
URL: https://api.socratecloud.com/webapi/rest/invoice/full/list/{version}?startRow={0}&endRow={100}&accessToken={access_token}
Method: GET
Return: JSON object with next format:
{
"data": [
{
"Organization": "DEMO SRL",
"Created": "2024-01-25 10:10:16+0000",
"CreatedBy": "DEMO_User",
"Updated": "2024-01-25 10:13:45+0000",
"UpdatedBy": "DEMO_User",
"DocumentNo": "1001563",
"OrderNo": "COC 100937",
"OrderReference": "CT1_11002233",
"Description": "Some description",
"DocType": "AR Invoice",
"DateInvoiced": "2024-01-25 00:00:00+0000",
"FixedDate": false,
"DueDate": "2024-02-09 00:00:00+0000",
"BillBPartner": "CT1",
"BillBPartnerName": "CLIENT TEST 1",
"BillLocation": "Sediu_contabilitate",
"BillContact": "contact CT1",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BillBPartnerSR": "AD1",
"BillBankAccount": null,
"PriceList": "Vanzare RON",
"DateRegistered": null,
"PaymentTerm": "15 days",
"MeanOfConveyance": null,
"MeanOfConveyanceName": null,
"MOCSalesRepName": null,
"MOCSalesRepDescription": null,
"TrxOrganization_ID": 1008004,
"TrxOrganizationValue": "DEMO",
"TrxOrganization": "DEMO SRL",
"Project_ID": 1013885,
"ProjectValue": "Acc_9",
"Project": "Accesorii_9",
"ProjectPhase_ID": 1007155,
"ProjectPhase": "I",
"ProjectTask_ID": 1001687,
"ProjectTask": "A",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1001199,
"CampaignValue": "BF2023",
"Campaign": "Campanie BlackFriday 2023",
"Asset_ID": 1005114,
"AssetValue": "1000005",
"Asset": "LIVRABIL DEMO",
"User1_ID": 1053571,
"User1": "Productie",
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"IsSelfService": false,
"PaymentMethod": "On Credit",
"TotalLines": 500,
"GrandTotal": 595,
"DocumentStatus": "Completed",
"DocumentAction": "Close",
"PaymentMode": "OP",
"ReceiptNo": 1,
"AMEF": 1,
"TrackingNo": null,
"lines": [
{
"Created": "2024-01-25 10:10:16+0000",
"CreatedBy": "DEMO_User",
"InvoiceNo": null,
"Invoice_ID": null,
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"ProductCustomerCode": null,
"Charge": null,
"Description": "Some detail description",
"QtyEntered": 5,
"UOM": "Each",
"ListPrice": 100,
"Discount": 0,
"PriceEntered": 100,
"LineNetAmt": 500,
"LineTotalAmt": 595,
"TaxAmt": 95,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1008004,
"TrxOrganizationValue": "DEMO",
"TrxOrganization": "DEMO SRL",
"Project_ID": 1013885,
"ProjectValue": "Acc_9",
"Project": "Accesorii_9",
"ProjectPhase_ID": 1007155,
"ProjectPhase": "I",
"ProjectTask_ID": 1001687,
"ProjectTask": "A",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1001199,
"CampaignValue": "BF2023",
"Campaign": "Campanie BlackFriday 2023",
"Asset_ID": 1005114,
"AssetValue": "1000005",
"Asset": "LIVRABIL DEMO",
"User1_ID": 1053571,
"User1": "Productie",
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 2",
"Resource_ID": 1000690,
"ResourceValue": "R1",
"ResourceName": "Resursa test 1",
"OrderNo": "COC 100937",
"DateInvoiced": null,
"Currency": null,
"OrderLine": 10,
"OrderLine_ID": 1611662,
"InOutLine_ID": 1164468
}
]
}
],
"totalRows": 1
}
URL: https://api.socratecloud.com/webapi/rest/invoice/full/create/{version}?accessToken={access_token}
Method: POST
Return: JSON object with next format:
If through this 'full/create' method, there are also lines that contain SGR Guarantees, then:
- these lines containing Guarantees must be linked to the lines containing Basic Articles. In order to link the line with the SGR Guarantee to the line with the Basic Article (goods), on the line with the Guarantee, the value "RelatedProductSGR" must be specified (this is the 'Basic Article Code for SGR') and optionally the value "RelatedLineSGR" (this is the 'Line Number Basic Article for SGR').
- in this case, for lines containing Basic Articles, will no longer automatically generate from Socrate Cloud: lines containing SGR Guarantees.
{
"Organization": "DEMO SRL",
"OrderNo": "COC 100937",
"Order_ID": 1565377,
"OrderReference": "CT1_11002233",
"Description": "Some description",
"DocType": "AR Invoice",
"DateInvoiced": "2024-01-25 00:00:00+0000",
"FixedDate": false,
"DueDate": "2024-02-09 00:00:00+0000",
"BillBPartner": "CT1",
"BillBPartnerName": "CLIENT TEST 1",
"BillLocation": "Sediu_contabilitate",
"BillContact": "contact CT1",
"Currency": "RON",
"SalesRep": "ANGAJAT DEMO 1",
"BillBPartnerSR": "1000022",
"BillBankAccount": null,
"PriceList": "Vanzare RON",
"DateRegistered": null,
"PaymentTerm": "15 days",
"MeanOfConveyance": null,
"MeanOfConveyanceName": null,
"MOCSalesRepName": null,
"MOCSalesRepDescription": null,
"TrxOrganization_ID": 1008004,
"TrxOrganizationValue": "DEMO",
"TrxOrganization": "DEMO SRL",
"Project_ID": 1013885,
"ProjectValue": "Acc_9",
"Project": "Accesorii_9",
"ProjectPhase_ID": 1007155,
"ProjectPhase": "I",
"ProjectTask_ID": 1001687,
"ProjectTask": "A",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1001199,
"CampaignValue": "BF2023",
"Campaign": "Campanie BlackFriday 2023",
"Asset_ID": 1005114,
"AssetValue": "1000005",
"Asset": "LIVRABIL DEMO",
"User1_ID": 1053571,
"User1": "Productie",
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 1",
"IsSelfService": false,
"PaymentMethod": "On Credit",
"TotalLines": 500,
"GrandTotal": 595,
"DocumentAction": "Complete",
"PaymentMode": "OP",
"ReceiptNo": 1,
"AMEF": 1,
"TrackingNo": null,
"lines": [
{
"Line": 10,
"Product": "001",
"ProductName": "PRODUCT 1",
"ProductCustomerCode": null,
"Charge": null,
"Description": "Some detail description",
"QtyEntered": 5,
"UOM": "Each",
"ListPrice": 100,
"Discount": 0,
"PriceEntered": 100,
"LineNetAmt": 500,
"LineTotalAmt": 595,
"TaxAmt": 95,
"Tax": "19%",
"Printed": null,
"TrxOrganization_ID": 1008004,
"TrxOrganizationValue": "DEMO",
"TrxOrganization": "DEMO SRL",
"Project_ID": 1013885,
"ProjectValue": "Acc_9",
"Project": "Accesorii_9",
"ProjectPhase_ID": 1007155,
"ProjectPhase": "I",
"ProjectTask_ID": 1001687,
"ProjectTask": "A",
"Activity_ID": 1000161,
"ActivityValue": "1000000",
"Activity": "Interventie TEST 1",
"Campaign_ID": 1001199,
"CampaignValue": "BF2023",
"Campaign": "Campanie BlackFriday 2023",
"Asset_ID": 1005114,
"AssetValue": "1000005",
"Asset": "LIVRABIL DEMO",
"User1_ID": 1053571,
"User1": "Productie",
"Employee_ID": 1043712,
"Employee": "ANGAJAT DEMO 2",
"Resource_ID": 1000690,
"ResourceValue": "R1",
"ResourceName": "Resursa test 1",
"OrderNo": "COC 100937",
"DateInvoiced": null,
"Currency": null,
"OrderLine": 10,
"OrderLine_ID": 1611662,
"RelatedProductSGR": null,
"RelatedLineSGR": null
},
{
"Line": 20,
"Product": "SGR Guarantee",
"ProductName": null,
"ProductCustomerCode": null,
"Charge": null,
"Description": null,
"QtyEntered": 5,
"UOM": "Each",
"ListPrice": 0.5,
"Discount": 0,
"PriceEntered": 0.5,
"LineNetAmt": 2.5,
"LineTotalAmt": 2.5,
"TaxAmt": 0,
"Tax": "Neimpozabil",
"Printed": null,
"TrxOrganization_ID": 12345,
"TrxOrganizationValue": "DEMO",
"TrxOrganization": "DEMO SRL",
"Project_ID": null,
"ProjectValue": null,
"Project": null,
"ProjectPhase_ID": null,
"ProjectPhase": null,
"ProjectTask_ID": null,
"ProjectTask": null,
"Activity_ID": null,
"ActivityValue": null,
"Activity": null,
"Campaign_ID": null,
"CampaignValue": null,
"Campaign": null,
"Asset_ID": null,
"AssetValue": null,
"Asset": null,
"User1_ID": null,
"User1": null,
"Employee_ID": null,
"Employee": null,
"Resource_ID": null,
"ResourceValue": null,
"ResourceName": null,
"OrderNo": null,
"DateInvoiced": null,
"Currency": null,
"OrderLine": null,
"OrderLine_ID": null,
"RelatedProductSGR": "001",
"RelatedLineSGR": 10
}
]
}
Note: If parameters Order_ID and OrderLine_ID are specified when the Invoice is completed (DocumentAction = Complete), the associations between Invoice lines and Shipment lines (Matched Shipments) will automatically be generated .
URL: https://api.socratecloud.com/webapi/rest/invoice/print/{version}?accessToken={access_token}&DocumentNo={document_no}&Language=ro_RO
Method: GET
Return: PDF file
The ”Language” parameter is optional. This will be used to indicate the language for resulted document, in case of Business Partner that have not set the default language, otherwise this parameter will be ignored.