intacct-sdk-js
intacct-sdk-js copied to clipboard
Trouble applying credits to payment
I can't seem to be able to find a way to apply a credit to a payment or payment details.
Given the below payment:
let createPayment = new Intacct.Functions.AccountsPayable.ApPaymentCreate({
paymentMethod: 'Printed Check',
paymentDate: '05/20/2023',
transactionCurrency: 'USD',
vendorId: 'TestVendorId',
financialEntityId: 'BankId',
groupPayments: true,
apPaymentDetails: [
new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
recordNo: 8999,
lineRecordNo: 2321,
paymentAmount: 100,
}),
new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
recordNo: 8999,
lineRecordNo: 2322,
paymentAmount: 50,
}),
],
}, 'controlid');
I've tried adding the credit to apPaymentDetails
:
apPaymentDetails: [
new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
recordNo: 8999,
lineRecordNo: 2321,
paymentAmount: 100,
}),
new Intacct.Functions.AccountsPayable.ApPaymentDetailBill({
recordNo: 8999,
lineRecordNo: 2322,
paymentAmount: 50,
}),
new Intacct.Functions.AccountsPayable.ApPaymentDetailCreditMemo ({
recordNo: 562,
lineRecordNo: 121212,
paymentAmount: -50,
}),
],
Which produces the following error: Oops, we can't find this transaction; enter a valid 562 key, then try again.
I've also tried adding detailTransaction
to the APPaymentDetailBill, but it's ignored.
Any help would be appreciated