intacct / intacct-sdk-js

Official repository of the Sage Intacct SDK for JavaScript in Node.js
https://developer.intacct.com/tools/sdk-node-js/
Apache License 2.0
22 stars 31 forks source link

Trouble applying credits to payment #119

Open dovigoldstein opened 1 year ago

dovigoldstein commented 1 year ago

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

joeyparis commented 3 weeks ago

Did you ever find a solution to this? I'm running into the same issue

dovigoldstein commented 3 weeks ago

No. I ended using the regular API. https://developer.intacct.com/api/accounts-payable/ap-payments/#create-ap-payment