{
  "schema_version": "2026-09-15",
  "title": "RockPay public API",
  "documentation": {
    "html": "/docs",
    "markdown": "/v1/docs?format=markdown",
    "integration_skill": "/v1/docs?format=integration-skill",
    "data_skill": "/v1/docs?format=data-skill",
    "management_reference": "/v1/docs?format=management-reference",
    "route_inventory": "/v1/docs?format=route-inventory"
  },
  "api": {
    "base_url": "https://rockpay.ai",
    "checkout_base_url": "https://checkout.rockpay.ai",
    "shortpay_version": "2025-03-31.basil",
    "version_header": "ShortPay-Version",
    "event_signature_header": "ShortPay-Signature",
    "authentication": "Bearer single-site server key required for every /v1 business endpoint",
    "write_content_type": "application/x-www-form-urlencoded",
    "idempotency": {"header": "Idempotency-Key", "required": false, "scope": "site and operation", "max_length": 200}
  },
  "resources": [
    {"method":"GET","path":"/v1/account","auth":"site_bearer","summary":"Stable site account identity; capability flags are unknown."},
    {"method":"GET","path":"/v1/charges","auth":"site_bearer","query":{"limit":"1..100","starting_after":"charge ID","ending_before":"charge ID","created":"Unix second or gt/gte/lt/lte"},"response":"List of confirmed charges"},
    {"method":"GET","path":"/v1/events","auth":"site_bearer","query":{"limit":"1..100","starting_after":"event ID","ending_before":"event ID","created":"Unix second or gt/gte/lt/lte","types[]":"charge.succeeded only"},"response":"List of immutable charge.succeeded snapshots"},
    {"method":"POST","path":"/v1/customers","auth":"site_bearer","form":{"email":"optional valid email","name":"optional string","address":"optional country/postal_code/line1/line2/city/state","metadata":"optional string map"},"response":"customer"},
    {"method":"GET","path":"/v1/customers/{customer_id}","auth":"site_bearer","response":"customer"},
    {"method":"POST","path":"/v1/customers/{customer_id}","auth":"site_bearer","form":{"email":"optional valid email","name":"optional string","address":"optional address fields","metadata":"optional string map"},"response":"customer"},
    {"method":"POST","path":"/v1/checkout/sessions","auth":"site_bearer","form":{"mode":"payment","line_items":"1..100 contiguous indexed price_data + quantity","success_url":"allowed HTTPS origin","cancel_url":"allowed HTTPS origin","customer":"optional customer ID","customer_email":"optional email","customer_creation":"if_required|always","customer_update[address]":"auto|never","client_reference_id":"optional string","metadata":"optional string map"},"response":"checkout.session with purchaser url"},
    {"method":"GET","path":"/v1/checkout/sessions/{session_id}","auth":"site_bearer","query":{"expand[]":"line_items only"},"response":"checkout.session","summary":"Actively verifies the original payment result when an attempt exists; confirmed payment_status=paid; no attempt returns unpaid; inquiry failure returns 502 api_error."},
    {"method":"GET","path":"/v1/checkout/sessions/{session_id}/line_items","auth":"site_bearer","response":"List of line items"},
    {"method":"POST","path":"/v1/checkout/sessions/{session_id}/expire","auth":"site_bearer","form":{},"response":"expired checkout.session"},
    {"method":"GET","path":"/v1/payment_intents/{intent_id}","auth":"site_bearer","response":"payment_intent","summary":"Actively verifies the original payment result when an attempt exists; confirmed status=succeeded; no attempt returns requires_payment_method; inquiry failure returns 502 api_error."},
    {"method":"POST","path":"/v1/refunds","auth":"site_bearer","form":{"payment_intent":"required ID","amount":"optional positive minor-unit integer","reason":"duplicate|fraudulent|requested_by_customer","metadata":"optional string map"},"response":"refund"},
    {"method":"GET","path":"/v1/refunds/{refund_id}","auth":"site_bearer","response":"refund"}
  ],
  "events": ["payment_intent.succeeded","payment_intent.payment_failed","checkout.session.completed","checkout.session.expired","refund.updated","refund.failed"],
  "merchant_webhook": {"site_field":"event_url","method":"POST","content_type":"application/json","signature_header":"ShortPay-Signature","signature_scheme":"t=<unix-seconds>,v1=<hex HMAC-SHA256(event_secret, timestamp + '.' + raw body bytes)>","acknowledge":"Any 2xx after durable storage; no redirect following","timeout_seconds":10,"max_attempts":10,"delivery_lookup":"GET /management/events/{id}/delivery","undelivered_retry":"POST /management/events/{id}/retry","documentation":"/v1/docs?format=markdown"},
  "errors": {"shape":{"error":{"type":"string","message":"string","param":"string|null","code":"string|null"}},"status_codes":{"400":"invalid request or unsupported version/state","401":"missing or invalid key","403":"non-site credential","404":"missing or cross-site resource","409":"idempotency conflict","413":"request too large","502":"payment inquiry unavailable, unverified, or finality unconfirmed","503":"refund provider unavailable"}},
  "private_management_reference": {"documentation":"/v1/docs?format=management-reference","paths":["/management/customers","/management/checkout-sessions","/management/payments","/management/refunds","/management/invoices","/management/events","/admin/auth","/v1/merchants","/v1/sites","/checkout-api/..."],"access":"not public; existing authentication and authorization remain required"},
  "unsupported":["subscriptions","cross-account delegation","browser payment SDKs","saved cards","capture","tax","shipping","discounts","arbitrary expand","settlement reports","read-only API keys"]
}
