Note |
---|
When inserting data that in the end will result in an account payable, you might want to post the invoice directly. This can be done with a couple of API calls.
...
To generate invoice lines post the below request, where key is the voyage key. For multiple voyages, add multiple keys.
Code Block |
---|
POST /ws/rest/Document/refreshDocumentLines?key=123&key=456&isAccountsPayable=true Body: empty |
...
Code Block |
---|
POST /ws/rest/Document/assemble
Header: disablebl = true
{
"bankAccount": "bankAccountNo",
"businessPartner": "businessPartnerCode",
"documentCurrency": "USD",
"documentDate": "2022-02-23T00:00:00",
"documentLines": [{ "key": 111 }, { "key": 222 }],
"documentPaymentTerms": [
{
"baselineDate": "2022-02-23T00:00:00",
"baselineTerm": "baselineTermCode",
"dueDate": "2022-03-02T00:00:00",
"paymentTerms": "paymentTermsCode",
"percentage": 100
}
],
"documentText": "A document text",
"exchangeRate": 1,
"exchangeRateDate": "2022-02-23T09:28:26",
"externalDocumentNo": "1234",
"issuingCompany": "companyCode",
"invoicingStatus" : "INV"
} |
Mandatory fields: documentText, documentDate, issuingCompany, invoicingStatus, bankAccount, baseLineDate, baseLineTerms, dueDate, paymentTerms and percentage.
If payment terms percentage is 100%, there should only be one entry in documentPaymentTerms
BaseLineTerm is customer specific and needs to be agreed with customer. The baseline terms can be found at /ws/rest/BaselineTerm
PaymentTerms is customer specific and needs to be agreed with customer. The payment terms can be found at /ws/rest/PaymentTerms
...