Overview
This integration imports your Stripe payouts into NetSuite and creates one Journal Entry for each payout. It reconciles what Stripe paid out against the charges, refunds and fees behind it, matches the payments and refunds already in NetSuite, calculates any differences, and posts the result to the accounts you configure.
It runs as three scheduled steps, in order:
- Create Payout Summary: import the payout with its status and totals.
- Import Payout Transactions: import the charges/payments, refunds and fees in the payout, match them to NetSuite transactions, and build the summaries.
- Create Journal Entry: post the payout using the transaction and fee summaries.
Saved searches and a Processing State on each payout connect the steps, and PayPack configuration and mappings control the process. Every run is logged for troubleshooting.
Records created in NetSuite
| Record | Purpose |
| PayPack Payout Summary | One record per Stripe payout, with status, dates, totals, Processing State and JE Created status |
| PayPack Payout Transaction | One record per payout transaction, with transaction details, fees and NetSuite matching |
| PayPack Payout Transactions Summary | Summarizes transactions by type: count, gross amount, net amount, fees and variance |
| PayPack Payout Fee Summary | Summarizes fees by fee type: total fee amount and count |
| PayPack Payout Transaction Fee | Stores the individual Stripe fee details for each payout transaction |
| Journal Entry | One per payout, created from the transaction and fee summaries and linked to the Payout Summary |
Processing State
Each Payout Summary moves through these states, which is how the three steps hand a payout to each other.
| State | Meaning |
| New | The PayPack Payout Summary record was created in NetSuite (Step 1) |
| ready | The payout's transactions were imported into NetSuite (Step 2) |
| ready_for_journal_entry | Transaction and fee summaries are complete and the payout is ready for a Journal Entry (Step 2) |
| completed | The Journal Entry was created and payout processing is finished (Step 3) |
Configuration Settings
Go to Data Orchestration > Journal Entries. The settings are grouped into Payout Summary Settings, Payout Transaction Summary and Journal Entry Settings, one group for each step.
Field Descriptions
Payout Summary Settings (Step 1)
- Enable Payout Summary Flow: Check to enable importing payouts from Stripe into NetSuite.
- Import Balance Transaction Summary: Optionally calculates gross amount, fees and transaction counts during Step 1. Note: This makes extra calls to Stripe.
- Last Exported Date (Unix and Date/Time): The import checkpoint. It is read-only, and overlap days are applied to later runs.
- Payout Summary Field Mappings: Optional JSON. The default mapping is used when this is blank.
Payout Transaction Summary (Step 2)
- Enable Payout Transactions Flow: Check to enable importing payout transactions and their related records.
- Payout Summary Saved Search: The NetSuite saved search that fetches the payout summary records eligible for transaction import.
- Stripe Lookup Mode: How PayPack matches Stripe records to NetSuite transactions. Choose None (no matching), Balance Transaction ID (txn_...) or Source ID (ch_... for charges, re_... for refunds).
- Payment Lookup Field ID: Optional. The NetSuite transaction body field that stores the Stripe ID on Customer Payments, Customer Deposits and Cash Sales. PayPack searches this field to match each Stripe charge to its NetSuite transaction. In Balance Transaction ID mode it must hold the txn_ ID, and in Source ID mode the ch_ ID. Leave it blank to use the PayPack default field for the selected lookup mode.
- Refund Lookup Field ID: Optional. The NetSuite transaction body field that stores the Stripe ID on Customer Refunds and Cash Refunds. PayPack searches this field to match each Stripe refund to its NetSuite transaction. In Balance Transaction ID mode it must hold the txn_ ID, and in Source ID mode the re_ ID. Leave it blank to use the PayPack default field for the selected lookup mode.
- Payout Transaction Field Mappings: Optional JSON. The default mapping is used when this is blank.
Journal Entry Settings (Step 3)
- Enable Journal Entries Flow: Check to enable creating Journal Entries for eligible payouts.
- Update Stripe Payout Metadata: Writes the NetSuite Payout Summary ID to the Stripe payout's metadata.
- Journal Entry Saved Search: The NetSuite saved search that fetches payouts in the ready_for_journal_entry Processing State whose JE Created box is unchecked.
- Journal Entry Field Mappings: Required JSON for the subsidiary, currency, accounts and Journal Entry lines. There is no default. Note: Always map custbody_nm_payout_summary to the Payout Summary internal ID so PayPack can identify Journal Entries it has already created. Configure and test account-specific mappings in a sandbox first.
How the Import Works
Each step runs as its own scheduled Map/Reduce script.
Step 1: Create the Payout Summary
Script: PayPack S2NS Payouts Import MR
- Set the date window. PayPack uses the Last Exported Date, or the Start Date on the first run. It also rechecks the previous Overlap Days (3 by default) so status changes on recent payouts are picked up.
- Get payouts from Stripe. New payouts are created, existing payouts are updated when their status changes, and unchanged payouts are ignored.
- Calculate totals (optional). If Import Balance Transaction Summary is on, PayPack calculates transaction totals and fees.
- Save the Payout Summary. PayPack checks the Stripe payout ID again before saving, to prevent duplicates.
- Update Stripe metadata (optional). The NetSuite summary ID can be written to the Stripe payout.
- Move the checkpoint. The Last Exported Date advances only if the whole run finishes without errors, so a payout that failed can be retried on the next run.
Importing specific payouts on demand. Use a deployment set to Not Scheduled, enter the Stripe payout IDs (po_...) in the Payout IDs parameter, then choose Save and Execute. This does not move the Last Exported Date.
Step 2: Import payout transactions and summaries
Script: PayPack S2NS Payout Transactions Import MR
- Pick a payout. PayPack takes a payout summary from the PayPack Data Orchestration Payouts to Process saved search. The Payout ID must be present, and payouts that are already summarized are excluded.
- Get the payout's balance transactions from Stripe. The payout debit line is left out. Amounts are converted to currency units and fee lines are captured.
- Skip duplicates. Payout transactions already imported under the same summary are skipped.
- Match to NetSuite (optional). Stripe charges and refunds are matched to Customer Payments, Customer Deposits, Cash Sales, Customer Refunds or Cash Refunds, using your Stripe Lookup Mode. Transactions that came from a different payout are not matched.
- Create Payout Transaction records. Each record holds the matched NetSuite transaction, available amount, variance, transaction type, status and a Needs Review flag.
- Build the summaries. Only after all transactions import successfully, PayPack sets the Payout Summary state to ready, rebuilds the transaction and fee summaries, refreshes the totals, then sets the Payout Summary state to ready_for_journal_entry.
- Retry on errors. If any error occurs, the payout stays available for the next run. With Auto Continue on (found on the Script Deployment), PayPack queues the next payout when the saved search has additional results.
Transaction statuses. Each payout transaction is marked Full Amount, Partial Amount, Not Found or New. Needs Review flags a mismatch between a payment or refund and what Stripe paid out. A positive variance means less money reached the bank.
Step 3: Create the Journal Entry
Script: PayPack S2NS Payout JournalEntry MR
- Get eligible payouts from the Journal Entry Saved Search. PayPack checks that the required Journal Entry Field Mappings are valid before processing.
- Avoid duplicates. A payout is skipped if its JE Created box is checked, or if a Journal Entry already links to the Payout Summary. PayPack updates the checkbox if it was missing.
- Collect the data: the payout header, the transaction summaries and the fee summaries.
- Build the Journal Entry lines. PayPack generates transaction_lines, then fee_lines, then the fixed accline_1 to accline_n lines, in that order. Every line needs an account and a debit or credit amount.
- Save the Journal Entry and log its internal ID.
- Mark the payout done. PayPack checks JE Created and sets the Processing State to completed.
The Saved Searches
Steps 2 and 3 each use a saved search. Include the Payout ID result column in both. If you have multiple Stripe accounts, filter each search by its Stripe account.
| Search | Used by | Criteria |
| PayPack Data Orchestration Payouts to Process | Step 2 (Payout Summary Saved Search) | Processing State is new; Payout Status is paid; Inactive is false |
| Paypack Data Orchestration Journal Entries | Step 3 (Journal Entry Saved Search) | Inactive is false; Processing State is ready_for_journal_entry; Journal Entry Created is false |
Script Details
Step 1: PayPack S2NS Payouts Import MR
| Parameter | Purpose |
| Stripe Account Id | Internal ID of the PayPack Stripe Account Configuration record. Optional for a single Stripe account. |
| Start Date | Initial payout import date, as a Unix timestamp in seconds. Used only on the first run. |
| Overlap Days | Number of previous days to recheck for payout status updates. The default is 3. |
| Status Filter | Optional. Filters Stripe payouts by status (for example, paid). |
| PSP List Id | Optional. Internal ID of the Stripe entry in the PSP list. |
| Payout IDs | Stripe payout IDs (po_...) to import specific payouts through an on-demand run. |
Step 2: PayPack S2NS Payout Transactions Import MR
Processes one payout per run. It needs two script deployments so that subsequent payouts are processed automatically.
| Parameter | Purpose |
| Stripe Account Id | Internal ID of the PayPack Stripe Account Configuration record. |
| Chunk Size | Number of transactions processed per batch. The default is 50. |
| Auto Continue | Automatically queues the next payout for processing. On by default. |
Step 3: PayPack S2NS Payout JournalEntry MR
Processes all payouts returned by the Journal Entry Saved Search.
| Parameter | Purpose |
| Stripe Account Id | Internal ID of the PayPack Stripe Account Configuration record used for Journal Entry processing. |
Suggested Schedule
Run the steps in order, each far enough apart for the previous one to finish. For example, a daily sequence:
- Step 1 at 1:00 AM
- Step 2 at 2:00 AM
- Step 3 at 4:00 AM
A payout that is not ready for the next step simply waits for a later run.
Deploying and Scheduling
Repeat these steps for each of the three scripts.
- Go to Customization > Scripting > Scripts.
- Filter by Type: Map/Reduce and search for the script (for example, PayPack S2NS Payouts Import MR). Click View.
- Click Deploy Script.
- On the deployment, set the Stripe Account Id parameter to the internal ID of the relevant PayPack Stripe Account Configuration record.
- 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.
For Step 2, create two deployments of the script, and schedule both.
Sample Field Mappings
Payout Summary Field Mappings
{
"record": {
"recordType": "customrecord_nm_payout_summary",
"isDynamic": true,
"keyField": "custrecord_nm_payoutid",
"statusField": "custrecord_nm_payout_status"
},
"fields": [
{
"generate": "name",
"handlebars": "Stripe Payout - {{id}}"
},
{
"generate": "custrecord_nm_payoutid",
"extract": "id"
},
{
"generate": "custrecord_nm_payout_status",
"extract": "status"
},
{
"generate": "custrecord_nm_payout_currency",
"extract": "currency"
},
{
"generate": "custrecord_nm_payout_startdate",
"extract": "created",
"fieldType": "date"
},
{
"generate": "custrecord_nm_payout_enddate",
"extract": "arrival_date",
"fieldType": "date",
"discardIfEmpty": true
},
{
"generate": "custrecord_nm_payout_net_amt",
"extract": "pp_amount_major",
"fieldType": "currency"
},
{
"generate": "custrecord_nm_payout_pspname",
"hardCodedValue": "1",
"fieldType": "select"
},
{
"generate": "custrecord_nm_payout_processing_state",
"hardCodedValue": "9",
"fieldType": "select"
},
{
"generate": "custrecord_nm_payout_integration_channel",
"hardCodedValue": "DO"
}
]
}
Payout Transaction Field Mappings
{
"record": {
"recordType": "customrecord_nm_payout_trans",
"isDynamic": true
},
"fields": [
{
"generate": "custrecord_nm_payout_trans_id",
"extract": "id"
},
{
"generate": "custrecord_nm_payout_trans_total_amt",
"extract": "amount",
"fieldType": "currency"
},
{
"generate": "custrecord_nm_payout_trans_net_amt",
"extract": "net",
"fieldType": "currency"
},
{
"generate": "custrecord_nm_payout_trans_total_fee",
"extract": "fee",
"fieldType": "currency"
},
{
"generate": "custrecord_nm_payout_trans_currency",
"extract": "currency"
},
{
"generate": "custrecord_nm_payout_trans_created",
"extract": "created",
"fieldType": "date",
"discardIfEmpty": true
},
{
"generate": "custrecord_nm_payout_trans_available",
"extract": "available_on",
"fieldType": "date",
"discardIfEmpty": true
},
{
"generate": "custrecord_nm_payout_trans_type_source",
"extract": "source"
},
{
"generate": "custrecord_nm_payout_trans_type_txt",
"extract": "type"
},
{
"generate": "custrecord_nm_payout_trans_category",
"extract": "reporting_category"
},
{
"generate": "custrecord_nm_payout_trans_status",
"hardCodedValue": "1",
"fieldType": "select"
},
{
"generate": "custrecordnm_payout_trans_status",
"extract": "status"
},
{
"generate": "custrecordnm_payout_trans_bal_type",
"extract": "balance_type"
},
{
"generate": "custrecord_nm_payout_tran_parent",
"extract": "netsuite_payout_summary_id",
"fieldType": "select"
}
],
"sublist": {
"recmachcustrecord_nm_payout_fee_parent_trans": [
{
"generate": "custrecord_nm_payout_fee_id",
"extract": "fee_details[].fee_id"
},
{
"generate": "custrecord_nm_payout_fee_amt",
"extract": "fee_details[].amount",
"fieldType": "currency"
},
{
"generate": "custrecord_nm_payout_fee_type",
"extract": "fee_details[].type"
},
{
"generate": "custrecord_nm_payout_fee_currency",
"extract": "fee_details[].currency"
},
{
"generate": "custrecord_nm_payout_fee_memo",
"extract": "fee_details[].description"
}
]
}
}
Journal Entry Field Mappings
{
"record": { "recordType": "journalentry", "isDynamic": true },
"fields": [
{ "generate": "subsidiary", "hardCodedValue": "3" },
{ "generate": "currency", "hardCodedValue": "1" },
{ "generate": "custbody_nm_novapss_payout_id", "extract": "custrecord_nm_payoutid" },
{ "generate": "custbody_nm_payout_summary", "extract": "internalid" }
],
"sublist": {
"transaction_lines": [
{
"generate": "account",
"extract": "transaction_summaries[].type",
"staticLookup": {
"map": { "adjustment": "83", "charge": "6", "refund": "115", "fee": "71", "transfer": "23" }
}
},
{
"generate": "debit",
"handlebars": "{{#compare transaction_summaries[].amount \"<\" 0}}{{multiply transaction_summaries[].amount -1}}{{/compare}}",
"fieldType": "currency",
"discardIfEmpty": true
},
{
"generate": "credit",
"handlebars": "{{#compare transaction_summaries[].amount \">=\" 0}}{{transaction_summaries[].amount}}{{/compare}}",
"fieldType": "currency",
"discardIfEmpty": true
},
{ "generate": "memo", "extract": "transaction_summaries[].type" }
],
"fee_lines": [
{ "generate": "memo", "extract": "fee_summaries[].fee" },
{ "generate": "account", "hardCodedValue": "71" },
{ "generate": "debit", "extract": "fee_summaries[].amount", "fieldType": "currency" }
],
"accline_1": [
{ "generate": "account", "hardCodedValue": "58" },
{ "generate": "debit", "extract": "custrecord_nm_payout_net_amt", "fieldType": "currency" },
{ "generate": "memo", "hardCodedValue": "Net Amount" }
]
}
}