Configure - Stripe Invoice to NetSuite Invoice Add

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

 

Description:

 

The "Stripe Invoice to NetSuite Invoice Add" flow transfers data from Stripe invoices to NetSuite invoices.

  • Once the flow is scheduled it exports the invoice records from Stripe, based on the last export date
  • Then gets the additional line items of the invoice by performing a lookup in Stripe 
  • A script adjusts Stripe invoice data post-submission, converting unused time to credit memo and processing applied balance into credit memo in NetSuite, with error handling included. It then returns the modified invoice data or appropriate error messages
  • If Get Stripe Unused line items as a line item into NetSuite is checked in the settings. Then those line will be added to invoice line items
  • A script is used to get the product id from the invoice from 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 record 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
  • Check Do not get $0 Invoices from Stripe to NetSuite checkbox in settings to skip the invoices with $0 amount
  • Check Get Stripe Unused line items as a line item into NetSuite checkbox to get the stripe unused line items as invoice line items. If this is left unchecked th unused line items are added to credit memo lines
  • Check Get Stripe Header Level Tax as a line item into NetSuite checkbox to get tax as line item in an invoice in NetSuite

 

IO Mappings: 

  • Create or Update Customer record in NetSuite

    • Mapping Name, Subsidiary and E-mail
    • Individual is set to “true”
    • Customer id is mapped with External id
    • 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

    • Mapping Billing and Shipping addresses
    • Mapping Item details
    • Mapping item to the product a dynamic lookup is used to get the internal id of the product in Stripe and map it with the NeSuite item
    • Mapping Stripe amount due, amount paid and due date
    • Mapping customer id and customer email
    • Update Stripe invoice id field in NetSuite with invoice id from Stripe
    • 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. 

Note:

Make sure that the Stripe Hosted URL is populated.


  • Create a Credit Memo For Stripe Balance

    • Maps the customer internal id using a dynamic lookup using the filter ["custentity_nm_Stripe_customer_id","is","{{{_PARENT.finalInvoiceData.0.customer}}}"]
    • Mapping location, date and Item details
    • Mapping the invoice id to Apply lines
  • Add Customer Payment to NetSuite

    • The process employs a dynamic lookup mechanism to ascertain the invoice to which the customer payment should be applied. This is achieved by employing a filter condition ["custbody_nm_Stripe_invoice_id","is","{{{id}}}"] in the lookup operation. In essence, this filter condition seeks to match the value of the "custbody_nm_Stripe_invoice_id" field in NetSuite with the provided "id" parameter. This field, acting as a unique identifier, ensures precise association between the customer payment and the corresponding invoice. If the invoice is not found the import errors out.

 

  • Update Stripe Invoice Metadata with NetSuite Invoice 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>)