Import Customer Payments from CSV and Apply Them to Invoices in NetSuite

Map a customer payment CSV into the Payment - Invoices sublist so each payment lands on its invoice, and fix the "Unable to find a matching line for sublist apply" error.

The quick answer

Go to Setup > Import/Export > Import CSV Records and choose Import Type Transactions and Record Type Customer Payment, with Data Handling Add. On Field Mapping, map the customer to Customer (Req) and, if your column holds internal IDs, set its reference type to Internal ID with the pencil. Then open Payment - Invoices in NetSuite Fields and map the invoice's internal ID to Invoice (Req) and the amount applied to Payment (Req). Those are the payment's Apply lines. Without them the payments import as unapplied cash and the invoices stay open. A row that fails with "Unable to find a matching line for sublist apply with key: [doc,line]" points at an invoice that isn't open on that payment's Apply list, most often because it's already paid.

The screenshots show sample data. Person and operating-company names are fictional. Use your own records and values when following the steps.

Before you start

You need a role that can import CSV records and create customer payments. You also need the internal ID of each invoice you want to pay. The invoice number, like INV-6021, isn't a reliable reference for the Invoice field, so export the internal IDs from an invoice saved search or list first. The same goes for the customer: a column of customer internal IDs works as long as you tell the Import Assistant that's what it is.

In this example, the customer Larkspur Dental Group (internal ID 2417) has three open invoices: INV-6021 for 1,180.00, INV-6034 for 642.50 and INV-6047 for 915.25, a balance of 2,737.75. An older invoice, INV-5988 for 486.30, was already paid on 09/10/2026 by PYMT3307. The bank's remittance for 09/17/2026 arrives as customer-payments-0917.csv with three payments, and the third one repeats the INV-5988 payment. Everything is in one subsidiary, US dollars, and one A/R account. Your form may require more fields, such as a payment method or posting period, and you'd map those too.

01. Check what the customer already paid

Go to Transactions > Customers > Accept Customer Payments > List. The Payments list has one payment for Larkspur Dental Group: PYMT3307, 486.30 on 09/10/2026, status Not Deposited.

Before the import, PYMT3307 for 486.30 is the customer's only payment.

Click View on PYMT3307. The Apply subtab shows it paid INV-5988 in full: Applied To 486.30.

PYMT3307 already paid INV-5988.

02. Check the open invoices

Go to Transactions > Customers > Accept Customer Payments and choose Larkspur Dental Group in Customer. Balance is 2,737.75.

Larkspur Dental Group owes 2,737.75 before the import.

Scroll to Apply > Invoices. Three invoices are open: INV-6021 for 1,180.00, INV-6034 for 642.50 and INV-6047 for 915.25. INV-5988 isn't listed, because it's paid in full. Leave the form without saving.

Three invoices are open. INV-5988 isn't one of them.

03. Review the payment file

Open customer-payments-0917.csv. Each row is one payment dated 09/17/2026 for customer 2417. External IDs LDG-0917-01 to LDG-0917-03 keep the payments apart. Invoice Internal ID names the invoice (9312, 9338 and 9274) and Applied Amount is what goes on it (1,180.00, 642.50 and 486.30). Line ID is 0 and Undep. Funds is T. Document Number and Customer Name are there for people to read.

Payment Amount is the whole payment. Applied Amount is the part of it that goes on that invoice. They match here because each payment pays one invoice in full. A payment that covers several invoices repeats its External ID on one row per invoice, and its applied amounts add up to no more than the payment amount.

The third row is a problem. It would create a new payment for invoice 9274, which is INV-5988, and PYMT3307 already paid that invoice.

The third row repeats the INV-5988 payment that's already recorded.

04. Start the import

Go to Setup > Import/Export > Import CSV Records. Choose Import Type Transactions and Record Type Customer Payment, click Select..., choose customer-payments-0917.csv and click Next.

Transactions, Customer Payment, and the payment file.

On Import Options, keep Data Handling on Add, because every row is a new payment, and click Next. Each distinct External ID in the file becomes one payment, and rows that share an External ID are grouped into one payment with several Apply lines. Don't reuse the External ID of a payment that already exists.

05. Fix the proposed mapping

Field Mapping proposes External ID, Handling Mode, Payment Amount and Date. Two rows need attention. Payment : Customer (Req) has no column yet. And Document Number is proposed for Payment : Payment #, which is the payment's own transaction number, so every payment would get an invoice's number.

Document Number was proposed for Payment #. Remove that row.

Click the × on the Payment # row to remove it and let NetSuite number the payments. If your account requires manually entered transaction numbers, map a column of unique payment numbers instead. Then click Customer Internal ID under Your Fields and Customer (Req) under NetSuite Fields. Customer starts on reference type Names, so NetSuite would read 2417 as a customer name. Click the pencil on the Customer row, set Choose Reference Type to Internal ID and click OK.

Set Customer to read the column as an internal ID.

06. Map the Apply lines

Map Undep. Funds to Undeposited Funds in the Payment fields. That's a checkbox, so T sends the payments to Undeposited Funds. To post straight to a bank account instead, use F and map Account too. If you have more than one A/R account, map A/R Account as well, and make it match the invoices'. Then open Payment - Invoices under NetSuite Fields. That group is the payment's Apply sublist. Map Invoice Internal ID to Invoice (Req). It's already on reference type Internal ID, and an empty Payment - Invoices : Payment (Req) row appears with it, because Invoice and Payment are both required once you map anything in that sublist. Map Applied Amount to Payment (Req) and Line ID to Line, then click Next.

Invoice, Payment and Line are mapped into Payment - Invoices.

Line is optional. When you supply it, it has to identify the invoice's A/R line, which is usually line 0. A wrong Line value causes the same matching-line error as a wrong invoice ID.

07. Run the import and read the error

Open the Save & Run menu, choose Run, then click Import Job Status. The job is Complete with 2 of 3 records imported successfully. The count is payments, not CSV rows.

The job imported two of the three payments.

Click CSV Response. The failed row is LDG-0917-03, with "Unable to find a matching line for sublist apply with key: [doc,line] and value: [9274,0]." The import looked for invoice 9274, line 0, on the new payment's Apply list and didn't find it, because INV-5988 is already paid. Nothing from that row was saved.

The failed row tried to pay invoice 9274, which is INV-5988, already paid by PYMT3307.

Here the row would pay INV-5988 a second time, so drop it from the file rather than import it again. If you get this error on an invoice that should be open, check whether the ID is mistyped, whether the Line value is wrong, and whether the payment's customer, subsidiary, currency or A/R account matches the invoice's. The payment date can also keep an invoice off the Apply list, and an applied amount larger than the amount due fails too. Fix the file and import only that payment's rows.

08. Confirm the invoices were paid

Go back to Transactions > Customers > Accept Customer Payments > List. Two new payments are dated 09/17/2026: PYMT3308 for 1,180.00 and PYMT3309 for 642.50. Both are Not Deposited because they went to Undeposited Funds. PYMT3307 hasn't changed.

PYMT3308 and PYMT3309 came from the import.

Click View on PYMT3308. Apply shows INV-6021, Applied To 1,180.00.

PYMT3308 landed on INV-6021.
Balance is 915.25, down from 2,737.75.

Check the result

  1. Import Job Status reports 2 of 3 records imported successfully, and the CSV Response lists only LDG-0917-03.
  2. Each new payment's Apply subtab shows the invoice named in its row.
  3. The customer's Balance dropped by 1,822.50, the two imported payments, to 915.25 in this example.
  4. Apply > Invoices lists only INV-6047.

Open Accept Customer Payments for Larkspur Dental Group again and scroll to Apply > Invoices. Only INV-6047 is left, with Amt. Due 915.25.

INV-6047 is the only invoice still open.

Payments in Undeposited Funds still have to go on a bank deposit through your normal deposit process.

Common questions

What does "Unable to find a matching line for sublist apply with key: [doc,line]" mean?

NetSuite couldn't find the invoice and line from your file on the new payment's Apply list. The values after "value:" are the invoice internal ID and the line, here [9274,0]. The usual cause is an invoice that's already paid, like INV-5988 in this example. A mistyped ID, a wrong Line value, or a customer, subsidiary, currency or A/R account that doesn't match the invoice causes it too.

Should I use the invoice number or the internal ID?

Use the internal ID, or the invoice's external ID if your invoices have one. Map it to Payment - Invoices : Invoice (Req), which starts on reference type Internal ID. The invoice number, like INV-6021, can stay in the file for people to read, but don't map it to Payment #.

Why did my imported payments stay unapplied?

Either the Apply lines weren't mapped, or the payment amount is bigger than what was applied. If nothing is mapped into Payment - Invoices, each payment comes in with no invoices on it. The customer's balance still drops, but the invoices stay open. If Payment Amount is higher than the applied total, the difference stays unapplied. Open the payment and check Applied and Unapplied in its Summary.

Can one payment pay several invoices?

Yes. Give it one row per invoice and repeat the same External ID and payment fields on each row, with a different invoice internal ID and applied amount on each. The import groups those rows into one payment. The applied amounts shouldn't add up to more than the payment amount, and each one has to fit within its invoice's amount due.

Can I post the payments to a bank account instead of Undeposited Funds?

Yes. Set Undeposited Funds to F and map Account to the bank account. Use T, like this example, when the money still has to go on a bank deposit.

Can I apply credit memos or take discounts in the same import?

NetSuite Fields has a Payment - Credits sublist for credits, and Payment - Invoices has a Disc. Taken field for discounts. This example didn't use either, so test them on a small file first.