Stripe to NetSuite Credit Note Import

Configuration Settings

All credit notes settings can be found under the Refunds subtab in the Data Orchestration tab. The fields are grouped together under Credit Notes for easy access.

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

 

Field Descriptions

  • Enable Credit Notes Flow: Check/mark to enable importing Stripe credit notes into NetSuite. Uncheck to stop all credit note imports.credit notes - enable flow.jpg

  • Update Stripe Credit Note Metadata: Check/mark to automatically write the NetSuite Credit Memo Internal ID back to the corresponding Stripe Credit Note after it is createdcredit notes - update stripe credit note metadata.jpg

  • Last Exported Date: Shows the last time credit notes were imported from Stripe (in Unix timestamp). This value is used in the next import to fetch only credit notes 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.credit notes - last exported date.jpg

  • Credit Memo Discount Item: Maps the NetSuite Item that represents any discounts from Stripe Credit Notes.

   Note: Use only non-inventory items. All Stripe discounts appear as a single line on the NetSuite Credit Memo.

credit notes - credit memo discount item.jpg
  • Credit Memo Tax Item: Maps the NetSuite item that captures taxes from Stripe credit notes.

    Note: Use only non-inventory items. All Stripe taxes are combined into a single line on the NetSuite credit memo.credit notes - credit memo tax item.jpg

 

Item Mapping Hierarchy

  1. Configured Items (Discount, Tax): 

  • If the “Credit Memo Discount Item” and/or “Credit Memo Tax Item” are configured, they are imported as single-line items on the credit note as described above.

  1. Multiple Line Items:

  • “Credit Memo Field Mappings” lets you link each Stripe Credit Note line to a NetSuite item.

  • You can use either static or dynamic lookups to select NetSuite Items for each Stripe Credit Note line.

  • Sublist mappings are required even when default items are set  (using Discount Item, or Tax Item field). Sublist mappings allow mapping beyond Item, Quantity, and Amount, ensuring all credit note lines, discounts, and taxes from Stripe are imported correctly into NetSuite

Note: 
1. Always map Item, Quantity, and Amount for tax and discount lines, plus other required fields. Quantity defaults to 1, and Amount comes from Stripe (total discounts or taxes).

2. Use the record mapping fields to map all required line-level fields.

3. For conditional mapping, always leave the default item fields blank and use static or dynamic mapping. Any values entered in these fields will override the conditional logic in the Credit Memo Field Mappings.

Refer to the Field Mapping Documentation for examples and detailed instructions on implementing conditional mappings.

  • Credit memo Line Item for Applied Balance: Maps the NetSuite item that represents any Applied Balance from Stripe credit notes.

Note: Use only non-inventory items. The Applied Balance will appear as a line item on the NetSuite credit memo.credit notes - credit memo line applied balance.jpg

  • Credit Memo Field Mappings: Controls how Stripe Credit Note fields are mapped to NetSuite Credit Memo fields

 Note: Only fields from the Stripe Credit Note object can be used.
Refer to the Sample Credit Memo Mappings for detailed mapping configurations. Also, for detailed JSON mapping examples and instructions, refer to the Field Mapping Documentation.credit notes - credit memo field mappings.jpg

  • Customer Refund Account: Select the NetSuite account where Stripe refunds will be recorded. All imported customer refunds are posted to this account.

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.credit notes - customer refund account.jpg 

  • Customer Refund Method: Select the payment method in NetSuite for recording Stripe refunds.

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.credit notes - customer refund method.jpg

  • Customer Refund Field Mappings: Controls how Stripe refund fields are mapped to NetSuite customer refund fields

Note: Fields from the Stripe credit note object can be used. Refund data is organized as an array within each refund object, with associated credit notes available via parent objects (for example, parent.stripeCreditnoteData.id, parent.stripeCustomerData.id).The NetSuite credit memo record Id can be accessed in mappings as  parent.stripeCreditnotesData.nsCreditmemoId


Refer to the Sample Credit Refund Mappings for detailed mapping configurationscredit notes - customer refund field mappings.jpg


For detailed JSON mapping examples and instructions, refer to the Field Mapping Documentation.

Sample Field Mappings

Credit Memo Field Mapping

{
  "fields": [
    {
      "generate": "location",
      "hardCodedValue": "2"
    },
    {
      "extract": "id",
      "generate": "custbody_pp_s2ns_credit_note_id"
    }
  ],
  "sublist": {
    "discount": [
      {
        "generate": "item",
        "hardCodedValue": 603
      },
      {
        "generate": "quantity",
        "hardCodedValue": 1
      },
      {
        "generate": "price",
        "hardCodedValue": "-1"
      },
      {
        "generate": "amount",
        "hardCodedValue": 1
      },
      {
        "generate": "taxcode",
        "hardCodedValue": "-7"
      }
    ],
    "item": [
      {
        "dynamicLookup": {
          "default": "502",
          "filters": [
            [
              "stockdescription",
              "is",
              "{{lines.data[].product}}"
            ],
            "and",
            [
              "isinactive",
              "is",
              "F"
            ]
          ],
          "recordType": "inventoryitem",
          "resultField": "internalid"
        },
        "generate": "item"
      },
      {
        "extract": "lines.data[].quantity",
        "generate": "quantity"
      },
      {
        "generate": "price",
        "hardCodedValue": "-1"
      },
      {
        "generate": "amount",
        "handlebars": "{{toFixed (divide lines.data[].amount 100) 2}}"
      },
      {
        "generate": "taxcode",
        "hardCodedValue": "-7"
      }
    ],
    "tax": [
      {
        "generate": "item",
        "hardCodedValue": 716
      },
      {
        "generate": "quantity",
        "hardCodedValue": 1
      },
      {
        "generate": "price",
        "hardCodedValue": "-1"
      },
      {
        "generate": "amount",
        "hardCodedValue": 1
      },
      {
        "generate": "ignoreInclusiveTax",
        "hardCodedValue": "true"
      }
    ]
  }
}

Customer Refund Field Mapping

{
  "fields": [
    {
      "generate": "customer",
      "dynamicLookup": {
        "recordType": "customer",
        "filters": [
          [
            "custentity_nm_stripecharge_customer_id",
            "is",
            "{{parent.stripeCreditnotesData.customer}}"
          ]
        ],
        "resultField": "internalid",
        "default": ""
      }
    },
    {
      "generate": "custbody_nm_pp_stripe_refund_id",
      "extract": "id"
    },
    {
      "generate": "paymentmethod",
      "hardCodedValue": "10"
    },
    {
      "generate": "account",
      "hardCodedValue": "2"
    }
  ],
  "sublist": {
    "apply": [
      {
        "generate": "apply",
        "hardCodedValue": "T"
      },
      {
        "generate": "doc",
        "extract": "parent.stripeCreditnotesData.nsCreditmemoId"
      },
      {
        "generate": "amount",
        "handlebars": "{{toFixed (divide amount 100) 2}}"
      }
    ]
  }
}
Was this article helpful?
0 out of 0 found this helpful

More resources