RyzeDeskRyzeDesk

Stripe

4105 articles

Set up the NetSuite Auto Pay workflow


Set up the NetSuite Auto Pay workflow

Learn how to configure the Auto Pay and Triggered Payments workflows in the Stripe Connector for NetSuite (SCN).

Warning

If you’re migrating from SuiteSync to the Stripe Connector for NetSuite, use the migration instructions.

The Stripe Connector Add-ons bundle in NetSuite supports both the Auto Pay and Triggered Payments workflows using the same components. When you use the Stripe Connector Add-ons bundle ID 502910, the bundle’s saved search looks for NetSuite invoices and sales orders that meet your criteria. The bundle’s SuiteScript uses the Stripe API to automatically capture charges in Stripe for the NetSuite transactions. SCN then creates a customer payment applied to an invoice or a customer deposit related to a sales order. These workflows provide a high level of configurability, including the ability to schedule the script to run as frequently as every 15 minutes.

Triggered Payments use cases

Triggered Payments is a form of auto-charging based on events that happen for specific record types. You must add a Stripe customer ID or a payment_method ID to a specific field on the Stripe subtab. Bundle ID 502910 adds both IDs to invoice, sales order, and customer records. The workflow then captures a Stripe charge with the default payment method on the Customer object. Alternatively, the charge will be captured with the most recently added payment method, or with the payment method specified by the Stripe Payment Method ID field in NetSuite. SCN supports any payment method type that’s eligible for auto-charges.

The Triggered Payments workflow captures charges on a schedule based on your criteria that identifies triggers for specific record types.

It uses the following components:

  • Installation and configuration of the NetSuite Auto Pay workflow in the Stripe Connector Add-ons bundle ID 502910 .
  • Custom fields that the Add-ons bundle automatically adds to customer, sales order, and invoice record types.

The following Triggered Payments workflows are available in your account.

Workflow nameWorkflow description
Create charge from customer reference on invoiceA customer payment is created and applied to a NetSuite invoice when you add a Stripe customer ID to the Stripe Customer ID field of the invoice record on the Stripe subtab.
Create Charge from Customer Reference on Sales OrderA customer deposit is created and related to a NetSuite sales order when you add a Stripe customer ID to the Stripe Customer ID field of the sales order record on the Stripe subtab.
Create a charge from Card Reference on an InvoiceA customer payment is created and applied to a NetSuite invoice when you add a Stripe customer ID to the Stripe Payment Method ID field of the invoice record on the Stripe subtab.
Create a Charge from Card Reference on a Sales OrderA customer deposit is created and related to a NetSuite sales order when you add a Stripe payment method ID to the Stripe Payment Method ID field of the sales order record on the Stripe subtab.

Set up the Triggered Payments workflows

To set up these workflows, follow the Auto Pay workflow instructions below. Then configure your saved search to identify the record types and fields necessary to trigger automatic charges when you add Stripe object IDs for your use case.

Invoice and sales order Auto Pay use cases

The SCN App lets you use sales orders and invoices in the Auto Pay workflow.

Traditionally, invoice autopay use cases involve recurring billing, such as a monthly subscription. Many users also use invoice autopay for one-time invoices, where the customer agrees to be charged using their saved payment method when an invoice is due. This use case is common for service or custom manufacturing businesses.

SCN makes sales order autopay scenarios available, which follow a similar use case. When you create a sales order that meets the saved search criteria you select, a customer’s saved payment method is charged for the amount due on the sales order. This creates a customer deposit that’s related to the sales order. When the sales order is billed, native NetSuite functionality creates an invoice and applies the customer deposit to the invoice as a Deposit Application record.

The instructions below explain how to configure the saved search to pick up sales orders and invoices. The script automatically creates the correct payment record type, and applies or relates it to the transaction it was triggered by.

Note

Partial customer deposits related to sales orders are allowed, but require the Payment Linker workflow if any balance remains on the sales order. If you require assistance with discovery or implementation, contact Stripe Support.

Configure the Auto Pay saved search and script deployment

Installing the Add-ons bundle automatically creates a Stripe Custom Center tab in the colored bar on any NetSuite page. If you don’t see it, click the overflow menu (), which might also be hidden behind floating NetSuite elements. Bundle installation is specific to the NetSuite sandbox or production account you’re working in.

  1. Hover over the Stripe tab in the colored bar on any NetSuite page.
  2. Go to Stripe > Add-ons > Manage Add-ons.
  3. On the subtabs bar, click Stripe Add-ons.
  4. On either the Inactive or Active subtab, locate Auto-Pay.
  5. In the Auto-Pay row, click Show More and read the technical feature description.
  6. Open the saved search template by clicking the Stripe Add-on Auto-Pay Template link.
  7. Under Criteria, edit the Type and Status values based on the record types you want the workflow to act on for your use case: invoice or sales order and the appropriate statuses. If you include invoices in your search, you must have the Due Date field present in the criteria. If you include sales orders in your search, you must have the End Date field present in the criteria. Use the default value of is on or before today for both fields. You can change the value if, for example, you want auto pay to run one day after the due date of each invoice. Warning You must have the NetSuite feature Allow Non-G/L Changes enabled globally in your NetSuite account to prevent unwanted duplicate charges. If you’ve already created accounting periods before enabling the setting, you must also set it on each existing accounting period.
  8. (Optional) Add criteria lines for your use case.
  9. (Optional) If you use the Triggered Payments workflow, add criteria so the saved search finds invoice or sales order records with the value populated in the Stripe Customer ID or Stripe Payment Method ID custom fields.
  10. Don’t delete the following criteria rows from the template, which are required for the feature to function correctly:
  • Main Line: true
  • Stripe Payment ID (Custom Body): is empty
  • Memo: does not contain Stripe Add-on Error
  1. Change the name of the template to something you’ll remember, and then click Save As. Note If you have more than one use case that uses the Auto Pay script, you can add all criteria to the same saved search. The script runs on all records that meet the search criteria, on the same schedule. Alternatively, you can copy the script deployment record used in the following steps (using the same Auto Pay script) and configure a unique saved search, schedule, and Stripe account for each script deployment.
  2. Go back to Stripe > Add-ons > Manage Add-ons.
  3. On the subtabs bar, click Stripe Add-ons.
  4. On either the Inactive or Active subtab, locate Auto-Pay.
  5. In the Auto-Pay row, click View.
  6. On the Script Deployment page, click Edit.
  7. Configure the Schedule subtab as needed. For most use cases, set the script frequency to once per day to minimize processing load in your NetSuite account. You might want to set it to run more frequently if your use case triggers payments to happen in near real time. The script can run as frequently as every 15 minutes, daily. To use this option, you must also configure the Start Time to 12:00 AM (00:00). If you configure a different time, the script only runs every 15 minutes starting at that time, until the end of the specific day at 11:45 PM (23:45). You can also set the schedule to Single Event, which you can use for testing or manually running one-time batches.
  8. On the Parameters subtab, set the Auto-Pay Invoice Search to the newly named saved search you created.
  9. Set the Stripe Account if you want to use one Stripe account when the script deployment runs. Otherwise, you can leave this blank. You see this dropdown on the following records: NetSuite account, Script Deployment page, subsidiary records, customer records, and transaction records. Select the record type in the hierarchy to associate it with the Stripe account. If needed, you can edit the other record to configure the Stripe account. Note The dropdown lists all the available Stripe account custom records that you created during the Stripe Connector Add-ons bundle installation. You can create additional Stripe account records in a separate browser tab.
  10. If you’re deploying to NetSuite production, clear the Test Mode checkbox. This sets the value to false.
  11. Click Save if you don’t want to deploy the script now. Otherwise, continue to the next step.

Additional requirements and enhancements

These workflows require the following prerequisites to function:

A Stripe customer with a saved payment method

In your Stripe account in live mode, you must have a Stripe customer with an existing saved payment method for all NetSuite customers that will have the Auto Pay or Triggered Payments workflows acting on transactions.

Save payment methods

The SCN App includes a feature to save the payment method from payment pages to the Stripe Customer object for future use. To enable this feature, go to SCN’s App Settings > Payments > Save payment method to Stripe customers and use the toggle to enable it. Native payment pages find a matching Stripe customer or create a new customer.

The Stripe Connector for NetSuite supports creating saved payment methods on Stripe customers with a Stripe Element or plugin during payment or during an onboarding process.

Search for payment methods

The SCN App searches for the default payment method on each customer using the following:

  1. Fallback logic : The Auto Pay script searches for a default payment method. If none exist on the Stripe Customer object, the script uses the most recently added payment method.
  2. Manual configuration of a payment method : Installing bundle ID 502910 adds the Stripe subtab and a Stripe Payment Method ID field to the invoice, sales order, and customer records. The Triggered Payments workflow uses this field on invoice and sales order records. The Auto Pay workflow can also use this field to specify the payment method on a Stripe customer to use for a NetSuite customer record. Use this when your NetSuite customers have a parent-child relationship, which isn’t directly supported by the Stripe Customer object.

Before the Auto Pay script runs, your Stripe Customer objects must have metadata that links to the corresponding NetSuite customer record. Without metadata, the script can’t find the Stripe customer and corresponding Stripe payment method. You can add the metadata through metadata mapping or payment pages automation, which the SCN app supports. SCN also supports a third method using the Stripe Customer ID field on the NetSuite customer record.

This feature is always enabled, but triggers only if you add the appropriate metadata. A script or workflow in your environment can add the following metadata to the Stripe customer that identifies the NetSuite customer: netsuite_customer_id: (internal id number as the value).

When looking for the Stripe customer, the Auto Pay script can find a match if the correct metadata is present and link it to the NetSuite customer in the SCN database. The current transaction and all future transactions use this match.

The SCN App provides invoice, sales order, and customer payment pages that automatically run a customer linking workflow when individual payment pages are opened.

  1. We search the SCN database for a NetSuite customer that’s already linked to a Stripe customer. If we find a match, we use the customer and associated payment methods.
  2. If we don’t find a database link, we search all Stripe customers in the account for netsuite _ customer _ id metadata that shows the internal ID of the NetSuite customer. If we find a match, we create a link in the SCN database and use the customer and associated payment methods.
  3. If we don’t find a Stripe customer match, we create a new Stripe customer, add the required metadata, and link it in the SCN database. These actions happen when opening the payment page, before adding the payment method.
  4. Adding a payment method and clicking Pay on the payment page saves the payment method to the Stripe Customer object.

Stripe Customer ID field in NetSuite

The Add-ons bundle provides another option for linking NetSuite and Stripe customers. If you have an existing Stripe customer for the corresponding NetSuite customer, you can add the Stripe customer ID ( cus_id) to the Stripe Customer ID field on the NetSuite customer record.

If the Auto Pay script can’t find a previously linked Stripe customer, it searches the Stripe Customer ID field on the NetSuite customer. If the script finds a valid Stripe customer ID, the script does the following automatically:

  1. The script adds the netsuite _ customer _ id metadata to the corresponding Stripe Customer object with the correct internal ID of the NetSuite customer.
  2. The script uses the Stripe customer, and triggers SCN to link the Stripe customer to the NetSuite customer in its database.

Use this option if you don’t want to write a script that calls the Stripe API. To use this option, add the Stripe customer ID to the NetSuite field manually, with a NetSuite script, or with a NetSuite CSV import.

Deploy the script

  1. Confirm your deployment timing:
  • In a NetSuite sandbox, you can deploy the script on a schedule or as a single event.
  • In a NetSuite production environment, you must carefully time the script deployment to prevent unintended behavior. This step in the process is the final trigger for the workflow to function.
  1. On the Script Deployment page, configure the following: Note If you’re deploying to a NetSuite production environment, deselect the Test Mode checkbox.
  • Set the Status to Testing or Scheduled .
  • Select the Deployed checkbox when you want the deployment to be live.
  1. Click Save.

Validate the script functionality

  1. Confirm that at least one record meets the saved search criteria, as configured in the previous steps. If you’re in a sandbox environment, you can create an automated test by finding or creating a test customer in NetSuite. Then, manually create a NetSuite sales order or invoice for that customer that meets your search criteria.
  2. Create or find a test Stripe customer that doesn’t yet have any customer linking metadata on it. Copy the Stripe customer ID and paste it into the Stripe Customer ID field on the NetSuite customer record, and save the NetSuite customer.
  3. Save a payment method to the Stripe customer. To test successful payments, we recommend using the available balance card numbers because they enable the quickest testing of the Deposit Automation workflow downstream of your individual record test. Use any future expiration date, and any numbers for the CVV and zip code.
  • For US test payments, use 4000000000000077 .
  • For non-US test payments, use 4000003720000278 .
  1. Confirm the script is running:
  • If you configured a schedule and deployed the Script Deployment, the script now runs on that schedule.
  • If you configured a single event, go to the Script Deployment page and click Edit . Select Save and Execute from the dropdown next to the Save button.
  1. After the script runs, go to the sales order or invoice and confirm that a payment record is created and applied within a few minutes.

See also

Last verified 2026-09-27

Is this helpful?