Data Flow | Add/Update Open NetSuite Invoices with Details from Stripe Invoices |
Flow Type | Scheduled |
NS Record | Novamodule Stripe Open Invoices For Stripe Paid Invoices Export Template, Credit memo or Customer Payment |
Description:
Get the list of invoices from NetSuite and It updates the invoice as void in NetSuite if the invoice status in Stripe is void. It creates credit memo records in NetSuite if a credit note exists for that invoice.If the status of the invoice is paid it retrieves payment intent details from Stripe and creates customer payment records in NetSuite. Finally, it updates the payment intent metadata in Stripe.
- Once the flow is scheduled it gets the list of open invoices from NetSuite using Novamodule Stripe Open Invoices For Stripe Paid Invoices Export Template where the invoice status is neither “paid in full” nor “voided” and Strip Invoice Id is populated.
- Then using a lookup specific invoice data is retrieved
Invoice
- We then check if the status of the invoice is void, if yes, we update the status of the invoice as voided. The existing invoice is identified using the following filter ["custbody_nm_stripe_invoice_id","is","{{{stripe_invoice_id}}}"]. A post submit script is used to void the invoice transactions on NetSuite.
Credit Memo
- The flow then checks if the status of the invoice is not void. Then it retrieves the list of credit notes in stripe and gets the specified credit note by the Stripe Invoice Id.
- It creates a credit memo for the credit note in NetSuite. It checks if a credit memo already exists for the credit note in NetSuite using the following filter ["custbody_nm_stripe_credit_note_id","is","{{{id}}}"]. If a credit note already exists it ignores this step else creates a credit memo for it in NetSuite
Customer Payment
- The flow uses a lookup to get the payment data with the payment intent id and then uses a script to update the NetSuite payment id to the backend data
- The flow then proceeds to check if the status of the invoice is paid, if true, it creates a customer payment record for the invoice in NetSuite
- It finally updates the Stripe payments metadata with NetSuite customer payment id
Configure IO Settings:
- Click on Settings - Payments - Stripe to NetSuite
- Select the NetSuite saved search for Open invoices which will be available after the bundle installation “Novamodule Stripe Open Invoices For Stripe Paid Invoices Export Template ”. Make a copy of the saved search and use the copied saved search for any additional criteria or results
- Select Payment Method for NetSuite Payments
- Select the payment method to be used for customer payments in NetSuite
- Select Payment account for NetSuite Payments
- Select the account to be used for customer payments in NetSuite
- Select the below to get Payments that have Invoices only or Charges only or both
- Update NetSuite Payment Id to Stripe Metadata
- Check this checkbox to update netsuite payment id into stripe metadata
IO Mappings:
-
Create Credit Note as Credit Memo on NetSuite Invoice Record
- Mapping customer, location, and item details.
- Setting "Replace all lines" to true, indicating that all existing item lines on the original transaction (invoice, return authorization) will be replaced with the lines added on the credit memo itself.
- Mapping the invoice line ID to apply the invoice for the credit memo.
- Mapping the Stripe Credit Note ID in NetSuite to the corresponding ID from Stripe.
-
Create a Customer Payment into NetSuite
- Uses a Dynamic lookup to get the customer using the Internal Id from the filter ["custentity_nm_stripe_customer_id","is","{{{stripeInvoiceData.customer}}}"]
- If the customer does not exists the import errors out
- Mapping account, department and payment method
- Mapping stripe charge id and stripe payment id into NetSuite
- A Dynamic lookup is used to get the Invoice internal id using the filter ["custbody_nm_stripe_invoice_id","is","{{{stripeInvoiceData.id}}}"] to map with the Invoice line Id
-
Update Stripe Invoices Payments Metadata with Open Invoices NetSuite Customer Payment Id
Add the mappings as mentioned below
- Source record field (Stripe)
- Give the name of the field you want to get the value from
- Destination record field (Stripe)
- Enter metadata followed by the name you wish to give to the field
(metadata.<anyNameForTheField>)