Create (POST) Employee Expense
Use this API to create an employee expense in the Transaction Center.
To create an employee expense:
Execute a POST command on the endpoint
{{url}}/ledger/{{TransType}}, specifying the transaction data for that employee expense in the request body.
For example, here is a request submitted using cURL:
curl --request POST \ --url 'https://{{url}}/ledger/EX' \ --header 'authorization: Bearer {{oauth_token}}' \ --header 'content-type: application/json' \ --data '{ "Batch": "PSA-API-EXBatch01", "Recurring": "Y", "Posted": "N", "Creator": "ADMIN", "Period": "201305", "EndDate": "2013-05-26T00:00:00.000", "Total": "0", "PostPeriod": "0", "PostSeq": "0", "Company": "0A", "DefaultCurrencyCode": "USD", "Diary": "", "exControlDefaultTaxCodes": [ { "Batch": "PSA-API-EXBatch01", "TaxCode": "Y15", "Seq": "1" }, { "Batch": "PSA-API-EXBatch01", "TaxCode": "AGS", "Seq": "2" }, { "Batch": "PSA-API-EXBatch01", "TaxCode": "AE&", "Seq": "3" }, { "Batch": "PSA-API-EXBatch01", "TaxCode": "PERC10", "Seq": "4" }, { "Batch": "PSA-API-EXBatch01", "TaxCode": "PERC6", "Seq": "5" } ], "exMaster": [ { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "Employee": "000A0301", "ReportDate": "2013-05-25T00:00:00.000", "ReportName": "PSA Report 1", "Posted": "N", "Seq": "2", "AdvanceAmount": "0", "BarCode": "", "DefaultCurrencyCode": "BHD", "PaymentExchangeOverrideMethod": "N", "PaymentExchangeOverrideRate": "0", "CurrencyExchangeOverrideMethod": "N", "CurrencyExchangeOverrideRate": "0" } ], "exDetail": [ { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey1", "Seq": "1", "TransDate": "2013-05-22T00:00:00.000", "WBS1": "0A900000.US0", "WBS2": "A000", "WBS3": "", "Account": "51200", "Amount": "560.00", "Description": "", "SuppressBill": "N", "NetAmount": "500.0", "PaymentExchangeRate": "0", "PaymentAmount": "560.00", "PaymentExchangeInfo": "", "CurrencyExchangeOverrideRate": "0", "CurrencyCode": "USD", "OriginatingVendor": "" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey2", "Seq": "2", "TransDate": "2013-05-21T00:00:00.000", "WBS1": "0A199900.400", "WBS2": "", "WBS3": "", "Account": "52311", "Amount": "1300.12", "Description": "", "SuppressBill": "N", "NetAmount": "1000.0", "PaymentExchangeRate": "0", "PaymentAmount": "1300.12", "PaymentExchangeInfo": "", "CurrencyExchangeOverrideRate": "0", "CurrencyCode": "USD", "OriginatingVendor": "" } ], "exDetailTax": [ { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey1", "TaxCode": "LOW3HIGH12", "TaxAmount": "15", "CompoundOnTaxCode": "", "Seq": "1" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey1", "TaxCode": "Y15", "TaxAmount": "15", "CompoundOnTaxCode": "Y11", "Seq": "2" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey1", "TaxCode": "AGS", "TaxAmount": "30", "CompoundOnTaxCode": "AHI", "Seq": "3" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey2", "TaxCode": "Y15", "TaxAmount": "25", "CompoundOnTaxCode": "Y11", "Seq": "1" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey2", "TaxCode": "AE&", "TaxAmount": "75", "CompoundOnTaxCode": "AGS", "Seq": "2" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey2", "TaxCode": "LOW4HIGH11", "TaxAmount": "100", "CompoundOnTaxCode": "", "Seq": "3" }, { "Batch": "PSA-API-EXBatch01", "MasterPKey": "PSAAPIMasterPKey1", "PKey": "PSAAPIPKey2", "TaxCode": "Y11", "TaxAmount": "100.12", "CompoundOnTaxCode": "NY_TAX", "Seq": "4" } ] }'
A successful POST returns the JSON representation of the newly created employee expense.