Create (POST) Invoice
Use this API to create an invoice in the Transaction Center.
To create an invoice:
Execute a POST command on the endpoint
{{url}}/ledger/{{TransType}} by setting the variable
TransType to IN and specifying the transaction data for that invoice in the request body.
For example, here is a request submitted using cURL:
curl
--request POST \
--url 'https://{{url}}/ledger/IN' \
--header 'authorization: Bearer {{oauth_token}}' \
--header 'content-type: application/json' \
--data '{
"Batch": "PSA-API-INBatch01",
"Recurring": "Y",
"Posted": "N",
"Creator": "ADMIN",
"Period": "201305",
"EndDate": "2013-05-26T00:00:00.000",
"Total": "0",
"RetTotal": "0",
"DefaultTaxCode": "",
"PostPeriod": "0",
"PostSeq": "0",
"Company": "0A",
"inMaster": [
{
"Batch": "PSA-API-INBatch01",
"Invoice": "000000000DDD",
"WBS1": "PROJCUBE.010",
"WBS2": "",
"WBS3": "",
"TransDate": "2013-05-26T00:00:00.000",
"TransComment": "PSA API Posting",
"Posted": "N",
"Seq": "0",
"CurrencyExchangeOverrideMethod": "N",
"CurrencyExchangeOverrideDate": "2013-05-26T00:00:00.000",
"CurrencyExchangeOverrideRate": "0"
}
],
"inDetail": [
{
"Batch": "PSA-API-INBatch01",
"Invoice": "000000000DDD",
"WBS1": "PROJCUBE.010",
"WBS2": "",
"WBS3": "",
"PKey": "LOCKBOX00001",
"Seq": "1",
"InvoiceSection": "T",
"Account": "21200",
"Amount": "12.34",
"RetAmount": "0.0",
"TaxCode": "",
"TaxBasis": "0.0",
"Retainer": "N",
"LinkWBS1": "",
"LinkWBS2": "",
"LinkWBS3": ""
},
{
"Batch": "PSA-API-INBatch01",
"Invoice": "000000000DDD",
"WBS1": "PROJCUBE.010",
"WBS2": "",
"WBS3": "",
"PKey": "LOCKBOX00002",
"Seq": "2",
"InvoiceSection": "A",
"Account": "40100",
"Amount": "100.99",
"RetAmount": "0.0",
"TaxCode": "",
"TaxBasis": "0.0",
"Retainer": "N",
"LinkWBS1": "",
"LinkWBS2": "",
"LinkWBS3": ""
}
]
}'
A successful POST returns the JSON representation of the newly created invoice.
