Skip to main content

Act as a client via API

Use this guide when your integration calls HR, Payroll, Pay, or Books on behalf of a merchant you manage as a SERVICE_PARTNER. Acting-client headers tell the gateway which client company to scope — without creating a separate org per merchant.

Prerequisites

  • Machine JWT from token exchange
  • workspaceId and companyId for the target merchant
  • partner:client:act-as permission (included in partner workspace lead roles)

Overview

Both acting headers must be sent together on every product API request. They are optional in the OpenAPI schema but required in practice for partner multi-merchant integrations.

Steps

1

Exchange credentials for a machine token

JWT tenantId is your partner organization — not the client’s.
2

Call a product API with acting headers

In the API reference playground: Authorize for Bearer + API key, then fill X-Workspace-Id and X-Acting-Company-Id on the endpoint form.
3

Switch merchants in your app

When an admin selects a different merchant in your UI, swap only the header values — the same JWT and API key stay valid:

Tips

  • Store workspaceId + companyId per merchant at onboarding time — Onboard a client company.
  • Permissions are intersected at the gateway: you only get module permissions your partner role allows and that are valid for acting-client mode.
  • Auth routes (workspaces, companies, token exchange) do not use acting headers.

Troubleshooting

Multi-tenancy

Full tenancy model and setup flow.

Authorization

Token exchange and header reference.