Sample JSON data for Surcharge Invoice Mapping

Default Field Mapping

Use the below JSON template for the surcharge invoice field mapping.

{
  "mapping": {
    "fields": [
      {
        "generate": "otherrefnum",
        "lookupName": "otherrefnumlookup"
      },
      {
        "generate": "subsidiary",
        "initializationDefaultValue": true,
        "lookupName": "subsidairylookup"
      },
      {
        "generate": "taxcode",
        "extract": "",
        "hardCodedValue": -7
      },
     {
        "generate": "account",
        "extract": "currency",
        "fieldtype": "",
        "discardIfEmpty": false,
        "lookupName": "accountlookup"
     }
    ],
    "sublist": {
      "item": [
        {
          "generate": "location",
          "extract": "",
          "hardCodedValue": 2
        },
        {
          "generate": "taxcode",
          "extract": "",
          "hardCodedValue": -7
        }
      ]
    }
  },
  "lookups": {
    "otherrefnumlookup": {
      "resultFieldId": "tranid",
      "recordType": "parent"
    },
    "subsidairylookup": {
      "resultFieldId": "subsidiary",
      "recordType": "parent"
    },
    "accountlookup": {
      "map": {
        "usd": "201",
        "cad": "101"
      }
    }
  }
}

Custom Form

Selecting the specific NetSuite custom form when generating a related surcharge invoice from a parent record is crucial for maintaining data integrity and ensuring the correct user experience.

The JSON sample below demonstrates hard-coding a NetSuite custom form internal id.

{
  "mapping": {
    "fields": [
      {
        "generate": "customform",
        "hardCodedValue": 123
      }
    ]
  }
}

Custom Metadata

Depending on the region, NetSuite merchants may be required to apply tax to surcharge items. To handle this, the surcharge amount is typically mapped to the Gross Amount field of the invoice line item.

The JSON sample below demonstrates how to map Stripe transaction metadata to the appropriate NetSuite fields.

{
  "generate": "grossamt",
  "extract": "metadata.surcharge"
}
Was this article helpful?
0 out of 0 found this helpful

More resources