Browse documentation

On this page

Partner APIAPI contract v1.1.0

Sessions and Public API calls

A partner token manages companies and users; it cannot read or write accounting data. To work inside a company, mint a session for one of its users and call the Public API with it.

Mint a session

Shell
curl https://api.paprel.com/v1/partner/companies/<company_id>/sessions \
  --request POST \
  --header 'Authorization: Bearer <partner token>' \
  --header 'Content-Type: application/json' \
  --data '{ "external_user_id": "user-0001" }'

Name the user with user_id or external_user_id, or send several in users. A session always names a user; there is no company-only session.

Each result carries an access_token for that user in that company, with expires_in, expires_at and the session's permissions:

  • Lifetime is set on your credential, between 300 and 900 seconds. Mint a new session when it expires. A session stops earlier if you deactivate its user or suspend its company.
  • Permissions are the user's current role, capped by your agreement.
  • Read-only: a company without a subscription, or under a read-only licence, receives a read-only session.
  • Ownership is checked on every call: the company, the user and the membership must all belong to you.

Mint sessions on your server. If a browser needs one, return only the session token, never the partner token or key.

Call the Public API

A session token is an App Connect token for one user in one company. Call any Public API operation the user's role allows, and send x-partner-domain set to your partner identity domain (the token's pdomain claim). That header is required on Public API calls; the Partner API routes do not use it.

Shell
curl https://api.paprel.com/v1/accounting/accounts \
  --header 'Authorization: Bearer <session token>' \
  --header 'x-partner-domain: <your partner identity domain>'

From here the company works like any other:

TaskCall
Read the chart of accountsGET /v1/accounting/accounts
Add a clientPOST /v1/clients
Add a product or servicePOST /v1/items (item_type is goods or service)
Raise an invoicePOST /v1/invoices
Post a manual journalPOST /v1/accounting/journals

For a worked example from partner token to posted journal, see Your first accounting entry.

Next: limits and lifecycle.

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.