Browse documentation

On this page

Partner APIAPI contract v1.1.0

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:

LimitCountsRefused with
CompaniesActive and suspended companiesPARTNER_LIMIT_REACHED
Users per companyStaff users in one companyPARTNER_LIMIT_REACHED
Clients per companyClients in one companyPARTNER_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

GET /v1/partner/usage returns how many companies you hold against your limit. It is a single light read, so you can poll it.

Shell
curl https://api.paprel.com/v1/partner/usage \
  --header 'Authorization: Bearer <partner token>'
JSON
{
  "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.

Shell
curl 'https://api.paprel.com/v1/partner/companies?limit=50' \
  --header 'Authorization: Bearer <partner token>'
JSON
{
  "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.

JSON
{
  "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

Shell
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.

Shell
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.deleted until 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

CheckEvidence to verify before launchReference
Server-side credentialsSecrets 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 privilegeGrant 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 isolationBind 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 separationKeep sandbox and production companies, credentials, API bases, webhook endpoints, and data separate. Verify the registered partner domain and environment at deployment.First journal
Accounting configurationCheck 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 retriesReuse 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 recoveryVerify 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 errorsHandle 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 usedKeep 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 jti and exp at 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_id and user_id against your own external IDs. Use the documented provisioning retry behavior with the same payload.
  • Send x-partner-domain with every Public API call made with a session.
  • Handle 409 PARTNER_LIMIT_REACHED and PARTNER_CONTACT_LIMIT_REACHED as 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.

Evaluate Paprel

Build in sandbox, launch with a production trial

Use sandbox for developer testing with no billing. When you are ready for real workflows, start production on a monthly plan with a 14-day free trial.

API-First Delivery
Audit-Ready Controls
Sandbox And Guided Rollout
We use cookies to improve your experience.

We use cookies and local storage for essential settings and, with your choices, analytics and advertising. Online identifiers and activity can be personal data. You can reject optional categories or change your choices.

These cookies are necessary for the basic functionality of the website, ensuring a seamless user experience. They cannot be disabled.