Create payee session token

View as Markdown
Generate a session token for frontend use. This endpoint can only be called with an API token context. It generates a short-lived JWT token with specific scopes for managing payment methods. The process: 1. API token authenticates the request 2. Payee ID is provided in the request 3. System validates the payee ID belongs to the API token's root entity 4. A session token is created containing the payee's ID, root entity ID, and manage payment methods scopes This allows frontend applications to make authenticated requests on behalf of a specific payee.

Authentication

x-api-keystring

RootPay API key sent in the x-api-key header. Keys are environment-scoped: live_* for production, test_* for sandbox.

Request

This endpoint expects an object.
payee_idstringRequiredformat: "uuid"
UUID of the payee to create a token for. This will be used as the user identifier in the token.

Response

Successful Response
tokenstring
JWT token to be used for further requests
expires_in_secondsinteger
Number of seconds until this token expires
scopeslist of strings
Permission scopes granted to this token