# Proxy NetSuite under a concurrency limit

## When to use this

NetSuite enforces account-level concurrency. Bursts from integrations often
force extra SuiteCloud Plus capacity. Pin NetSuite origins, set Max concurrency
to your SuiteTalk limit, and let the pool queue or retry when callers burst.

nthbouncer does not treat NetSuite as a special product mode. You pin the
https origins yourself and optionally attach managed OAuth 1.0 credentials.

## Origins to pin

Replace `{account}` with your account id, lowercased, with underscores turned
into hyphens (`1234567_SB1` → `1234567-sb1`):

| Host | Typical use |
|---|---|
| `https://{account}.suitetalk.api.netsuite.com` | SuiteTalk REST (most common) |
| `https://{account}.restlets.api.netsuite.com` | RESTlets |
| `https://{account}.app.netsuite.com` | Suitelets on system/app |
| `https://{account}.extforms.netsuite.com` | External Suitelets |

Most teams only need the SuiteTalk origin. Put multiple hosts on one pool when
those hosts must share the same concurrency budget. Your plan caps how many
origins a pool may list.

Requests go to the first origin unless the caller sends
`X-Nthpool-Origin` with an exact configured origin.

## Setup

1. Create a pool and pin the NetSuite origin(s) under **Settings**.
2. On **Access**, choose **Managed** custody and **OAuth 1.0**, then attach
   a credential with realm (your NetSuite account id), consumer key/secret,
   and token/token secret.
3. Set **Max concurrency** to your safe SuiteTalk concurrency (or use
   **Adaptive** with that value as the max concurrency).
4. Mint a pool key under **Access**. For SuiteQL with writes blocked, add
   `POST` under the keys and set that method's path prefix to
   `/services/rest/query/`.
5. Point your integration at `https://‹pool›.nthpool.cloud/...` instead of the
   NetSuite host directly. Send `X-Nthpool-Key` (or `Authorization: Bearer` on
   managed pools).

```bash
curl -sS "https://ns-prod.nthpool.cloud/services/rest/record/v1/customer" \
  -H "X-Nthpool-Key: $POOL_KEY" \
  -H "Accept: application/json"
```

## Tips

- Enable **Retry on 429** so transient NetSuite throttles are absorbed at the edge.
- Use access-log **tags** (`X-Nthpool-Tags`) to separate Celigo / custom jobs in
  the Logs UI.
- Prefer adaptive mode when you are unsure of the true concurrency limit; keep a
  conservative cap.
- Pass-through custody also works if your connector must keep signing TBA
  itself. Pin the same origins and acquire slots with the locks API, or proxy
  with caller-supplied Authorization.
- Interactive and batch jobs on the same account should share a
  [Capacity budget](/docs/capacity). Use [Auto balancing](/docs/capacity/balancing)
  so spare slots follow load under one SuiteTalk concurrency limit.

## See also

- [Pools](/docs/pools)
- [Capacity](/docs/capacity)
- [Share one origin across several pools](/docs/knowledge-base/capacity-auto)
- [Concurrency](/docs/pools/concurrency)
- [Authentication](/docs/pools/access)
- [Credentials](/docs/credentials)
