Configure - Stripe Invoice to NetSuite Invoice Add On Demand

  • Updated
Data Flow Stripe Invoice to NetSuite Invoice Add On Demand
Flow Type Realtime
NS Record Customer, Customer Payment, Credit memo, Invoice 

 

Description:

 

The flow “Stripe Invoice to NetSuite Invoice Add On Demand” gets the invoice id(ids) from settings and Import(imports) as NetSuite Invoice

  • Once the invoice Id is given and saved in the settings, this flow triggers a webhook to get the data for the invoice(s) from Stripe
  • Retrieves the invoice info from the invoice Id using a Stripe Lookup.
  • Then gets the additional line items of the invoice by performing a lookup in Stripe 

Add/ Update Customer

  • When managing customer details in NetSuite, it's essential to maintain accuracy and avoid duplicates. To achieve this, we utilize a filter condition ["custentity_nm_stripe_customer_id","is","{{{customer}}}"],"OR",["email","is","{{{customer_email}}}"], which checks if a customer with the provided Stripe customer ID or email address already exists in NetSuite.
  • We implement logic that updates the customer details if a matching record is found in NetSuite. However, if no matching customer is found based on the provided criteria, the flow seamlessly creates a new customer entry in NetSuite. 

Invoices

  • To prevent duplicates in invoices we use a filter condition ["externalid","is","{{{id}}}"], which checks if an invoice with the provided external ID already exists in NetSuite. If such an invoice is found, attempting to create it again may cause errors and disrupt the workflow.
  • We use the 'Ignore Existing Records' checkbox. When enabled, if the invoice with the specified external ID already exists, the step is simply ignored, preventing any errors or duplicate entries. 
  • However, if no previous invoice matches the provided external ID, the flow proceeds to create a new invoice in NetSuite, maintaining consistency and accuracy in our invoice records.
  • The flow further updates the Invoice Internal Id in NetSuite to stripe invoice metadata if Update NetSuite Invoice Id to Stripe Metadata checkbox is checked in settings.

Credit Memo

  • The flow imports the created NetSuite invoice data and creates credit memo records in NetSuite for invoices that have a specific flag (nm_credit_memo_exists) set to yes and a total amount greater than 0.

Customer Payment

  • If an invoice is already paid in NetSuite it tries to create a customer payment record for it in NetSuite .When working with customer payments in NetSuite, it's crucial to prevent duplicates to maintain data integrity. To achieve this, we use a filter condition [["custbody_nm_stripe_payment_intent","is","{{{payment_intent}}}"], which checks if a customer payment with the provided ID already exists in NetSuite. If such a customer payment is found, attempting to create it again may cause errors.
  • We use the 'Ignore Existing Records' checkbox. When enabled, if the customer payment with the specified payment intent ID already exists, the step is simply ignored, preventing any errors or duplicate entries. 
  • However, if no previous customer payment matches the provided payment intent ID, the flow proceeds to create a new invoice in NetSuite.








Configure IO Settings:

 

  •  Click on Settings - Invoices - Stripe to NetSuite 

 

 

  • Enter the Stripe invoice Id to import the invoice to NetSuite
  • Select the item internal id to create the invoice
  • Select account for NetSuite Customer Payment.
  • Select payment method for NetSuite payments.
  • Check Update NetSuite Invoice Id to Stripe Metadata checkbox to populate the invoice internal id to stripe metadata

IO Mappings: 

  • Create or Update Customer record in NetSuite

 

  • NetSuite Customer Portal URL: This URL holds the stripe customer portal  link. After a set number of days the existing link expires then the suitelet is triggered to get the new link in place of the existing link. 

The suitelet is by default NOT DEPLOYED with the bundle installation. User has to manually deploy the script to run.This is the suitelet script for it: novamoduleStripeCustomerPortalLink. Once the script is deployed an external url is generated, add “&strCustId={{customer}}” to the generated url and  map this updated external url against NetSuite Customer Portal URL in mappings. This URL redirects to the Stripe Customer Portal where the customer has access to the invoices, payment methods and billing information.

 

Note:

Make sure that the Stripe Customer Portal URL is populated, if not run the Add/Update Stripe Customer Portal URL on the Customer record in NetSuite flow so that the field gets populated.

 

  • Import Invoice to NetSuite

 

  • The invoice import also updates the following links

NM Stripe Invoice Payment Links : Stripe Payment Link: It displays the stripe payment link in NetSuite to make the payment for the invoice. If the invoice is already paid then it shows the paid invoice details  from stripe

 

NM Stripe Invoice Payment Links : Stripe Payment Link (Plain Text): It displays the stripe payment  in NetSuite in a text format

 

NM Stripe Invoice Payment Links : Stripe Invoice Id : It displays the Invoice id from Stripe in NetSuite.

 

Stripe Invoice URL : This URL holds the Stripe invoice link. After a set number of days (These links expire 30 days after the invoice due date up to a maximum of 60 days from the due date or the finalization date if there’s no due date.) the existing link expires then the suitelet is triggered to get the new link in place of the existing link. The suitelet is by default NOT DEPLOYED with the bundle installation. The user has to manually deploy the script to run. This is the suitelet responsible for it  novamodule.stripe.payment.link.js .Once the script is deployed an external URL is generated, add “&id={{id}}” to the generated URL and map this updated external URL against the Stripe Invoice URL in mappings.