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
workspaceIdandcompanyIdfor the target merchantpartner:client:act-aspermission (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
tenantId is your partner organization — not the client’s.2
Call a product API with acting headers
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+companyIdper 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
Related
Multi-tenancy
Full tenancy model and setup flow.
Authorization
Token exchange and header reference.