Automatic Payment Application

Automate applying payments (and reconciling them to a bank deposit) from your processor against existing NetSuite invoices either by payment amount or a shared identifier.


This workflow is designed to eliminate customized integrations or manual payment application effort. Here are some examples where this workflow is helpful:

  • SalesForce and Docusign manages sales and initial payment, and NetSuite is used for A/R.
  • Invoices are created in NetSuite but paid through Stripe on a billing portal within your custom application
  • Payments are created in Stripe. Later on, invoices are created in NetSuite using a manual process (CSV import, etc).
  • Stripe handles subscription billing but invoices in NetSuite are created later on by a custom system.

In most cases, there is a disconnect between the system creating the Stripe charge and the process or system creating invoices in NetSuite. This "auto-match" workflow eliminates the need to coordinate or integrate these systems: one system can create a charge, another can create the invoice in NetSuite—SuiteSync manages applying the payment to the correct invoice.

Here’s how it works:

  1. The Stripe charge is brought over to NetSuite as an "unapplied" CustomerPayment
  2. A search is run for an open invoice that matches the payment. There are a couple ways payments can be matched:
    • If the Stripe charge has a customer record, an open invoice associated with the corresponding NetSuite customer with an "amount remaining" (plus/minus $0.05) is searched for. Customers can be matched automatically based on email or linked manually.
    • If you have a common ID or other identifier that can be passed to the Stripe charge and added to the NetSuite invoice, the integration will search for an open invoice with that custom identifier and apply the charge against that invoice.
  3. If a match is found, the CustomerPayment is applied against the matching invoice.
  4. If an invoice match is not found the search process repeats every hour for three days.
  5. If no match is found after three days, the CustomerPayment is added to a saved search that your billing team can use to manually apply the payment.
  6. Regardless of it a match is found, the payment is reconciled against a bank deposit and fees are calculated.
  7. If the charge is later refunded or disputed, the integration handles creating the required CreditMemo and CustomerRefund in NetSuite automatically.

Technical Overview

Matching on Common Identifier

Your system is responsible for:

  1. Adding a common identifier to the Stripe charge and the NetSuite Invoice
    • You can add your identifier to a field on the Stripe charge metadata. During the onboarding process, we'll configure your account to pull from that specific metadata field.
    • The integration can match on a standard or custom NetSuite field. Pushing your identifier to a custom field in NetSuite works great.
  2. If you expect to have a large number of unmatched invoices, it may be helpful to ensure that charges are created "under" a customer record in Stripe with the same email as the corresponding NetSuite customer. This ensures that if an invoice match cannot be found the payment will at minimum be applied to the correct NetSuite customer.

Matching on Payment Amount

Your system is responsible for:

  1. Ensuring the Stripe customer is linked to the same customer the NetSuite Invoice is created against. Here’s an example of how to link a Stripe customer to a NetSuite customer.
  2. Creating a Stripe charge with an amount that matches the total amount due. Note that a tolerance amount can be configured to enable payments to match if they are within a couple of cents of the amount due on an open NetSuite Invoice. Slight mismatches can often occur in more complex invoice structures where NetSuite rounds decimal numbers in an unexpected way.

View Example Implementation

What if the payment amount does not match the invoice amount due? What if I have multiple payments against a single invoice?

If the amount of the payment does not match the amount due on the invoice, SuiteSync will not automatically match the payment against the invoice. However, if a match is not found, the "auto apply" feature of NetSuite can be used to automatically apply the payment against the customer's open invoices.

Here are some use cases where this approach is helpful:

  1. A customer purchases and product and pays for the product with multiple payments (i.e. payment installments)
  2. A customer pre-orders a product or service and places a percentage deposit

Here's how this works:

  1. Create a customer in Stripe.
  2. Create a payment in Stripe with that customer. It's often helpful to add an identifier to payment that's unique to your system that can be pulled into a field on the NetSuite payment record.
  3. Separately, either before or after the above steps, create an Invoice in NetSuite. Ensure that the customer in NetSuite has the same email as the customer in Stripe (if that's not possible, you'll need to link the Stripe customer to NetSuite using metadata)
  4. The integration creates a CustomerPayment, and after it cannot find a match, it enables "auto apply" in NetSuite and tags the payment with a message indicating that an automatic match cannot be found.

If customers only have one open invoice at a time, this works perfectly. The payment is automatically applied against the invoice!

If customers have multiple open invoices, you should match on a custom identifier instead.

View Example Implementation

If you are looking to implement payment installments, you can use Stripe's subscriptions in combination with the undocumented max_occurrences parameter to automatically charge customers a certain number of times. Here's more information on this feature.

After a Match is Found

SuiteSync handles the rest:

  1. Pulling the charge over as an unapplied CustomerPayment
  2. Running a search every hour for an open invoice with an amount remaining (i.e. amount due) that matches the total unapplied amount of the CustomerPayment. Note that in most cases, the invoice total will match the amount remaining and the unapplied amount of a CustomerPayment will match the CustomerPayment total.
  3. Handling refunds or disputes created against the charge.
  4. Reconciling payments and refunds or disputes to the correct bank deposit
  5. Calculating processing fees, fee refunds, dispute fees, etc

Some other details to keep in mind:

  • The currency of the created invoice must match the currency of the Stripe charge
  • If there are multiple matches for a Stripe charge, the charge is not applied to any of the matched invoices.
  • If no match is found on the initial search, a match is searched for every hour for 3 days. If a match cannot be found during this retry period there is an optional feature to "auto apply" the invoice to any open invoices against the customer.
What happens if no match is found?

If no match is found, the auto-match operation is re-run every hour for the next three days.

After a three day period if no match is found, Stripe Error: no invoice match found is added to the memo of the CustomerPayment. Additionally, the CustomerPayment is added to a saved search that we'll add your to account. This saved search allows you to keep track of

If no match is found, there’s an optional feature available which enables "auto apply" on the CustomerPayment.

If a CustomerPayments is manually applied does the integration continue to search for a match?

No. As soon as the CustomerPayment is fully applied to one or more invoices SuiteSync will stop searching for matches.

Can I manually apply a portion of a CustomerPayment, and let SuiteSync auto-match the remaining unapplied amount?

Yes. The auto-match functionality looks at the unapplied amount of a CustomerPayment and the amount remaining amount on invoices to determine a match.

How are refunds and disputes handled?

If the charge is successfully linked to an invoice, both a CreditMemo and CustomerRefund are created to handle both the income and cash representation of the refund. Disputes function in a very similar way.

It’s also possible to initiate a refund from NetSuite, by creating a CreditMemo on the associated invoice or by creating a CustomerRefund applied directly against the CustomerPayment. This is an optional feature.

How can I find all unmatched payments?

A saved search is added to your NetSuite account which identifies any unmatched payments.

Note that payments only appear in this saved search after the three long days of searching tirelessly through the NetSuite database has passed. It's sad when an payment can't find it's home, but your finance team can used this saved search to make sure these unmatched payments aren't left out of the party.

Can payments be matched to a CashSale?

No. Since a CashSale represents a invoice and payment in a single record there is no way to represent a unmatched payment when a CashSale is used. Only invoices are supported.