Data Flow | Stripe Refund to NetSuite Credit Memo Add and Customer Refund Add |
Flow Type | Scheduled |
NS Record | NetSuite Credit Memo, Customer Refund |
Description:
Get the list of refunds from Stripe with the last exported date and create the credit memo and customer refund.
- Once the flow is scheduled it gets the list of refunds from Stripe.
- Performs a lookup in Stripe to get the charge with the charge ID available in the refund data.
Credit Memo
- Creates a credit memo that is linked to the existing invoice in NetSuite which will be found using dynamic lookup with the invoice in the charge data.A preMap script is used to extracts relevant information such as invoice details from the input data, attaches it to the data object, A postMap script is used to determine if it's a full or partial refund. For partial refunds, it retrieves invoice item details associated with the refunded invoice and adjusts the refund amount.
Customer Refund
- Creates a customer refund in the NetSuite and applies it to the credit memo created in the previous step.
Configure IO Settings:
- Click on Settings - Refunds - Stripe to NetSuite
- Select account for NetSuite Customer Refund.
- Enter the NonInventory Sale Item internal id to track partial refunds in NetSuite
IO Mappings:
-
Import Credit Memo into NS
- Uses a dynamic lookup to map the invoice internal id to created from using the filter ["custbody_nm_stripe_invoice_id","is","{{{new_charge_invoice}}}"]
- Mapping Stripe Refund id to id from Stripe
- Mapping External id to id from Stripe
-
Create a Customer Refund from Credit Memo in NS
- Mapping account and refund method
- Mapping Credit:Apply to “true”
- Mapping customer internal id using a dynamic lookup using the following filter ["custentity_nm_stripe_customer_id","is","{{{chargeInfo.customer}}}"]
-
Update Stripe Refund Metadata with NetSuite Customer Refund 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>)