{"openapi":"3.1.0","info":{"title":"CheatGateway Sandbox API","version":"1.0.0","description":"Server-to-server sandbox only. No real payments, card collection, refunds, settlements or webhook delivery. Keys are available in the merchant Developers panel after MFA. Never fulfil real orders from test results.","termsOfService":"https://cheatgateway.net/terms"},"servers":[{"url":"https://cheatgateway.net/api/v1","description":"Sandbox"}],"security":[{"bearerAuth":[]}],"paths":{"/account":{"get":{"operationId":"getAccount","summary":"Read the current workspace and API capabilities","responses":{"200":{"description":"Sandbox account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"400":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait. Application limits return 60."}}},"500":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payment-intents":{"post":{"operationId":"createPaymentIntent","summary":"Create a sandbox payment intent","description":"Requires payments:write. Idempotency persists for the retained intent, scoped to the workspace across key rotation. Same input replays with 200; changed input returns 409. Maximum 10,000 test intents per workspace.","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string","minLength":16,"maxLength":100,"pattern":"^[A-Za-z0-9_-]{16,100}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentIntent"}}}},"responses":{"200":{"description":"Idempotent replay (current intent state)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}},"headers":{"Idempotent-Replayed":{"schema":{"type":"string","const":"true"}}}},"201":{"description":"Sandbox payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait. Application limits return 60."}}},"500":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payment-intents/{id}":{"get":{"operationId":"getPaymentIntent","summary":"Retrieve a workspace-owned test intent","description":"Requires payments:read. Another workspace’s ID returns 404.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","pattern":"^pi_test_[a-f0-9-]{36}$"}}],"responses":{"200":{"description":"Sandbox payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait. Application limits return 60."}}},"500":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/payment-intents/{id}/simulate":{"post":{"operationId":"simulatePaymentIntent","summary":"Simulate a test payment outcome","description":"Requires payments:simulate. Pending may transition to succeeded or failed. Repeating the same terminal outcome returns 200; a different outcome returns 409.","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string","pattern":"^pi_test_[a-f0-9-]{36}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["outcome"],"properties":{"outcome":{"type":"string","enum":["succeeded","failed"]}}}}}},"responses":{"200":{"description":"Sandbox payment intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntent"}}}},"400":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait. Application limits return 60."}}},"500":{"description":"Request failed. See the error code and request ID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"cg_test_ secret. HTTPS server requests only; Origin and Cookie headers are rejected. 60 requests/minute/workspace and 120 attempts/minute/IP."}},"schemas":{"CreatePaymentIntent":{"type":"object","additionalProperties":false,"required":["amount_minor","currency","reference"],"properties":{"amount_minor":{"type":"integer","minimum":1,"maximum":10000000,"description":"USD cents"},"currency":{"type":"string","const":"USD"},"reference":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[A-Za-z0-9_-]{1,100}$","description":"Synthetic order reference. No personal information."},"livemode":{"type":"boolean","const":false}}},"PaymentIntent":{"type":"object","required":["id","object","livemode","amount_minor","currency","reference","status","created_at","updated_at"],"additionalProperties":false,"properties":{"id":{"type":"string","pattern":"^pi_test_[a-f0-9-]{36}$"},"object":{"type":"string","const":"payment_intent"},"livemode":{"type":"boolean","const":false},"amount_minor":{"type":"integer"},"currency":{"type":"string","const":"USD"},"reference":{"type":"string"},"status":{"type":"string","enum":["pending","succeeded","failed"]},"created_at":{"type":"integer","format":"int64","description":"Unix milliseconds"},"updated_at":{"type":"integer","format":"int64","description":"Unix milliseconds"}}},"Account":{"type":"object","required":["id","environment","livemode","capabilities","scopes"],"properties":{"id":{"type":"string"},"environment":{"type":"string","const":"sandbox"},"livemode":{"type":"boolean","const":false},"scopes":{"type":"array","items":{"type":"string","enum":["payments:read","payments:write","payments:simulate"]}},"capabilities":{"type":"object","required":["sandbox_payments","live_payments","webhooks"],"properties":{"sandbox_payments":{"type":"boolean","const":true},"live_payments":{"type":"boolean","const":false},"webhooks":{"type":"boolean","const":false}}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message","request_id"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string","format":"uuid"}}}}}}}}