Stripe to NetSuite Refunds Import

Configuration Settings

All refund settings are located under the Refunds subtab within the Data Orchestration tab. Inside this subtab, the Refunds field group contains all configuration fields required for managing the Refunds flow.

Note: Click any field label in the Refunds field group to see a description of its purpose and usage.

Field Descriptions

  • Enable Refunds Flow: Check/mark to enable importing Stripe refunds into NetSuite. Uncheck to stop all refunds imports.refunds - enable refunds flow.jpg

  • Update Stripe Refund Metadata: Check/mark to automatically write the NetSuite Customer Refund Internal ID back to the corresponding Stripe refund after it is created.refunds - update stripe refund metadata.jpg
     

  • Last Exported Date: Shows the last time refunds were imported from Stripe (in Unix timestamp). This value is used in the next import to fetch only refunds created after this time using the created[gte] parameter.
    Note: This field is updated by the system after every flow execution and is read-only.refunds - last exported date.jpg

  • Credit memo Line Item for Partial Refunds: Maps the total Stripe partial refund amount to the selected NetSuite item. Regardless of the number of lines on the Stripe invoice, only one line will be added to the NetSuite Credit Memo for partial refunds.refunds - cred mem partil refunds.jpg


Configuring Items for Partial Refunds

For partial refunds, the item used on the Credit Memo is based on this priority order:

  • If the “Credit Memo Line Item for Partial Refunds” is configured, a single line is added to the Credit Memo with that item, and the partial refund amount from Stripe is applied to this item.

  • If the “Credit Memo Line Item for Partial Refunds” is not configured, the first invoice line item  is used, regardless of whether the invoice has one line or multiple lines.

Note: Item mappings are not mandatory. Even if item mappings are provided, either the configured “Credit Memo Line Item for Partial Refunds” item or the first invoice line item will be used.

  • Credit Memo Field Mappings: Controls how Stripe Refund fields are mapped to NetSuite Credit Memo fields.
    Note: Fields from the Stripe refund object can be used.refunds - credit memo field mappings.jpg
    Refer to the Sample Credit Memo Field Mappings at the end of this document for reference. Also, for detailed JSON mapping examples and instructions, refer to the Field Mapping Documentation.
     

  • Customer Refund Account: Select the NetSuite account where customer refunds will be recorded. All imported Stripe refunds are posted to this account.refunds - customer refund account.jpg
    Note: To use condition-based mapping, leave the Customer Refund Account field empty and use static or dynamic mapping. Filling in this field sets a global default that overrides any conditional logic in the Customer Refund Field Mappings.

  • Customer Refund Method: Select the refund method in NetSuite for recording Stripe refunds.refunds - customer refund method.jpg

Note: To use condition-based mapping, leave the Customer Refund Method field empty and use static or dynamic mapping. Filling in this field sets a global default that overrides any conditional logic in the Customer Refund Field Mappings.

  • Customer Refund Field Mappings: Controls how Stripe Refund fields are mapped to NetSuite Customer Refund fields. This includes applying the Credit Memo created, using the configured sublist mappings, which reference the generated NetSuite Credit Memo ID.
    Note: Fields from the Stripe refund object can be used. The NetSuite Credit Memo record ID can be accessed in mappings as a nsCreditMemoId.refunds - customer refund field mappings.jpgRefer to the Sample Customer Refund Field Mappings at the end of this document for reference on how to correctly apply a Credit Memo to a Customer Refund. Also, for detailed JSON mapping examples and instructions, refer to the Field Mapping Documentation.


Sample Field Mappings

Sample Credit Memo Field Mappings

{
  "fields": [
    {
      "generate": "location",
      "hardCodedValue": "2"
    },
    {
      "generate": "custbody_nm_pp_stripe_refund_id",
      "extract": "id"
    }
  ],
  "sublist": {
    "item": [
      {
        "generate": "item",
        "hardCodedValue": "502"
      },
      {
        "generate": "quantity",
        "hardCodedValue": "1"
      },
      {
        "generate": "price",
        "hardCodedValue": "-1"
      },
      {
        "generate": "amount",
        "handlebars": "{{toFixed (divide amountRefunded 100) 2}}"
      },
      {
        "generate": "taxcode",
        "hardCodedValue": "-7"
      }
    ]
  }
}

Sample Customer Refund Field Mappings

{
  "fields": [
    {
      "generate": "customer",
      "dynamicLookup": {
        "recordType": "customer",
        "filters": [
          [
            "custentity_nm_stripecharge_customer_id",
            "is",
            "{{charge.customer}}"
          ]
        ],
        "resultField": "internalid",
        "default": ""
      }
    },
    {
      "generate": "total",
      "handlebars": "{{toFixed (divide amountRefunded 100) 2}}"
    },
    {
      "generate": "custbody_nm_pp_stripe_refund_id",
      "extract": "id"
    }
  ],
  "sublist": {
    "apply": [
      {
        "generate": "apply",
        "hardCodedValue": "T"
      },
      {
        "generate": "doc",
        "extract": "nsCreditMemoId"
      }
    ]
  }
}

 

Was this article helpful?
0 out of 0 found this helpful

More resources