10.2 Expense Report Detail

Interface

It allows you:

  • to insert new lines (one by one) into an existing expense report

  • to update or delete expense report lines (one by one)

  • to view expense report lines

Prerequisites:

In order to use this API Method for PUT there must be accomplished the following requirements in SocrateCloud:

    • to have an open Expense Report (document status: Draft)

  • to have products active with all the mandatory fields

  • the products selected must have prices defined in the Price List selected on the Expense Report (master)

Columns that can be used as filters:

  • DocumentNo (from Expense Report Master)

  • Line

  • Product

  • UserName

  • TimeExpense_ID (from Expense Report Master)

  • Language (eg: ”ro_RO”, ”en_EN”, ”bg_BG” etc) - if null or unprovided, then English is the base language for product name.

Mandatory Parameters when inserting lines:

    • DocumentNo (from Expense Report Master)

Actions can be done:

  • list

  • insert

  • update

  • delete

Expense Report line fields

API Methods:

List:

URL: https://api.socratecloud.com/webapi/rest/expense_report/line/list/0?startRow={0}&endRow={100}&accessToken={access_token}&DocumentNo={document_no}

Method: GET

Available filter parameters:

  • DocumentNo

  • Line

  • Product

  • UserName

  • TimeExpense_ID

  • Language

Return: JSON object with next format:

{

"data": [

{

"Organization": "Demo SRL",

"Created": "2014-07-01 14:22:45+0300",

"CreatedBy": "BIT-Ionut",

"Updated": "2014-07-01 14:23:15+0300",

"UpdatedBy": "BIT-Ionut",

"Active": true,

"TimeExpenseLine_ID": 1000001,

"Line": 10,

"DateExpense": "2014-07-01 00:00:00+0300",

"SourceDocNo": "1000001",

"Product": "001PLTML20",

"SKU": "Testing",

"Product_ID": 1000378,

"ProductName": "BlueT",

"Description": "BLAH BLAH",

"QtyEntered": 1,

"UOM": "Each",

"Price": 1000,

"Amount": 1000,

"BPartner": null,

"BPartnerName": null,

"BPartner_ID": null,

"User_ID": null,

"UserName": null,

"VendorName": "ABC SRL",

"TaxID": "RO8288282",

"IsTimeReport": false,

"IsInvoiced": false,

"Project": null,

"Project_ID": null,

"ProjectPhase": null,

"ProjectPhase_ID": null,

"ProjectSubPhase": null,

"ProjectSubPhase_ID": null,

"Activity": null,

"TrxOrganization": null,

"Asset_ID": null,

"AssetValue": null,

"Summary": null,

"InvoicePrice": 0

}

],

"totalRows": 1

}

Create:

URL: https://api.socratecloud.com/webapi/rest/expense_report/line/create/0?accessToken={access_token}&DocumentNo={document_no}

Method: POST

Return: line no for success or error message (start with "ERROR: ")

Data format:

{

"Organization":"Demo SRL",

"Active":true,

"DateExpense":"2014-08-20 00:00:00+0300",

"SourceDocNo":"1000042",

"Product":"Prod1",

"Description":null,

"QtyEntered":5,

"Price":null,

"BPartner":null,

"VendorName":null,

"TaxID":null,

"IsTimeReport":false,

"IsInvoiced":false,

"Project":"Test",

"ProjectPhase":null,

"ProjectSubPhase":null,

"Activity":null,

"InvoicePrice":100

}

Update:

URL: https://api.socratecloud.com/webapi/rest/expense_report/line/update/0?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}

Method: POST

Return: line no for success or error message (start with "ERROR: ")

Data format:

{

"Organization":"Demo SRL",

"Active":true,

"DateExpense":"2014-08-20 00:00:00+0300",

"SourceDocNo":"1000042",

"Product":"Prod1",

"Description":null,

"QtyEntered":5,

"Price":null,

"BPartner":null,

"VendorName":null,

"TaxID":null,

"IsTimeReport":false,

"IsInvoiced":false,

"Project":"Test",

"ProjectPhase":null,

"ProjectSubPhase":null,

"Activity":null,

"InvoicePrice":100

}

Delete:

URL: https://api.socratecloud.com/webapi/rest/expense_report/line/delete/0?accessToken={access_token}&DocumentNo={document_no}&Line={line_no}

Method: POST

Return: 'Deleted' for success or error message (start with "ERROR: ")