Browse documentation

On this page

Partner APIAPI contract v1.1.0

Provision companies and users

Each of your customers gets its own Paprel company, with its own books. You create it with a partner token.

Create companies

Create up to 100 companies per call, each with its owner:

Shell
curl https://api.paprel.com/v1/partner/companies \
  --request POST \
  --header 'Authorization: Bearer <partner token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "companies": [{
      "external_company_id": "merchant-0001",
      "company_name": "Kopi Kampung Sdn Bhd",
      "country": "MY",
      "currency": "MYR",
      "locale": "en-MY",
      "timezone": "Asia/Kuala_Lumpur",
      "owner": { "external_user_id": "user-0001", "email": "owner@example.com", "name": "Aisyah Rahman" }
    }]
  }'
JSON
{
  "data": [{
    "external_company_id": "merchant-0001",
    "outcome": "created",
    "company_id": "<company id>",
    "owner_user_id": "<user id>"
  }]
}

Each item reports its own outcome:

OutcomeMeaning
createdNew company and owner. Store company_id and owner_user_id against your own ids.
existingThe same item was provisioned before. The existing ids are returned.
failedNot created. See error_code and error, for example 409 PARTNER_LIMIT_REACHED.

country is ISO 3166-1 alpha-2, currency is ISO 4217, and locale looks like en-MY.

Retries are safe

Your external_company_id and external_user_id are the idempotency keys. Sending the same item again returns existing with the same ids, so a timed-out call can simply be repeated. Sending different data for an id that already exists returns 409 for that item; it never overwrites the company.

Add a user

To add another staff user to a company, send a role from that company's own role list as acl_id:

Shell
curl https://api.paprel.com/v1/partner/companies/<company_id>/users \
  --request POST \
  --header 'Authorization: Bearer <partner token>' \
  --header 'Content-Type: application/json' \
  --data '{ "external_user_id": "user-0002", "email": "finance@example.com", "name": "Daniel Tan", "acl_id": "<role id>" }'
  • Portal roles (client, vendor) are refused with 400 INVALID_ROLE.
  • An external_user_id you already use elsewhere is reused, so one person can belong to several of your companies.
  • Partner-managed users have no password and cannot sign in directly. They reach Paprel only through sessions you mint.
  • The users-per-company limit applies. See Limits and lifecycle.

Next: mint a session and call the Public API.

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.