- A machine token issued via client credentials (RFC 6749 §4.4).
- An end-user provisioned in your app’s tenant.
- A user-scoped JWT with
sign:jobready to pass to PymtHouse services.
Prerequisites
- A registered developer app with a confidential M2M client (
m2m_…id andpmth_cs_…secret). See Client model for how these relate. curlandjqavailable locally, or any HTTP client.- Your PymtHouse deployment URL (local:
http://localhost:3001).
Step 1 — Obtain a machine token
Exchange your M2M client credentials for a short-lived access token. The token endpoint follows OIDC discovery and is stable at{issuer}/token.
Request only the scopes your operation requires.
users:write is needed for provisioning; users:token is needed for minting user JWTs. Scope assignment is managed on the M2M client; ask the platform admin if a scope is missing.Step 2 — Provision an end-user
Create or upsert a user record linked to your own user identifier (externalUserId). This call is idempotent: sending the same externalUserId again returns the existing record rather than creating a duplicate.
200 response confirms the user exists in the PymtHouse tenant. Store nothing from this response — externalUserId is your stable join key.
Step 3 — Mint a user-scoped JWT
Issue a short-lived access token on behalf of the user. This token carries the user’s identity as itssub and is scoped to the requested capability.
- Has
sub= the PymtHouse app-user record id. - Has
client_id/azp= the publicapp_…client id. - Is bounded to the scopes configured on the public client —
sign:jobmust be in itsallowed_scopes.
Authorization: Bearer header to downstream PymtHouse services.
What’s next
Client model
Deep-dive into the two-client pattern, scope table, and billing mode.
Machine access
Alternative auth patterns and how to keep machine tokens short-lived.
Device flow
Add browser-authenticated device sessions for CLI and limited-input clients.
Usage API
Query fee totals and per-user attribution for billing dashboards.