#!/usr/bin/env bash
# Confirm a card token is bound to a session before your server trusts it.
set -euo pipefail
API_BASE="${RADIUMONE_API_BASE:-https://api-sandbox.radiumone.io/gateway}"
: "${RADIUMONE_ACCESS_TOKEN:?set RADIUMONE_ACCESS_TOKEN to a Bearer access token}"
: "${RADIUMONE_SESSION_ID:?set RADIUMONE_SESSION_ID to the session to verify}"
curl -sS -X POST "$API_BASE/v1/sessions/$RADIUMONE_SESSION_ID/verify" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN" \
-d @request.json#!/usr/bin/env python3
"""Confirm a card token is bound to a session. Python 3.10+, requests."""
import json
import os
from pathlib import Path
import requests
API_BASE = os.environ.get("RADIUMONE_API_BASE", "https://api-sandbox.radiumone.io/gateway")
def verify_session_token() -> dict:
body = json.loads((Path(__file__).parent / "request.json").read_text())
session_id = os.environ["RADIUMONE_SESSION_ID"]
resp = requests.post(
f"{API_BASE}/v1/sessions/{session_id}/verify",
json=body,
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
payload = resp.json()
if not resp.ok:
# 422 token:verification-failed on a mismatch.
code = payload.get("type") or payload.get("code")
raise RuntimeError(f"sessions verify failed: {code} ({resp.status_code})")
return payload
if __name__ == "__main__":
print(json.dumps(verify_session_token(), indent=2))
{
"data": {
"session_id": "<string>",
"status": "<string>",
"token": "<string>"
},
"message": "<string>",
"request_id": "<string>",
"status": "ok"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"code": "<string>",
"retry_allowed": true,
"errors": [
{
"pointer": "<string>",
"parameter": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"detail": "Missing or invalid Bearer token.",
"status": 401,
"title": "Authentication Required",
"type": "urn:radiumone:gateway:authentication-required"
}{
"detail": "Insufficient permissions for this operation.",
"status": 403,
"title": "Permission Denied",
"type": "urn:radiumone:gateway:permission-denied"
}{
"detail": "The requested resource does not exist.",
"status": 404,
"title": "Not Found",
"type": "urn:radiumone:gateway:not-found"
}{
"detail": "Your merchant account is not yet set up for card tokenization and could not be set up automatically. Retry later; contact support if the problem continues.",
"status": 409,
"title": "Merchant Not Provisioned",
"type": "urn:radiumone:gateway:merchant-not-provisioned"
}{
"detail": "Too many bind attempts for this session; the session is temporarily locked. This is a lockout, not a transient error -- do not auto-retry.",
"status": 429,
"title": "Bind Rate Limit",
"type": "urn:radiumone:gateway:bind-rate-limit"
}{
"detail": "An unexpected error occurred.",
"status": 500,
"title": "Internal Server Error",
"type": "urn:radiumone:gateway:internal-server-error"
}{
"detail": "A downstream dependency is unavailable or did not respond in time.",
"status": 503,
"title": "Service Unavailable",
"type": "urn:radiumone:gateway:service-unavailable"
}Verify session token - Payments API
Confirm that a card token belongs to a tokenization session your merchant account owns before you charge it.
#!/usr/bin/env bash
# Confirm a card token is bound to a session before your server trusts it.
set -euo pipefail
API_BASE="${RADIUMONE_API_BASE:-https://api-sandbox.radiumone.io/gateway}"
: "${RADIUMONE_ACCESS_TOKEN:?set RADIUMONE_ACCESS_TOKEN to a Bearer access token}"
: "${RADIUMONE_SESSION_ID:?set RADIUMONE_SESSION_ID to the session to verify}"
curl -sS -X POST "$API_BASE/v1/sessions/$RADIUMONE_SESSION_ID/verify" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN" \
-d @request.json#!/usr/bin/env python3
"""Confirm a card token is bound to a session. Python 3.10+, requests."""
import json
import os
from pathlib import Path
import requests
API_BASE = os.environ.get("RADIUMONE_API_BASE", "https://api-sandbox.radiumone.io/gateway")
def verify_session_token() -> dict:
body = json.loads((Path(__file__).parent / "request.json").read_text())
session_id = os.environ["RADIUMONE_SESSION_ID"]
resp = requests.post(
f"{API_BASE}/v1/sessions/{session_id}/verify",
json=body,
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
payload = resp.json()
if not resp.ok:
# 422 token:verification-failed on a mismatch.
code = payload.get("type") or payload.get("code")
raise RuntimeError(f"sessions verify failed: {code} ({resp.status_code})")
return payload
if __name__ == "__main__":
print(json.dumps(verify_session_token(), indent=2))
{
"data": {
"session_id": "<string>",
"status": "<string>",
"token": "<string>"
},
"message": "<string>",
"request_id": "<string>",
"status": "ok"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>",
"request_id": "<string>",
"code": "<string>",
"retry_allowed": true,
"errors": [
{
"pointer": "<string>",
"parameter": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}{
"detail": "Missing or invalid Bearer token.",
"status": 401,
"title": "Authentication Required",
"type": "urn:radiumone:gateway:authentication-required"
}{
"detail": "Insufficient permissions for this operation.",
"status": 403,
"title": "Permission Denied",
"type": "urn:radiumone:gateway:permission-denied"
}{
"detail": "The requested resource does not exist.",
"status": 404,
"title": "Not Found",
"type": "urn:radiumone:gateway:not-found"
}{
"detail": "Your merchant account is not yet set up for card tokenization and could not be set up automatically. Retry later; contact support if the problem continues.",
"status": 409,
"title": "Merchant Not Provisioned",
"type": "urn:radiumone:gateway:merchant-not-provisioned"
}{
"detail": "Too many bind attempts for this session; the session is temporarily locked. This is a lockout, not a transient error -- do not auto-retry.",
"status": 429,
"title": "Bind Rate Limit",
"type": "urn:radiumone:gateway:bind-rate-limit"
}{
"detail": "An unexpected error occurred.",
"status": 500,
"title": "Internal Server Error",
"type": "urn:radiumone:gateway:internal-server-error"
}{
"detail": "A downstream dependency is unavailable or did not respond in time.",
"status": 503,
"title": "Service Unavailable",
"type": "urn:radiumone:gateway:service-unavailable"
}Authorizations
Bearer access token from POST /v1/auth/token. Treat it as an opaque string — do not depend on its internal encoding, which has changed before and isn't part of the contract.
Path Parameters
Tokenization session identifier.
64Body
Request body for POST /v1/sessions/{id}/verify.
EMV-numeric payment token to verify against the session.
1 - 64Response
Successful Response
Standard success envelope. Every successful response has this shape, with the operation's own payload under data.
The operation's result. Its shape is documented per operation; omitted on responses that carry no payload.
Show child attributes
Show child attributes
Optional human-readable note. Omitted from the response when not set, which is the case for every payment operation today. Never parse it.
Correlation ID for this HTTP request, for logs and support. Send your own in the X-Request-Id header (letters, digits and hyphens, up to 36 characters -- other characters are stripped) or the gateway generates one. This is NOT the request_id idempotency key you send in a transaction body; the two are unrelated.
Always ok on a successful (2xx) response. Errors use a different body shape entirely (RFC 9457 problem details), so branch on the HTTP status code, not on this field.