cURL
#!/usr/bin/env bash
# Revoke a refresh token. Requires a valid Bearer access token. Idempotent:
# 204 whether the token was found, already revoked, or unknown.
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}"
curl -sS -o /dev/null -w '%{http_code}\n' -X POST "$API_BASE/v1/auth/token/revoke" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN" \
-d @request.json#!/usr/bin/env python3
"""Revoke a refresh token. Requires a Bearer access token. 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 revoke_refresh_token() -> int:
body = json.loads((Path(__file__).parent / "request.json").read_text())
if os.environ.get("RADIUMONE_REFRESH_TOKEN"):
body["refresh_token"] = os.environ["RADIUMONE_REFRESH_TOKEN"]
resp = requests.post(
f"{API_BASE}/v1/auth/token/revoke",
json=body,
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
if resp.status_code != 204:
payload = resp.json() if resp.content else {}
raise RuntimeError(f"auth/token/revoke failed: {payload.get('type') or payload.get('code')} ({resp.status_code})")
return resp.status_code
if __name__ == "__main__":
print(f"revoked (HTTP {revoke_refresh_token()})")
{
"detail": "Request payload failed validation.",
"status": 400,
"title": "Validation Error",
"type": "urn:radiumone:payment-gateway:validation-error"
}{
"detail": "Missing or invalid Bearer token.",
"status": 401,
"title": "Authentication Required",
"type": "urn:radiumone:payment-gateway:authentication-required"
}{
"detail": "An unexpected error occurred.",
"status": 500,
"title": "Internal Server Error",
"type": "urn:radiumone:payment-gateway:internal-error"
}{
"detail": "A downstream dependency is unavailable or did not respond in time. `urn:radiumone:payment-gateway:service-unavailable` carries `retry_allowed` true when the failure came before any work (signing keys unavailable, service starting). `urn:radiumone:payment-gateway:request-deadline-exceeded` carries `retry_allowed` true only for GET/HEAD/OPTIONS -- a mutating request may have reached a host.",
"status": 503,
"title": "Service Unavailable",
"type": "urn:radiumone:payment-gateway:service-unavailable"
}Revoke refresh token - Payments API
Revoke a refresh token so it can’t issue new access tokens. Safe to retry — returns 204 even if the token was already revoked.
POST
/
v1
/
auth
/
token
/
revoke
cURL
#!/usr/bin/env bash
# Revoke a refresh token. Requires a valid Bearer access token. Idempotent:
# 204 whether the token was found, already revoked, or unknown.
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}"
curl -sS -o /dev/null -w '%{http_code}\n' -X POST "$API_BASE/v1/auth/token/revoke" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN" \
-d @request.json#!/usr/bin/env python3
"""Revoke a refresh token. Requires a Bearer access token. 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 revoke_refresh_token() -> int:
body = json.loads((Path(__file__).parent / "request.json").read_text())
if os.environ.get("RADIUMONE_REFRESH_TOKEN"):
body["refresh_token"] = os.environ["RADIUMONE_REFRESH_TOKEN"]
resp = requests.post(
f"{API_BASE}/v1/auth/token/revoke",
json=body,
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
if resp.status_code != 204:
payload = resp.json() if resp.content else {}
raise RuntimeError(f"auth/token/revoke failed: {payload.get('type') or payload.get('code')} ({resp.status_code})")
return resp.status_code
if __name__ == "__main__":
print(f"revoked (HTTP {revoke_refresh_token()})")
{
"detail": "Request payload failed validation.",
"status": 400,
"title": "Validation Error",
"type": "urn:radiumone:payment-gateway:validation-error"
}{
"detail": "Missing or invalid Bearer token.",
"status": 401,
"title": "Authentication Required",
"type": "urn:radiumone:payment-gateway:authentication-required"
}{
"detail": "An unexpected error occurred.",
"status": 500,
"title": "Internal Server Error",
"type": "urn:radiumone:payment-gateway:internal-error"
}{
"detail": "A downstream dependency is unavailable or did not respond in time. `urn:radiumone:payment-gateway:service-unavailable` carries `retry_allowed` true when the failure came before any work (signing keys unavailable, service starting). `urn:radiumone:payment-gateway:request-deadline-exceeded` carries `retry_allowed` true only for GET/HEAD/OPTIONS -- a mutating request may have reached a host.",
"status": 503,
"title": "Service Unavailable",
"type": "urn:radiumone:payment-gateway:service-unavailable"
}Authorizations
Body
application/json
Response
Token revoked (or already revoked / not found). Idempotent.