Limits and lifecycle
Limits
Your agreement sets explicit limits. Provisioning a company, adding a user or creating a client that would exceed one is refused with 409:
| Limit | Counts | Refused with |
|---|---|---|
| Companies | Active and suspended companies | PARTNER_LIMIT_REACHED |
| Users per company | Staff users in one company | PARTNER_LIMIT_REACHED |
| Clients per company | Clients in one company | PARTNER_CONTACT_LIMIT_REACHED |
Client and vendor contacts do not count as companies. To change a limit, contact Paprel; limits are part of your agreement, not an API setting.
Check your usage
Working in your own language? These samples use plain HTTP. You can generate a typed Partner API client from openapi-partner.json with the same generators; see SDKs and client libraries.
GET /v1/partner/usage returns how many companies you hold against your limit. It is a single light read, so you can poll it.
curl https://api.paprel.com/v1/partner/usage \
--header 'Authorization: Bearer <partner token>'
{
"data": {
"companies": {
"used": 2,
"limit": 105,
"by_status": { "active": 2, "suspended": 0, "deleted": 1 }
}
}
}
used is active plus suspended, the number the limit is enforced against. Deleted companies do not count toward it. They stay in by_status.deleted until they are permanently removed, after the statutory retention period of seven years.
List your companies
GET /v1/partner/companies returns your active and suspended companies, oldest first. Page with limit (1 to 100, default 50) and cursor, passing next_cursor from the previous page until it is null.
curl 'https://api.paprel.com/v1/partner/companies?limit=50' \
--header 'Authorization: Bearer <partner token>'
{
"data": {
"companies": [
{
"company_id": "<company_id>",
"external_company_id": "acct_123",
"status": "active"
}
],
"next_cursor": null
}
}
external_company_id is null for a company that was not created through the Partner API.
Read one company
GET /v1/partner/companies/{company_id} returns one company's details, with its live user and client counts against the per-company limits under usage. These are the same counts the limit checks use; clients exclude vendors.
{
"data": {
"company_id": "<company_id>",
"external_company_id": "acct_123",
"status": "active",
"name": "Acme Trading",
"currency": "SGD",
"timezone": "Asia/Singapore",
"fiscal_year_end": { "month": 12, "day": 31 },
"created_at": "2026-10-30T12:00:00",
"usage": {
"users": { "used": 1, "limit": 1 },
"clients": { "used": 42, "limit": 100 }
}
}
}
Use it to look up a company. The list carries neither details nor counts, and calling this once per company for a dashboard is slow under the rate limit. A deleted company, or one you do not hold, returns 403 PARTNER_OWNERSHIP_DENIED.
Suspend and resume a company
curl https://api.paprel.com/v1/partner/companies/<company_id>/suspend \
--request POST \
--header 'Authorization: Bearer <partner token>'
Suspending stops the company's session tokens immediately, and minting a new session fails with PARTNER_COMPANY_SUSPENDED until you resume. /resume reverses it; sessions are not restored, so mint new ones. Ownership is checked on every call, and each change is recorded in the company's activity log. Both calls are safe to repeat.
A suspended company keeps its place in your company limit, so resuming never fails on the limit. To free the place, de-provision the company.
De-provision a company
De-provisioning permanently ends a company and frees its place in your limit. The company must be suspended first; otherwise the call returns 409 PARTNER_COMPANY_NOT_SUSPENDED.
curl https://api.paprel.com/v1/partner/companies/<company_id>/deprovision \
--request POST \
--header 'Authorization: Bearer <partner token>'
The response returns the company id and the status deprovisioned. The call is safe to repeat, but it cannot be undone:
- The company's data is retained for the statutory retention period, but the company can no longer be used.
- Memberships are deactivated and the company's webhooks are paused.
- Resume, add-user, company read and session calls for it return
403 PARTNER_OWNERSHIP_DENIED. - It counts in
by_status.deleteduntil it is permanently removed.
You can provision the same external_company_id again. That creates a new company with a new company_id.
Deactivate a user
POST /v1/partner/users/{user_id}/deactivate ends every membership and marks the user inactive. Session tokens already issued to the user stop working immediately, in every company, and new sessions for the user are refused. The call is safe to repeat.
Key rotation
Paprel issues a new key pair with a new kid, delivered the same way as the first. Both keys are accepted during the cutover. Switch your signer to the new kid as soon as you receive it, then confirm so the old key can be retired.
Production checklist
Use the shared checks for every integration. Apply the partner-specific checks when you provision companies or mint user sessions through the Partner API. This is an integration readiness checklist, not a certification or a substitute for your deployment agreement.
Shared checks — Public API and Embedded UI
| Check | Evidence to verify before launch | Reference |
|---|---|---|
| Server-side credentials | Secrets live in a server secret manager, never a browser bundle, public environment variable, source repository, or application log. Test rotation and expired-token handling. | Authentication and tokens |
| Least privilege | Grant only the routes and actions your workflow needs. Test a permitted operation and a denied one; do not ship an administrative token to avoid configuring scopes. | Scopes and permissions |
| Company isolation | Bind every request and token to the intended company. Test that another company's record IDs and credentials cannot be substituted. Do not share cached company-scoped tokens across tenants. | Tenancy and ledger core |
| Environment separation | Keep sandbox and production companies, credentials, API bases, webhook endpoints, and data separate. Verify the registered partner domain and environment at deployment. | First journal |
| Accounting configuration | Check account mappings, base currency, exchange-rate direction, open dates, transaction locks, invoice posting transitions, and payment approval behavior. Inspect resulting journal lines and reports. | Accounting walkthrough |
| Endpoint-specific retries | Reuse the same payment idempotency key for a retry of the same operation. Confirm duplicate-document behavior; inspect journal state before retrying a write after an ambiguous timeout. Do not assume every POST is idempotent. | Webhooks and idempotency |
| Webhook verification and recovery | Verify timestamped HMAC over the exact raw body before processing; test invalid signatures, duplicate events, delayed delivery, and consumer downtime. Reconcile from authoritative API data when necessary. | Webhook contract |
| Rate limits and errors | Handle 401/403 as authentication or permission issues, business validation/conflicts deliberately, and 429 using the documented retry instructions. Bound retries and paginate lists. | Rate limits, API errors, Pagination |
| Browser integration, if used | Keep the BFF authenticated and authorized for the current user/company. Pin exact beta package versions; test token expiry, host events, and upgrades in staging. | Token backend, Package release guidance |
Partner-specific checks — provisioning and sessions
- Confirm Partner API access and company/user/client limits under your agreement; ordinary sandbox signup does not issue partner credentials.
- The partner private key, or the client secret, lives only in your server's secret manager.
- Create a new assertion for every partner token request, with a fresh
jtiandexpat most 300 seconds ahead. - Refresh the partner token before 900 seconds, and user sessions before their
expires_at. Keep partner tokens separate from company-scoped Public API session tokens. - Store Paprel's
company_idanduser_idagainst your own external IDs. Use the documented provisioning retry behavior with the same payload. - Send
x-partner-domainwith every Public API call made with a session. - Handle
409 PARTNER_LIMIT_REACHEDandPARTNER_CONTACT_LIMIT_REACHEDas business outcomes, not retries. - Exercise suspension, resumption, de-provisioning, user deactivation, and key rotation in the agreed test environment. De-provisioning cannot be undone, so use companies created for testing. Verify that revoked sessions stop working and that resumption requires newly minted sessions.
See partner authentication, provisioning, and sessions for the individual contracts. Confirm deployment operations, support, recovery, and commercial scope separately before production processing.