Partner API
The partner API lets another system (an ERP, a 3PL, middleware) read one workspace's orders with an API key instead of a user login. A key belongs to one workspace. It can reach only the /v1/public/* routes.
Unlike the console API, these routes are a contract with third parties. Field names, error codes and paging behaviour here must not change without a new version. The generated OpenAPI document for these routes only is served at /{doc.prefix}-partner (/docs-partner by default) on non-production deployments.
Getting a key
A workspace member with team-management rights (USER:MANAGE) opens Settings → API Access and creates an API client for each integration:
- Role — what the client may see. Any of the workspace's roles that include
ORDER:READ, exceptOWNERand roles that can manage the team. If the role includesCUSTOMER:READ, customer phone numbers and emails are returned in full; otherwise they are masked. - Warehouse — optionally limit the client to one site.
- Allowed IPs — optional addresses or CIDR ranges calls must come from.
- Key lifetime — every key expires; the maximum is
API_KEY_MAX_LIFETIME_DAYS(365 by default).
The key (pnxt_live_…) is shown once. PointNXT stores only an HMAC of it. A client can hold up to five active keys, so a key is rotated by issuing a new one, switching the integration over, then revoking the old one. Workspace owners are emailed when a key is created or revoked, and 14 days and 1 day before one expires.
Disabling a client stops all its keys immediately. Platform admins can see every tenant's clients and disable one under Administration → API Clients.
Authentication
GET /v1/public/orders HTTP/1.1
Host: api.pointnxt.com
Authorization: Bearer pnxt_live_AbCdEfGhIjKl_…
Keys are accepted only in the Authorization header, never in the query string. A key is refused (401 invalid_api_key) when it is malformed, unknown, expired, revoked, or its client is disabled. These cases are deliberately indistinguishable. An address outside the client's allowlist gets 403 ip_not_allowed. After 20 failed key attempts in a minute from one IP, that IP gets 429 too_many_failed_attempts.
Keys work only on /v1/public/*. On any other route the API answers 404, whatever role the client holds. Login sessions (JWTs) are refused on /v1/public/* with 401 api_key_required.
Rate limits
Each key may make API_RATE_LIMIT_PER_KEY requests a minute (120 by default), and a workspace API_RATE_LIMIT_PER_TENANT across all its keys (600). Every response carries:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per minute for this key |
X-RateLimit-Remaining | Requests left in the current minute |
X-RateLimit-Reset | Seconds until the minute resets |
Retry-After | On 429 only: seconds to wait |
Errors
Every error has the same shape. Branch on code, not on message.
{
"error": {
"code": "order_not_found",
"message": "No order with that identifier was found.",
"request_id": "6f1c…",
"details": ["only on validation errors"]
}
}
| Status | code |
|---|---|
| 400 | invalid_request, invalid_cursor |
| 401 | invalid_api_key, api_key_required |
| 403 | ip_not_allowed, insufficient_permissions |
| 404 | order_not_found, not_found |
| 429 | rate_limited, too_many_failed_attempts |
| 500 | internal_error |
request_id (also sent as X-Request-Id) identifies the call in PointNXT's logs. The workspace can see the client's recent calls under Settings → API Access → Activity.
List orders
GET /v1/public/orders
| Parameter | Description |
|---|---|
created_from, created_to | ISO 8601. When the order entered PointNXT, not the channel order date. |
status | One status or a comma-separated list, e.g. CONFIRMED,FULFILLED. |
channel | Channel id or channel code. |
order_number | PointNXT order number. |
reference_no | Your reference / ERP sales order number. |
limit | 1–100, default 50. |
cursor | next_cursor from the previous page. |
Orders come oldest first. Page until next_cursor is null:
{ "data": [ { "id": "…", "order_number": "ORD-10421", … } ], "next_cursor": "eyJ2IjoxLCJpZCI6…" }
Syncing new orders: store the last next_cursor you received, or the id of the last order, and start the next poll from it. Orders appear about 30 seconds after they enter PointNXT; that delay is what guarantees a stored cursor never skips an order whose transaction committed late. Treat id as the key and upsert.
Status changes are not in the list yet. The list returns new orders. To read an order's current status, fetch it by id (below). An updated_since filter is planned.
Get one order
GET /v1/public/orders/{identifier}
By PointNXT order id, or add ?by=order_number or ?by=reference_no. Another workspace's order, or one outside the client's warehouse or channel limits, is 404.
{ "data": { "id": "…", "status": "FULFILLED", … } }
The order object
| Field | Notes |
|---|---|
id, order_number, channel_order_number, reference_no, customer_po_no | Identifiers |
status, payment_status, payment_mode, currency | Enums as strings |
order_date | When placed on the channel |
created_at, updated_at, confirmed_at, fulfilled_at, delivered_at, cancelled_at, cancel_reason | ISO 8601 or null |
channel | { id, code, name, type } |
totals | subtotal, tax, shipping, discount, cod_fee, grand_total, paid, refunded |
customer | { name, email, phone, gstin }; email and phone masked unless the role has CUSTOMER:READ |
shipping_address, billing_address | Address lines, city, state, postal code, country; phone and email masked as above |
items[] | sku, channel_sku, name, status, quantity_*, item_price, item_tax, tax_percent, discount, currency |
shipments[] | awb_number, courier_code, courier_name, status, tracking_url, picked_up_at, estimated_delivery_date, delivered_at, is_return |
Money and quantities are decimal strings ("1130.0000"), never floats. Parse them with a decimal type.
How it is built
- Service accounts. Each API client owns a
Userwithkind = SERVICEand aMembershipwith roles in the tenant. The key resolves to that user, soWarehouseGuard, the permission resolver, the tenancy extension and the audit trail treat it exactly like a person. Service accounts cannot log in, reset a password or be impersonated. They are kept off the team page, user lists and impersonation list, and their roles can be changed only through the API client endpoints, never through the team endpoints. Owner and team-admin roles are refused. - Key verification.
src/common/auth/api-key:JwtAccessGuardsends anyBearer pnxt_…token toApiKeyAuthenticatorService, which looks the key up by prefix (cached 60 s in Redis and cleared on revoke or disable). It then compares the HMAC (API_KEY_PEPPER) in constant time and checks expiry, client status, membership status and the IP allowlist.ApiAccessGuardconfines keys to@ApiAccess()routes and applies the per-key and per-tenant limits. The global IP throttle skips key traffic. - Contract isolation.
@ApiAccess()routes return their own body shape (@RawResponse, which skips the console envelope) and error shape (PublicApiExceptionFilter). The orders endpoint has its own module, repository and DTO (src/modules/commerce/public-order), so console changes cannot change it. - Scope.
PublicOrderQueryServicenarrows rows to where the client's roles grantORDER:READ(PermissionResolverService.listGrantScopes), whether tenant-wide or limited to warehouses, channels or sellers. Contact masking followsCUSTOMER:READper order. - Paging. Order ids are UUIDv7, so the cursor and the
created_*bounds are primary-key ranges; no extra index is needed. - Tables.
ApiClient,ApiKey, andApiRequestLog(range-partitioned monthly, kept about a month). Management endpoints live under/v1/identity/api-clients(tenant) and/v1/identity/admin/api-clients(platform admin).
Configuration
| Variable | Default | |
|---|---|---|
API_KEY_PEPPER | — | Required to issue or accept keys. 32+ random characters. Changing it invalidates every key. |
API_RATE_LIMIT_PER_KEY | 120 | Requests per minute per key |
API_RATE_LIMIT_PER_TENANT | 600 | Requests per minute per workspace |
API_KEY_MAX_LIFETIME_DAYS | 365 | Longest key lifetime offered |