Create Customer Payment via REST API with Invoices applied
I am creating a series of payments via API and for each of them, I want to be able to apply invoice(s) in the apply sublist. I am using a POST to /record/v1/customerpayment with a body that contains a set of fields that work on their own, but when I include an object for the “apply” field with an array of one “items” I get an error:
“Error while accessing a resource. You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.”
For reference, here is the block that I have included that triggers the failure:
“apply”: {
“items”: [
{
“apply”: true,
“amount”: 4391,
“doc”: {
“id”: “39659”
}
}
]
}
I have checked that the invoice refNum of 39659 is one of the options that appears as open on the referenced customer. Is there something obvious I am doing wrong? I am following a similar approach that a user in this thread has stated works for them:
https://netsuiteprofessionals.com/question/how-can-i-batch-invoices-into-customer-payments-using-the-rest-api/ – using ‘doc’ to reference an invoice, but I can’t seem to get that to work. Thanks!




netsuitegregg
Were you able to get this working? We have been stuck on this for months now (same error).
mattgarriga
Hi! My colleague and I ran into this issue this week. We were able to get around this issue by ensuring the ‘aracct’ field is in the Invoice payload and that same account is used on the ‘account’ field in the Customer Payment payload. Once we ensured those were present, all worked great for us!
arod861230
hello i have the same problem