More Info
I was able to Post a Vendor Payment w/ the following request and get back a response for the new payment
Request:
{
"journalId": "journalId from Get vendorPaymentJournals",
"journalDisplayName": "journal Name from Get vendorPaymentJournals",
"vendorId": "vendor GUID from get vendor API",
"vendorNumber": "vendor Number accessible in Dynamics UI or vendor API",
"postingDate": "2022-05-25",
"documentNumber": "testing documentNo",
"amount": 1.00,
"description": "testing description",
"comment": "testing comment"
}
Response:
{
"@odata.context": "api.businesscentral.dynamics.com/.../$metadata
"@odata.etag": "W/\"xyz......\"",
"id": "New Payment GUID",
"journalId": "journalId from Get vendorPaymentJournals",
"journalDisplayName": "journal Name from Get vendorPaymentJournals",
"vendorId": "vendor GUID from get vendor API",
"vendorNumber": "vendor Number accessible in Dynamics UI or vendor API",
"lineNumber": 50000,
"postingDate": "2022-05-25",
"documentNumber": "TESTING DOCUMENTNO",
"externalDocumentNumber": "",
"amount": 1,
"appliesToInvoiceId": "00000000-0000-0000-0000-000000000000",
"appliesToInvoiceNumber": "",
"description": "testing description",
"comment": "testing comment",
"lastModifiedDateTime": "2022-05-25T17:55:48.337Z"
}
If I use the "New Payment GUID" that is returned in the response in a GET API vendorPayments(New Payment GUID) then I get the same response as above - which is expected.
If I use the "journalId from Get vendorPaymentJournals" in a GET API vendorPayments(journalId from Get vendorPaymentJournals) then I get the error
{
"error": {
"code": "BadRequest_ResourceNotFound",
"message": "Resource not found for the segment 'vendorPayments'. CorrelationId: 5f2d67bb-3573-40eb-96d6-ae7a12c7680d."
}
}
if you call vendorPayments by itself you get an error saying you need to specify a journal Batch Id or Payment Id
{
"error": {
"code": "Application_DialogException",
"message": "You must specify a journal batch ID or a journal ID to get a journal line. CorrelationId: 0f751013-422a-4773-9f99-22e751f00816."
}
}
So based on that is seems you should be able to specify a journal batch ID but that doesn't seem to be the case.
Help Docs on vendorPayment
docs.microsoft.com/.../dynamics_vendorpayment_get