/v1/* endpoints are authenticated with an API key sent as
a Bearer token in the Authorization header. There is no separate token
exchange — the key itself is the credential.
Creating an API key
- Log in to the YuvexPay dashboard.
- Open Settings > API Keys.
- Click Create key, choose the environment (sandbox or production) and pick the scopes the integration needs (see below).
- Copy the key — it is shown only once at creation.
Key format
A full key has the shape:ypk— fixed prefix.<env>—testfor sandbox,livefor production.<kid>— the public key id (10 characters). Safe to log; we also show it in the dashboard so you can identify which key was used.<secret>— the private material (32 characters). Never log this.
ypk_test_ab12cd34ef_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx and a production key
looks like ypk_live_ab12cd34ef_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.
Using the key
Include the key as a Bearer token on every request:Node.js
Python
Scopes
Each API key carries an explicit list of scopes. A request that calls an endpoint outside the key’s scopes is rejected with403 FORBIDDEN.
The wildcard
* scope grants access to every endpoint and is reserved for trusted server-to-server integrations.
Choose the smallest set of scopes the integration needs. A public-website key
that only creates PIX charges only needs payments:write.
Environments
The same base URL (https://api.yuvexpay.com) serves both environments — the
key prefix decides which bucket the request lands in:
ypk_test_...→ Sandbox. Fake money, predictable provider behaviour, webhooks fire, no financial impact.ypk_live_...→ Production. Real provider, real settlement, real money.
IP allowlist and rotation
Keys support an optional IP/CIDR allowlist (set it per key in the dashboard). When set, requests from outside the allowlist are rejected with403 IP_NOT_ALLOWED even if the key is otherwise valid.
Rotate keys by creating a new one, updating the integration, then revoking the
old one. Key creation, rotation and revocation are auditable in the dashboard.
Inspecting the current key
CallGET /v1/auth/self to retrieve metadata about the key being used. The
response is useful for verifying scopes, environment, IP allowlist and
expiration without storing them client-side:

