Create (POST) AP Voucher
Use this API to create an AP voucher.
To create an AP voucher:
Execute a POST command on the endpoint
{{url}}/ledger/{{TransType}}, by setting the variable
TransType to AP and specifying the transaction data for that voucher in the request body.
For example, here is a request submitted using cURL:
curl
--request POST \
--url 'https://{{url}}/Ledger/AP' \
--header 'authorization: Bearer {{oauth_token}}' \
--header 'content-type: application/json' \
--data '{
"Batch": "PSA-API-APBatch01",
"Recurring": "Y",
"Posted": "N",
"Creator": "ADMIN",
"Period": "201305",
"EndDate": "2017-05-26T00:00:00.000",
"Total": "0",
"DefaultLiab": "",
"DefaultBank": "",
"DefaultDate": "2017-05-26T00:00:00.000",
"PostPeriod": "0",
"PostSeq": "0",
"Company": "0A",
"DefaultCurrencyCode": "USD",
"apControlDefaultTaxCodes": [
{
"Batch": "PSA-API-APBatch01",
"TaxCode": "Y15",
"Seq": "1"
},
{
"Batch": "PSA-API-APBatch01",
"TaxCode": "AGS",
"Seq": "2"
},
{
"Batch": "PSA-API-APBatch01",
"TaxCode": "AE&",
"Seq": "3"
},
{
"Batch": "PSA-API-APBatch01",
"TaxCode": "PERC10",
"Seq": "4"
},
{
"Batch": "PSA-API-APBatch01",
"TaxCode": "PERC6",
"Seq": "5"
}
],
"apMaster": [
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"Vendor": "AMASSACH.SU",
"InvoiceDate": "2017-05-25T00:00:00.000",
"Invoice": "PSA12001",
"TransDate": "2017-05-26T00:00:00.000",
"LiabCode": "Atrade",
"BankCode": "USD4USD",
"PayTerms": "Date",
"PayDate": "2013-09-24T00:00:00.000",
"Address": "<Default>",
"Posted": "N",
"Seq": "2",
"Voucher": "00000DDPP001",
"CurrencyCode": "BHD",
"CurrencyExchangeOverrideMethod": "N",
"CurrencyExchangeOverrideRate": "0",
"BarCode": "",
"PaymentExchangeOverrideMethod": "N",
"PaymentExchangeOverrideRate": "0",
"PaymentCurrencyCode": "BHD",
"Status": "N"
}
],
"apDetail": [
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey1",
"Seq": "1",
"Description": "",
"WBS1": "0A900000.US0",
"WBS2": "A000",
"WBS3": "",
"Account": "51200",
"Amount": "560.00",
"SuppressBill": "N",
"NetAmount": "500.0",
"CurrencyExchangeOverrideRate": "0",
"PONumber": "",
"PaymentExchangeRate": "0",
"PaymentAmount": "560.00",
"PaymentExchangeInfo": "",
"ExpenseCode": "",
"OriginatingVendor": ""
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey2",
"Seq": "2",
"Description": "",
"WBS1": "0A199900.400",
"WBS2": "",
"WBS3": "",
"Account": "52311",
"Amount": "1300.12",
"SuppressBill": "N",
"NetAmount": "1000.0",
"CurrencyExchangeOverrideRate": "0",
"PONumber": "",
"PaymentExchangeRate": "0",
"PaymentAmount": "1300.12",
"PaymentExchangeInfo": "",
"ExpenseCode": "",
"OriginatingVendor": ""
}
],
"apDetailTax": [
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey1",
"TaxCode": "LOW3HIGH12",
"TaxAmount": "15",
"CompoundOnTaxCode": "",
"Seq": "1"
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey1",
"TaxCode": "Y15",
"TaxAmount": "15",
"CompoundOnTaxCode": "Y11",
"Seq": "2"
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey1",
"TaxCode": "AGS",
"TaxAmount": "30",
"CompoundOnTaxCode": "AHI",
"Seq": "3"
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey2",
"TaxCode": "Y15",
"TaxAmount": "25",
"CompoundOnTaxCode": "Y11",
"Seq": "1"
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey2",
"TaxCode": "AE&",
"TaxAmount": "75",
"CompoundOnTaxCode": "AGS",
"Seq": "2"
},
{
"Batch": "PSA-API-APBatch01",
"MasterPKey": "PSAAPIMasterPKey1",
"PKey": "PSAAPIPKey2",
"TaxCode": "LOW4HIGH11",
"TaxAmount": "100",
"CompoundOnTaxCode": "",
"Seq": "3"
},
{
"Batch": "PSA-API-APBatch01",
"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 voucher.
