#!/usr/bin/env bash
# Rotate the redirect-signature secret. The plaintext is returned exactly
# once — store it immediately. Old and new secrets both verify for a grace
# window after rotation.
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 with the merchant-secret-rotate scope}"
curl -sS -X POST "$API_BASE/v1/merchant/redirect-secret/rotate" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN"#!/usr/bin/env python3
"""Rotate the redirect-signature secret. The plaintext is returned exactly
once — store it immediately.
"""
import json
import os
import requests
API_BASE = os.environ.get("RADIUMONE_API_BASE", "https://api-sandbox.radiumone.io/gateway")
def rotate_redirect_secret() -> dict:
resp = requests.post(
f"{API_BASE}/v1/merchant/redirect-secret/rotate",
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
payload = resp.json()
if not resp.ok:
code = payload.get("type") or payload.get("code")
raise RuntimeError(f"redirect-secret rotate failed: {code} ({resp.status_code})")
# Never log payload["data"]["redirect_secret"] — store it in your secret manager only.
return payload
if __name__ == "__main__":
print(json.dumps(rotate_redirect_secret(), indent=2))
{
"data": {
"redirect_secret": "<string>",
"rotated_at": "<string>"
},
"message": "<string>",
"request_id": "<string>",
"status": "ok"
}{
"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": "A resource with that identifier already exists.",
"status": 409,
"title": "Conflict",
"type": "urn:radiumone:gateway:conflict"
}{
"detail": "The payment token has expired or its card data is no longer available.",
"status": 410,
"title": "Gone",
"type": "urn:radiumone:gateway:gone"
}{
"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"
}Rotate redirect secret - Payments API
Generate a new secret for signing hosted checkout redirects. The response contains the new secret in plaintext, so store it securely right away.
#!/usr/bin/env bash
# Rotate the redirect-signature secret. The plaintext is returned exactly
# once — store it immediately. Old and new secrets both verify for a grace
# window after rotation.
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 with the merchant-secret-rotate scope}"
curl -sS -X POST "$API_BASE/v1/merchant/redirect-secret/rotate" \
-H "Authorization: Bearer $RADIUMONE_ACCESS_TOKEN"#!/usr/bin/env python3
"""Rotate the redirect-signature secret. The plaintext is returned exactly
once — store it immediately.
"""
import json
import os
import requests
API_BASE = os.environ.get("RADIUMONE_API_BASE", "https://api-sandbox.radiumone.io/gateway")
def rotate_redirect_secret() -> dict:
resp = requests.post(
f"{API_BASE}/v1/merchant/redirect-secret/rotate",
headers={"Authorization": f"Bearer {os.environ.get('RADIUMONE_ACCESS_TOKEN', '')}"},
timeout=30,
)
payload = resp.json()
if not resp.ok:
code = payload.get("type") or payload.get("code")
raise RuntimeError(f"redirect-secret rotate failed: {code} ({resp.status_code})")
# Never log payload["data"]["redirect_secret"] — store it in your secret manager only.
return payload
if __name__ == "__main__":
print(json.dumps(rotate_redirect_secret(), indent=2))
{
"data": {
"redirect_secret": "<string>",
"rotated_at": "<string>"
},
"message": "<string>",
"request_id": "<string>",
"status": "ok"
}{
"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": "A resource with that identifier already exists.",
"status": 409,
"title": "Conflict",
"type": "urn:radiumone:gateway:conflict"
}{
"detail": "The payment token has expired or its card data is no longer available.",
"status": 410,
"title": "Gone",
"type": "urn:radiumone:gateway:gone"
}{
"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.
Response
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.