{"openapi":"3.1.0","info":{"title":"CheckoutRail API","version":"0.1.0","description":"Create hosted cryptocurrency checkouts, read balances, and test signed webhooks. Base-unit amounts are integer strings."},"servers":[{"url":"https://api.checkoutrail.com"}],"security":[{"secretKey":[]}],"paths":{"/v1/payment-methods":{"get":{"operationId":"listPaymentMethods","summary":"List payment methods","responses":{"200":{"description":"Supported methods for this environment. Simulation-only methods cannot receive on-chain transfers.","content":{"application/json":{"schema":{"type":"object","required":["data","environment"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"environment":{"type":"string","enum":["test","live"]}}}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices":{"get":{"operationId":"listInvoices","summary":"List invoices","responses":{"200":{"description":"Invoices"},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"operationId":"createInvoice","summary":"Create an invoice","parameters":[{"in":"header","name":"Idempotency-Key","schema":{"type":"string","maxLength":200}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateInvoice"}}}},"responses":{"201":{"description":"Invoice created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/invoices/{id}":{"get":{"operationId":"getInvoice","summary":"Get an invoice","parameters":[{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"200":{"description":"Invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sandbox/transfers":{"post":{"operationId":"simulateTransfer","summary":"Simulate a Sandbox transfer","description":"Test keys only. Send the same transaction identity with increasing confirmations.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SimulatedTransfer"}}}},"responses":{"200":{"description":"Payment engine result"},"400":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/balances":{"get":{"operationId":"getBalances","summary":"Get available balances","responses":{"200":{"description":"Balances by asset and network"},"401":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/withdrawals":{"post":{"operationId":"createWithdrawal","summary":"Create a withdrawal","description":"Disabled by default. Requires the withdrawals:write scope.","parameters":[{"in":"header","name":"Idempotency-Key","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWithdrawal"}}}},"responses":{"201":{"description":"Withdrawal reserved for review","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/withdrawals/{id}":{"get":{"operationId":"getWithdrawal","summary":"Get a withdrawal","description":"Requires withdrawals:read or withdrawals:write.","parameters":[{"$ref":"#/components/parameters/WithdrawalId"}],"responses":{"200":{"description":"Withdrawal status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Withdrawal"}}}},"403":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Request failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"secretKey":{"type":"http","scheme":"bearer","bearerFormat":"cr_test_sk_… or cr_live_sk_…","description":"Use only in server-side code."}},"parameters":{"InvoiceId":{"in":"path","name":"id","required":true,"schema":{"type":"string","pattern":"^inv_"}},"WithdrawalId":{"in":"path","name":"id","required":true,"schema":{"type":"string","pattern":"^wd_"}}},"schemas":{"PaymentMethod":{"type":"object","required":["id","asset","name","network","standard","decimals","simulation_only","contract_address","confirmations_required","capabilities"],"properties":{"id":{"type":"string","examples":["ethereum:usdc"]},"asset":{"type":"string","examples":["USDC"]},"name":{"type":"string","examples":["USD Coin"]},"network":{"type":"string","examples":["Ethereum"]},"standard":{"type":"string","examples":["ERC20"]},"decimals":{"type":"integer","minimum":0},"simulation_only":{"type":"boolean","description":"This method uses simulated transfers in the current environment. On-chain activation is configured separately."},"contract_address":{"type":["string","null"],"description":"Configured token contract in chain mode; canonical mainnet token identity in simulation. Never a deposit address."},"confirmations_required":{"type":["integer","null"],"minimum":1},"capabilities":{"type":"array","items":{"type":"string","enum":["receive","payout","settlement","convert-from"]}}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}}},"CreateInvoice":{"type":"object","additionalProperties":false,"required":["amount","currency","reference"],"properties":{"amount":{"type":"string","pattern":"^[0-9]+(?:\\.[0-9]{1,2})?$","description":"Minimum 5.00 in the pricing currency.","examples":["125.00"]},"currency":{"type":"string","enum":["USD","USDT"]},"reference":{"type":"string","minLength":1,"maxLength":200,"examples":["order_5041"]}}},"Invoice":{"type":"object","required":["id","amount","currency","reference","status","checkout_url"],"properties":{"id":{"type":"string","examples":["inv_9f3a2b7e6d4c1a8b"]},"amount":{"type":"string","examples":["125.00"]},"currency":{"type":"string"},"reference":{"type":"string"},"environment":{"type":"string","enum":["test","live"]},"status":{"type":"string","enum":["waiting","detected","confirming","paid","expired","underpaid","overpaid"]},"checkout_url":{"type":"string","format":"uri"}}},"SimulatedTransfer":{"type":"object","additionalProperties":false,"required":["asset_id","transaction_id","event_index","destination_address","amount_base_units","block_reference","confirmation_count"],"properties":{"asset_id":{"type":"string","enum":["tron:usdt","bsc:usdt","bsc:bnb","ethereum:usdt","ethereum:eth","bitcoin:btc","litecoin:ltc"]},"transaction_id":{"type":"string"},"event_index":{"type":"integer","minimum":0},"destination_address":{"type":"string"},"amount_base_units":{"type":"string","pattern":"^[1-9][0-9]*$"},"block_reference":{"type":"string"},"confirmation_count":{"type":"integer","minimum":0}}},"CreateWithdrawal":{"type":"object","additionalProperties":false,"required":["amount","network_id","address"],"properties":{"amount":{"type":"string","pattern":"^[0-9]+(?:\\.[0-9]{1,18})?$","examples":["250.00"]},"network_id":{"type":"string","enum":["bsc","tron","ethereum","bitcoin","litecoin","polkadot"]},"asset_id":{"type":"string","description":"Exact asset/network identifier, e.g. ethereum:usdc. Omit to use the network default. Must have payout capability and be enabled for this environment."},"address":{"type":"string"}}},"Withdrawal":{"type":"object","required":["id","status","amount","receiveAmount","network","address"],"properties":{"id":{"type":"string","pattern":"^wd_"},"status":{"type":"string","enum":["under_review","approved","sending","completed","rejected","failed"]},"amount":{"type":"string"},"receiveAmount":{"type":"string"},"networkCost":{"type":"string"},"assetId":{"type":"string"},"networkId":{"type":"string"},"network":{"type":"string"},"address":{"type":"string"},"transactionId":{"type":"string"}}}}}}