YooBank Next API (0.8.0)
Download OpenAPI specification:
API-first foundation. GET /health is operational and unversioned. Authentication: cookie XOR bearer. CSRF required for cookie mutations. Privileged identities may receive HTTP 200 with status=mfa_required; that response is NOT an authenticated session (no cookie, no bearer token). MFA challenge tokens cannot call /auth/session. Merchant machine credentials use Authorization Bearer tokens of the form ybk_{32hex}{43base64url}. A ybk prefix never falls back to a human session. Machine credentials are limited to merchant.payin.create and merchant.payin.read. Public production API base: https://api.yoobank.net Hosted Checkout is https://pay.yoobank.net and is not this JSON API except GET /c/{token}/status.
Authenticate a human identity
Request Body schema: application/jsonrequired
| email required | string <email> |
| password required | string [ 12 .. 128 ] characters |
| transport required | string Enum: "cookie" "bearer" |
Responses
Request samples
- Payload
{- "email": "user@example.com",
- "password": "stringstring",
- "transport": "cookie"
}Response samples
- 200
- 400
- 401
- 429
{- "status": "authenticated",
- "identity": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "email": "user@example.com",
- "status": "active",
- "roles": [
- "string"
]
}, - "roles": [
- "string"
], - "transport": "cookie",
- "csrf_token": "string",
- "token": "string",
- "token_type": "Bearer"
}Complete MFA challenge (TOTP or recovery code)
Request Body schema: application/jsonrequired
| mfa_challenge_token required | string |
| code required | string |
Responses
Request samples
- Payload
{- "mfa_challenge_token": "string",
- "code": "string"
}Response samples
- 200
- 401
- 429
{- "status": "authenticated",
- "identity": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "email": "user@example.com",
- "status": "active",
- "roles": [
- "string"
]
}, - "roles": [
- "string"
], - "transport": "cookie",
- "csrf_token": "string",
- "token": "string",
- "token_type": "Bearer"
}Response samples
- 200
- 401
{- "identity": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "email": "user@example.com",
- "status": "active",
- "roles": [
- "string"
]
}, - "roles": [
- "string"
], - "expires_at": "2019-08-24T14:15:22Z",
- "absolute_expires_at": "2019-08-24T14:15:22Z",
- "mfa_satisfied": true,
- "primary_authenticated_at": "2019-08-24T14:15:22Z",
- "csrf_token": "string"
}Change password (revokes other sessions)
Authorizations:
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| current_password required | string |
| new_password required | string [ 12 .. 128 ] characters |
Responses
Request samples
- Payload
{- "current_password": "string",
- "new_password": "stringstring"
}Response samples
- 401
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Revoke one own session
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 404
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Create identity
Requires identity.create and MFA-satisfied recent session
Authorizations:
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 403
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Disable identity and revoke sessions
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Lock identity and revoke sessions
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Remove a role
Authorizations:
path Parameters
| uuid required | string <uuid> |
| role required | string |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}List merchants
Requires merchant.read. Exact filters on indexed columns only. CLOSED remains listed.
Authorizations:
query Parameters
| status | string Enum: "inactive" "active" "suspended" "closed" |
| uuid | string <uuid> |
| display_name | string |
| limit | integer [ 1 .. 100 ] |
| offset | integer >= 0 |
Responses
Create merchant (always inactive)
Authorizations:
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| display_name required | string [ 1 .. 150 ] characters |
| legal_name | string or null [ 1 .. 255 ] characters |
Responses
Request samples
- Payload
{- "display_name": "string",
- "legal_name": "string"
}Response samples
- 201
- 400
- 403
{- "merchant": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "display_name": "string",
- "legal_name": "string",
- "status": "inactive",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Read merchant including CLOSED
Authorizations:
path Parameters
| uuid required | string <uuid> |
Responses
Response samples
- 200
- 404
{- "merchant": {
- "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",
- "display_name": "string",
- "legal_name": "string",
- "status": "inactive",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
}Activate merchant
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Deactivate merchant
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Suspend merchant
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Close merchant (terminal)
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Ensure identity is attached
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| identity_uuid required | string <uuid> |
Responses
Request samples
- Payload
{- "identity_uuid": "625f3b1a-870d-4a79-a558-901ea431d4eb"
}List merchant machine API credentials
Human platform_admin with privileged MFA. Lists key_id and status only. Never returns token, secret, or secret_hash. Machine bearer is forbidden (403).
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 200
- 401
- 403
- 404
{- "credentials": [
- {
- "credential_uuid": "17377ab6-a94f-4768-9f7f-939b5fbc9d4b",
- "merchant_uuid": "ec27f24b-dbba-4c9a-aed0-9cec1c3b9e51",
- "key_id": "stringstringstringstringstringst",
- "status": "active",
- "created_at": "2019-08-24T14:15:22Z",
- "last_used_at": "2019-08-24T14:15:22Z",
- "revoked_at": "2019-08-24T14:15:22Z",
- "replaced_by_uuid": "88233dd3-89a8-49d8-a2b2-3fa9608b42ef"
}
]
}Create the merchant machine API credential
Human platform_admin with privileged MFA. At most one active credential per merchant. The plaintext token is returned once. Duplicate active create is 409.
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 201
- 401
- 403
- 404
- 409
{- "credential_uuid": "17377ab6-a94f-4768-9f7f-939b5fbc9d4b",
- "merchant_uuid": "ec27f24b-dbba-4c9a-aed0-9cec1c3b9e51",
- "key_id": "stringstringstringstringstringst",
- "status": "active",
- "created_at": "2019-08-24T14:15:22Z",
- "token": "string"
}Rotate the active merchant machine API credential
Human platform_admin with privileged MFA. Atomically revokes the previous active credential and issues a new token once. Rotate without an active credential is 409.
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 200
- 401
- 403
- 404
- 409
{- "credential_uuid": "17377ab6-a94f-4768-9f7f-939b5fbc9d4b",
- "merchant_uuid": "ec27f24b-dbba-4c9a-aed0-9cec1c3b9e51",
- "key_id": "stringstringstringstringstringst",
- "status": "active",
- "created_at": "2019-08-24T14:15:22Z",
- "token": "string"
}Revoke a merchant machine API credential
Human platform_admin with privileged MFA. Machine bearer is forbidden (403).
Authorizations:
path Parameters
| uuid required | string <uuid> |
| credential_uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Responses
Response samples
- 401
- 403
- 404
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Close the open rule and create a new version
Authorizations:
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| capability required | string |
| jurisdiction required | string |
| effect required | string Enum: "allow" "deny" |
Responses
Request samples
- Payload
{- "capability": "crypto.payin",
- "jurisdiction": "BR",
- "effect": "allow"
}Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Ensure merchant operating profile
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| operating_mode required | string Enum: "non_custodial" "platform_custody" "hybrid" |
Responses
Request samples
- Payload
{- "operating_mode": "non_custodial"
}Close the open policy for the scope and create a new version
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| scope required | string Enum: "payin" "payout" "custody" "settlement" |
| effect required | string Enum: "allow" "deny" |
Responses
Request samples
- Payload
{- "scope": "payin",
- "effect": "allow"
}Response samples
- 409
{- "error": {
- "code": "AUTH_INVALID_CREDENTIALS",
- "message": "string",
- "request_id": "string"
}
}Ensure a merchant provider binding
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| provider_uuid required | string <uuid> |
| capability required | string |
| jurisdiction required | string |
Responses
Request samples
- Payload
{- "provider_uuid": "3bed8db6-d8fa-463d-b321-c9d45dadd5e2",
- "capability": "crypto.payin",
- "jurisdiction": "BR"
}Ensure a merchant provider connection
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| provider_uuid required | string <uuid> |
| secret_reference | string |
Responses
Request samples
- Payload
{- "provider_uuid": "3bed8db6-d8fa-463d-b321-c9d45dadd5e2",
- "secret_reference": "testvault://merchant/example/provider/credential-1"
}Rotate a merchant provider connection secret reference
Authorizations:
path Parameters
| uuid required | string <uuid> |
| connection_uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
Request Body schema: application/jsonrequired
| secret_reference required | string |
Responses
Request samples
- Payload
{- "secret_reference": "testvault://merchant/example/provider/credential-2"
}Create a merchant pay-in intent
Human merchant membership or merchant machine credential with merchant.payin.create. Path merchant UUID must match the machine credential merchant (mismatch is 403) before resource lookup. Cookie XOR bearer. CSRF required for cookie mutations. Financial authorization uses existing crypto.payin. Funds flow class is always merchant_controlled. Succeeded responses are 201, including idempotent replay. Request field for merchant correlation is reference (not merchant_reference). Do not send rail; routing selects it and returns it on 201. Idempotency-Key is required. Same key + same payload replays 201. Same key + different payload is 400.
Authorizations:
path Parameters
| uuid required | string <uuid> |
header Parameters
| X-CSRF-Token | string Required for cookie-authenticated mutations. |
| Idempotency-Key required | string [ 1 .. 64 ] characters |
Request Body schema: application/jsonrequired
| asset required | string |
| amount required | string |
| jurisdiction required | string = 2 characters |
| expires_at required | string <date-time> |
| reference | string <= 255 characters |
Responses
Request samples
- Payload
{- "asset": "usdt",
- "amount": "1.25",
- "jurisdiction": "st",
- "expires_at": "2019-08-24T14:15:22Z",
- "reference": "string"
}Response samples
- 201
- 400
- 401
- 403
- 409
- 500
{- "intent_uuid": "90bc1a1e-e438-4b5f-8358-bba429174bab",
- "status": "created",
- "asset": "string",
- "rail": "string",
- "expected_amount": "string",
- "address": "string",
- "allocation_reference": "string",
- "expires_at": "2019-08-24T14:15:22Z"
}List merchant pay-in intents
Human merchant membership or merchant machine credential with merchant.payin.read. Path merchant UUID must match the machine credential merchant (mismatch is 403) before resource lookup. Cookie XOR bearer.
Authorizations:
path Parameters
| uuid required | string <uuid> |
query Parameters
| limit | integer [ 1 .. 100 ] Default: 20 |
| offset | integer >= 0 Default: 0 |
| status | string Enum: "created" "awaiting_payment" "paid" |
| asset | string |
Responses
Response samples
- 200
- 401
- 403
{- "data": [
- {
- "intent_uuid": "90bc1a1e-e438-4b5f-8358-bba429174bab",
- "status": "created",
- "asset": "usdt",
- "rail": "bep20",
- "expected_amount": "1.00000000",
- "reference": "order-12345",
- "created_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z"
}
], - "pagination": {
- "total": 0,
- "limit": 0,
- "offset": 0
}
}Get single merchant pay-in intent
Human merchant membership or merchant machine credential with merchant.payin.read. Path merchant UUID must match the machine credential merchant (mismatch is 403) before lookup. Missing or cross-merchant intent is 404. Cookie XOR bearer.
Authorizations:
path Parameters
| merchant_uuid required | string <uuid> |
| intent_uuid required | string <uuid> |
Responses
Response samples
- 200
- 401
- 403
- 404
{- "intent_uuid": "90bc1a1e-e438-4b5f-8358-bba429174bab",
- "merchant_uuid": "ec27f24b-dbba-4c9a-aed0-9cec1c3b9e51",
- "status": "created",
- "asset": "usdt",
- "rail": "bep20",
- "expected_amount": "1.00000000",
- "address": "0x1234567890abcdef1234567890abcdef12345678",
- "reference": "order-12345",
- "created_at": "2019-08-24T14:15:22Z",
- "expires_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Public YooCheckout payer-safe status
Narrow JSON for hosted checkout polling. Invalid token is a generic 404. paid is true only when the canonical pay-in intent status is paid. expired_for_payment is presentation-only and does not mutate PAY-IN. HTML checkout pages are not part of this API.
path Parameters
| token required | string |
Responses
Response samples
- 200
- 404
- 429
{- "presentation_state": "select_method",
- "description": "string",
- "merchant_display_name": "string",
- "expected_amount": "string",
- "expires_at": "2019-08-24T14:15:22Z",
- "paid": true,
- "expired_for_payment": true,
- "asset": "string",
- "rail": "string",
- "address": "string",
- "pay_in_status": "created"
}