Overview
This integration syncs Stripe customers into NetSuite through PayPack. For each Stripe customer, PayPack finds the matching NetSuite customer using your configured criteria, or creates a new one.
All import modes use the same PayPack configuration and field mappings, so results are consistent however a customer is imported. Every run is logged for troubleshooting (see Logging).
Import Modes
| Mode | Trigger | Best for |
|---|---|---|
| Batch | Scheduled script | Ongoing, incremental sync |
| On-Demand | Manual, by Stripe customer ID | Importing missing customers |
Configuration Settings
All customer settings are located under the Customers subtab within the Data Orchestration tab. In this subtab, the Customer Settings field group contains all configuration fields required for managing the Customer flow.
Note: Click any field label in the Customer Settings field groups to see a description of its purpose and usage.
Field Descriptions
Enable Customer Flow: Check/mark to enable importing Stripe customers into NetSuite. Uncheck to stop all customer imports.
Update Stripe Customer Metadata: Check/mark to automatically write the NetSuite Customer record's Internal ID back to the corresponding Stripe customer after it is created.
Last Exported Date - Unix format: Shows the last time customers were imported from Stripe (in Unix timestamp). This value is used in the next import to fetch only customers created after this time using the created[gte] parameter.
Note: The system updates this field after every flow execution, and it is read-only.
Last Exported Date - Date/Time: Shows the last time customers were imported from Stripe (in Date/Time format).
Note: The system updates this field after every flow execution, and it is read-only.
-
Criteria to find existing customer record: Defines how NetSuite identifies an existing customer before creating a new record. Set filters based on incoming Stripe customer data, such as email, Stripe customer ID, or other mapped fields. The filters run at import time to search for a matching NetSuite customer. If a match is found, that customer is used for further processing. Otherwise the script follows the configured fallback behavior.
- Criteria are a set of filters, which can include one or more conditions combined with AND/OR logic.
- If no criteria are provided, matching defaults to email and/or Stripe customer ID (see How the Import Works for the exact rules).
- A default customer can be specified in the configuration to be used when no matching record is found.
Refer to the Field Mapping Documentation for examples and detailed instructions on setting up the criteria.
Customer Field Mappings: Controls how Stripe Customer fields are mapped to NetSuite Customer fields
Note: Only fields from the Stripe customer object can be used.
How the Import Works
Batch and On-Demand imports follow the same steps.
1. Get customers
- Customers are fetched from the Stripe API.
- Batch: only customers created on or after the Last Exported Date.
- On-Demand: only the Stripe customer IDs you specify on the deployment.
- Each customer is checked against NetSuite using the Criteria to find existing customer record, if configured.
- If no criteria are defined, default matching applies:
- Single Stripe account: Email or Stripe Customer ID.
- Multiple Stripe accounts: Email only.
- A customer is skipped when a matching NetSuite customer already exists with the same subsidiary.
2. Create or update customer records
- No match found: a new NetSuite customer is created from the Customer Field Mappings.
- Match found, different subsidiary: the existing customer is kept and the required subsidiary is added to its Subsidiaries tab.
- Match found, same subsidiary: the record is skipped and not processed further.
3. Update Stripe metadata
- The NetSuite customer record ID is written back to the Stripe customer.
- Skipped if Update Stripe Customer Metadata is not checked.
4. Log the run
- Each run is recorded in the PayPack Flow Status Log and Flow Record Log (see Logging).
How the Import Works
🆕 Batch and On-Demand imports follow the same steps.
1. Get customers
- Customers are fetched from the Stripe API.
- Batch: only customers created on or after the Last Exported Date.
- On-Demand: only the Stripe customer IDs you specify on the deployment.
- Each customer is checked against NetSuite using the Criteria to find existing customer record, if configured.
- If no criteria are defined, default matching applies:
- Single Stripe account: Email or Stripe Customer ID.
- Multiple Stripe accounts: Email only.
- A customer is skipped when a matching NetSuite customer already exists with the same subsidiary.
2. Create or update customer records
- No match found: a new NetSuite customer is created from the Customer Field Mappings.
- Match found, different subsidiary: the existing customer is kept and the required subsidiary is added to its Subsidiaries tab.
- Match found, same subsidiary: the record is skipped and not processed further.
3. Update Stripe metadata
- The NetSuite customer record ID is written back to the Stripe customer.
- Skipped if Update Stripe Customer Metadata is not checked.
4. Log the run
- Each run is recorded in the PayPack Flow Status Log and Flow Record Log (see Logging).
Address Mapping
Customer addresses are mapped to the NetSuite Address Book sublist, which supports both shipping and billing addresses.
- Each address is its own entry in the sublist, with its own source fields (Address Line 1, Addressee, City, State, Zip, Country). Use separate entries for shipping and billing, for example
shipping.address.*andaddress.*. - Hardcoded values can be used where needed.
- Mark the default address on each entry:
-
defaultshipping = truefor the primary shipping address (typicallyshipping.address). -
defaultbilling = truefor the primary billing address (typicallyaddress). - If billing and shipping are the same, one address can have both set to true.
- Additional addresses should have both set to false
-
How the Import Works
🆕 Batch and On-Demand imports follow the same steps.
1. Get customers
- Customers are fetched from the Stripe API.
- Batch: only customers created on or after the Last Exported Date.
- On-Demand: only the Stripe customer IDs you specify on the deployment.
- Each customer is checked against NetSuite using the Criteria to find existing customer record, if configured.
- If no criteria are defined, default matching applies:
- Single Stripe account: Email or Stripe Customer ID.
- Multiple Stripe accounts: Email only.
- A customer is skipped when a matching NetSuite customer already exists with the same subsidiary.
2. Create or update customer records
- No match found: a new NetSuite customer is created from the Customer Field Mappings.
- Match found, different subsidiary: the existing customer is kept and the required subsidiary is added to its Subsidiaries tab.
- Match found, same subsidiary: the record is skipped and not processed further.
3. Update Stripe metadata
- The NetSuite customer record ID is written back to the Stripe customer.
- Skipped if Update Stripe Customer Metadata is not checked.
4. Log the run
- Each run is recorded in the PayPack Flow Status Log and Flow Record Log (see Logging).
Address Mapping
🆕 Customer addresses are mapped to the NetSuite Address Book sublist, which supports both shipping and billing addresses.
- Each address is its own entry in the sublist, with its own source fields (Address Line 1, Addressee, City, State, Zip, Country). Use separate entries for shipping and billing, for example
shipping.address.*andaddress.*. - Hardcoded values can be used where needed.
- Mark the default address on each entry:
-
defaultshipping = truefor the primary shipping address (typicallyshipping.address). -
defaultbilling = truefor the primary billing address (typicallyaddress). - If billing and shipping are the same, one address can have both set to true.
- Additional addresses should have both set to false.
-
See the sample mapping at the end of this article and the Field Mapping Documentation.
Script Details
Batch (Map/Reduce)
Script: PayPack S2NS Customer Import MR Batch. Runs on a schedule you define.
- First run: fetches customers created on or after the Customer Start Date. Later runs fetch only customers created after the Last Exported Date, so nothing is imported twice.
- Parameters:
-
Stripe Account Id (
custscript_pp_cus_stripe_account_id): internal ID of the PayPack Stripe Account Configuration record. -
Customer Start Date (
custscript_pp_customer_start_date): used only on the first run, or when no Last Exported Date exists. Enter a Unix timestamp in seconds, for example1761147332. The Last Exported Date is updated automatically when a run completes.
-
Stripe Account Id (
On-Demand (Map/Reduce)
Script: PayPack S2NS Customer Import MR OnDemand. Runs only when you trigger it. Use it mainly to import missing customers.
- Parameters:
-
Stripe Account Id (
custscript_pp_cus_od_stripe_account_id): internal ID of the PayPack Stripe Account Configuration record. -
Stripe Customer IDs (
custscript_pp_od_stripe_customer_ids): comma-separated list of the Stripe customers to import.
-
Stripe Account Id (
Deploying and Scheduling
- Go to Customization > Scripting > Scripts.
- Filter by Type: Map/Reduce and open the Batch or On-Demand script.
- Click Deploy Script.
- On the deployment, set the Stripe Account Id parameter to the internal ID of the relevant PayPack Stripe Account Configuration record.
- Batch: on the Schedule subtab, choose the event type (single, daily, weekly, monthly or yearly), start and end dates (or No End Date), and the repeat interval. Click Save.
- On-Demand: enter the customer IDs and use Save and Execute.
Sample Field Mappings
The subsidiary ID below is a placeholder. Replace it with your own value.
{
"fields": [
{ "generate": "subsidiary", "hardCodedValue": "<SUBSIDIARY_ID>" },
{ "generate": "companyname", "extract": "name" },
{ "generate": "email", "extract": "email" },
{ "generate": "custentity_nm_stripecharge_customer_id", "extract": "id" }
],
"sublist": {
"addressbook": [
[
{ "generate": "defaultshipping", "hardCodedValue": true },
{ "generate": "defaultbilling", "hardCodedValue": false },
{ "generate": "addr1", "extract": "shipping.address.line1" },
{ "generate": "addressee", "extract": "name" },
{ "generate": "city", "extract": "shipping.address.city" },
{ "generate": "country", "extract": "shipping.address.country" },
{ "generate": "state", "extract": "shipping.address.state" },
{ "generate": "zip", "extract": "shipping.address.postal_code" }
],
[
{ "generate": "defaultshipping", "hardCodedValue": false },
{ "generate": "defaultbilling", "hardCodedValue": true },
{ "generate": "addr1", "extract": "address.line1" },
{ "generate": "addressee", "extract": "name" },
{ "generate": "city", "extract": "address.city" },
{ "generate": "country", "extract": "address.country" },
{ "generate": "state", "extract": "address.state" },
{ "generate": "zip", "extract": "address.postal_code" }
]
]
}
}