API Reference
Authentication

Get a token

POST/auth
Base URL: https://pay4fun.mimicr.dev · provider: https://go.dev.pay4fun.com

Exchanges clientId and clientSecret for a Bearer JWT (RS256, Keycloak format) valid for 300 seconds. The client credentials flow has no refresh: request a new token before it expires. In Mimicr, the credentials are your sandbox's (GET https://api.mimicr.dev/v1/pay4fun).

Authorization

Public route, no token.

Body

application/json
clientIdstringrequired

Client ID issued by Pay4Fun.

Example: "<client_id>"
clientSecretstringrequired

Client Secret issued by Pay4Fun.

Example: "<client_secret>"

Responses

200Token issued.
access_tokenstring

JWT (RS256) to send in the Authorization: Bearer header.

expires_ininteger

Token lifetime in seconds (300).

Example: 300
refresh_expires_ininteger

Refresh token lifetime in seconds (0 when not applicable).

Example: 0
refresh_tokenstring | null

Refresh token. Always null in the client credentials flow.

token_typestring

Always Bearer.

Bearer
not-before-policyinteger

Keycloak field, always 0.

Example: 0
session_statestring | null

Keycloak field, always null.

scopestring

Scope granted to the client.

Example: "payment-gateway"
401Invalid clientId or clientSecret. Empty body.
502Authentication service unavailable.
titlestring

Error title.

Example: "Authentication service unavailable"
statusinteger

HTTP status.

Example: 502