Partner & provisioning
For integrators, CAs and resellers who create and manage organizations on behalf of their clients: create an organization and mint its API token, list your organizations, re-issue a token, suspend and reactivate. A partner only ever sees the organizations it created.
Authentication
These routes do not use a bearer token or an AIBooks.* scope. Send your partner key in a header:
X-Partner-Key: aibk_partner_…401 partner.unauthorized— header missing, or the key is not recognised.403 partner.suspended— the partner account is not ACTIVE.
Because there is no bearer token, these calls are rate limited as anonymous traffic (60 requests per minute per IP address); see Rate limits. Responses are plain objects with camelCase fields. They do not use the { code, message, <resource> } envelope.
/partner/organizationsCreate a client organization and mint its tokenX-Partner-KeyIdempotency-Key is required (400 idempotency.key_required without it).
Body
| Field | Type | Notes |
|---|---|---|
name | string | Required. Business name. |
state | string | Required. Primary state; any common shape, stored as IN-XX. |
ownerEmail | string | Required. Must contain @. The owner user is created from it. |
ownerName | string? | |
gstin | string? | |
pan | string? | |
currency | string | Default INR. |
fyStartMonth | int | 1 – 12, default 4 (April). |
externalRef | string? | Your own id for this client; saved on the organization. |
tokenDescription | string? | Label for the minted token. |
scopes | string[]? | Scopes for the token. Defaults to your partner scopes. |
isTest | bool | Default false. |
Field names are camelCase here (snake_case is also accepted for the same fields).
POST /partner/organizations
X-Partner-Key: aibk_partner_…
Idempotency-Key: 7c1d…
Content-Type: application/json
{
"name": "Sharma Traders",
"state": "IN-MH",
"ownerEmail": "owner@sharmatraders.example",
"gstin": "27AABCC1234D1Z5",
"externalRef": "crm-4821"
}
201 Created
{
"success": true,
"organizationId": "org_…",
"organizationName": "Sharma Traders",
"ownerUserId": "usr_…",
"token": "aibk_pat_…", // shown once; not retrievable again
"tokenPrefix": "aibk_pat_ab12",
"scopes": [ … ], // the scopes granted to the token
"apiBaseUrl": "/api/public/v1",
"note": "Use `token` as a Bearer PAT against /api/public/v1 endpoints. It is not retrievable again."
}Store tokenimmediately. Use it as the bearer token for that client's organization on every other page of this reference. A bad value returns 400 validation (bare string code) with the message, for example a missing name or an ownerEmail without @.
/provision/organizationSame as above (legacy alias)X-Partner-KeyKept for older integrations. Same body, same response, same Idempotency-Key requirement and same X-Partner-Key auth as POST /partner/organizations. Use that one in new code.
/partner/organizationsList your organizationsX-Partner-Key200 OK
{
"success": true,
"items": [
{ "id": "org_…", "name": "Sharma Traders", "state": "IN-MH", "gstin": "27AABCC1234D1Z5",
"status": "ACTIVE", "createdAt": "2026-05-12T08:30:00" }
]
}Newest first. Not paginated: every organization is returned.
/partner/organizations/{org_id}Get one of your organizationsX-Partner-KeyReturns the object above (no wrapper). An id that is not yours returns 404 not_found (bare string code).
/partner/organizations/{org_id}/tokenRe-issue an API token (CA book access)X-Partner-KeyMints a new token bound to the organization's owner, with your partner scopes. No body, and no Idempotency-Key is required, so every call mints a new token.
200 OK
{
"success": true,
"organizationId": "org_…",
"token": "aibk_pat_…",
"tokenPrefix": "aibk_pat_cd34",
"scopes": [ … ],
"note": "Use as a Bearer PAT on /api/public/v1. Shown once."
}409 no_owner if the organization has no owner to bind the token to.
/partner/organizations/{org_id}/suspendSuspend an organizationX-Partner-Key/partner/organizations/{org_id}/reactivateReactivate an organizationX-Partner-KeyNo body. Sets the organization's status to SUSPENDED or ACTIVE and returns the organization object. Calling either twice is harmless.