> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tabs.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tabs.com/_mcp/server.

# Update item external IDs

PATCH https://integrators.prod.api.tabsplatform.com/v3/items/{id}/external-ids
Content-Type: application/json

Creates or updates the external IDs attached to an item, one entry per `sourceType`. Use it to link a Tabs item to its counterpart in an ERP (NetSuite, QuickBooks, ...) or in a tax provider (Anrok, Avalara, Sphere).

**How it works**
- For each entry, if the item has no external ID for that `sourceType` one is created; if it already has one it is replaced.
- Source types you leave out of the request are not touched. This endpoint never deletes an external ID.
- All entries are applied together: if any entry is rejected, none are saved.
- Each `sourceType` can appear only once per request.
- The item must belong to your merchant, otherwise the response is `404`.
- The same `externalId` can be set on many items. Several items can share one tax provider product ID or ERP ID, so there is no uniqueness check.
- Requires an API key with write access. Read-only (reporter) keys are rejected.

**What `externalId` holds**
- ERP source types (e.g. `NETSUITE`, `QUICKBOOKS`): the item ID in the ERP.
- Tax provider source types (e.g. `ANROK`, `AVALARA`, `SPHERE`): the item or product ID in the tax provider.

The response lists every external ID now on the item, including those you did not send.

Reference: https://docs.tabs.com/api-reference/items/integrators-api-items-controller-patch-item-external-ids

## Authentication

- `Authorization` header (required) — API Key authentication via header

## Request

### Path parameters

- `id` (string, required) — Item ID

### Body (application/json)

This endpoint expects a PatchItemExternalIdsDto.

- `externalIds` (list of PatchItemExternalIdDto, required) — External IDs to insert or replace, keyed by sourceType. Source types omitted from the list are left unchanged.

## Response

### 200

Item external IDs updated. Omitted source types are unchanged.

- `payload` (PatchItemExternalIdsResponseDto, required) — Response payload, will be empty when success is false
- `success` (boolean, required) — Boolean with true=success, false=failure
- `message` (string, required) — Plain-text description of the result
- `error` (IntegratorsApiError, optional) — json element with any error messages or warnings

## Errors

### 400 Bad Request Error

Invalid body, unsupported sourceType, or a repeated sourceType

- `any`

### 401 Unauthorized Error

Missing or invalid API key

- `any`

### 403 Forbidden Error

API key does not have write access

- `any`

### 404 Not Found Error

Item not found for this merchant

- `any`

## Types

### PatchItemExternalIdDto

- `sourceType` (enum, required) — System this ID belongs to.
  - Allowed values: `QUICKBOOKS`, `NETSUITE`, `SALESFORCE`, `HUBSPOT`, `AVALARA`, `ANROK`, `STRIPE`, `RILLET`, `SAGE_INTACCT`, `SPHERE`, `CAMPFIRE`
- `externalId` (string, required) — Identifier in the external system.

### PatchItemExternalIdsResponseDto

- `itemId` (string, required) — The item whose external IDs were patched
- `externalIds` (list of ItemExternalIdResponseDto, required)

### IntegratorsApiError

- `code` (double, required) — API response code
- `message` (string, required) — API response message
- `errorCode` (string, optional) — Machine-readable error code
- `details` (IntegratorsApiErrorDetails, optional) — Additional details about the error

### ItemExternalIdResponseDto

- `sourceType` (enum, required)
  - Allowed values: `QUICKBOOKS`, `NETSUITE`, `SALESFORCE`, `HUBSPOT`, `AVALARA`, `ANROK`, `STRIPE`, `RILLET`, `SAGE_INTACCT`, `SPHERE`, `CAMPFIRE`
- `externalId` (string, required, nullable)

### IntegratorsApiErrorDetails

Additional details about the error

## Examples

### Link an ERP item and a tax provider item

**Request**

```json
{
  "externalIds": [
    {
      "sourceType": "NETSUITE",
      "externalId": "1234"
    },
    {
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    }
  ]
}
```

**Response**

```json
{
  "payload": {
    "itemId": "string",
    "externalIds": [
      {
        "sourceType": "ANROK",
        "externalId": "prod_123"
      }
    ]
  },
  "success": true,
  "message": "string",
  "error": {
    "code": 1.1,
    "message": "string",
    "errorCode": "string",
    "details": {}
  }
}
```

**SDK Code**

```python Link an ERP item and a tax provider item
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids"

payload = { "externalIds": [
        {
            "sourceType": "NETSUITE",
            "externalId": "1234"
        },
        {
            "sourceType": "AVALARA",
            "externalId": "SUBSCRIPTION-ITEM"
        }
    ] }
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript Link an ERP item and a tax provider item
const url = 'https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids';
const options = {
  method: 'PATCH',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"externalIds":[{"sourceType":"NETSUITE","externalId":"1234"},{"sourceType":"AVALARA","externalId":"SUBSCRIPTION-ITEM"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Link an ERP item and a tax provider item
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids"

	payload := strings.NewReader("{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Link an ERP item and a tax provider item
require 'uri'
require 'net/http'

url = URI("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Link an ERP item and a tax provider item
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}")
  .asString();
```

```php Link an ERP item and a tax provider item
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids', [
  'body' => '{
  "externalIds": [
    {
      "sourceType": "NETSUITE",
      "externalId": "1234"
    },
    {
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Link an ERP item and a tax provider item
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Link an ERP item and a tax provider item
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["externalIds": [
    [
      "sourceType": "NETSUITE",
      "externalId": "1234"
    ],
    [
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Example 2

**Request**

```json
{
  "externalIds": [
    {
      "sourceType": "NETSUITE",
      "externalId": "1234"
    },
    {
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    }
  ]
}
```

**Response**

```json
{
  "payload": {
    "itemId": "string",
    "externalIds": [
      {
        "sourceType": "ANROK",
        "externalId": "prod_123"
      }
    ]
  },
  "success": true,
  "message": "string",
  "error": {
    "code": 1.1,
    "message": "string",
    "errorCode": "string",
    "details": {}
  }
}
```

**SDK Code**

```python
import requests

url = "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids"

payload = { "externalIds": [
        {
            "sourceType": "NETSUITE",
            "externalId": "1234"
        },
        {
            "sourceType": "AVALARA",
            "externalId": "SUBSCRIPTION-ITEM"
        }
    ] }
headers = {
    "Authorization": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids';
const options = {
  method: 'PATCH',
  headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"externalIds":[{"sourceType":"NETSUITE","externalId":"1234"},{"sourceType":"AVALARA","externalId":"SUBSCRIPTION-ITEM"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids"

	payload := strings.NewReader("{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Authorization", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")
  .header("Authorization", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids', [
  'body' => '{
  "externalIds": [
    {
      "sourceType": "NETSUITE",
      "externalId": "1234"
    },
    {
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    }
  ]
}',
  'headers' => [
    'Authorization' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"externalIds\": [\n    {\n      \"sourceType\": \"NETSUITE\",\n      \"externalId\": \"1234\"\n    },\n    {\n      \"sourceType\": \"AVALARA\",\n      \"externalId\": \"SUBSCRIPTION-ITEM\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["externalIds": [
    [
      "sourceType": "NETSUITE",
      "externalId": "1234"
    ],
    [
      "sourceType": "AVALARA",
      "externalId": "SUBSCRIPTION-ITEM"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://integrators.prod.api.tabsplatform.com/v3/items/123e4567-e89b-12d3-a456-426614174000/external-ids")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```