{"openapi":"3.1.0","info":{"title":"paykit","description":"Non-custodial USDC/USDT checkout on Arbitrum One. Merchant quickstart: https://paykit.octomatica.ru/docs · Agent guide: https://paykit.octomatica.ru/llms.txt · Wire contract: https://paykit.octomatica.ru/docs/quickstart.md","version":"0.1.0"},"paths":{"/api/auth/request_link":{"post":{"tags":["auth"],"summary":"Request Link","operationId":"request_link_api_auth_request_link_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestLinkBody"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/callback":{"get":{"tags":["auth"],"summary":"Callback","operationId":"callback_api_auth_callback_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/methods":{"get":{"tags":["auth"],"summary":"Auth Methods","operationId":"auth_methods_api_auth_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/auth/register":{"post":{"tags":["auth"],"summary":"Register","operationId":"register_api_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegisterBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/login":{"post":{"tags":["auth"],"summary":"Login","operationId":"login_api_auth_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oidc/{provider_id}/start":{"get":{"tags":["auth"],"summary":"Oidc Start","operationId":"oidc_start_api_auth_oidc__provider_id__start_get","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"next","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/oidc/{provider_id}/callback":{"get":{"tags":["auth"],"summary":"Oidc Callback","operationId":"oidc_callback_api_auth_oidc__provider_id__callback_get","parameters":[{"name":"provider_id","in":"path","required":true,"schema":{"type":"string","title":"Provider Id"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/change_password":{"post":{"tags":["auth"],"summary":"Change Password","description":"Self-service password change. Accounts that already have a password\nmust present the current one; magic-link/OIDC accounts set their first\npassword without it.","operationId":"change_password_api_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePasswordBody"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_auth_logout_post","responses":{"204":{"description":"Successful Response"}}}},"/api/me":{"get":{"tags":["auth"],"summary":"Me","operationId":"me_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dashboard/merchants":{"post":{"tags":["dashboard"],"summary":"Create Merchant","operationId":"create_merchant_api_dashboard_merchants_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMerchantBody"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/api_keys":{"get":{"tags":["dashboard"],"summary":"List Api Keys","operationId":"list_api_keys_api_dashboard_merchants__merchant_id__api_keys_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["dashboard"],"summary":"Create Api Key Endpoint","operationId":"create_api_key_endpoint_api_dashboard_merchants__merchant_id__api_keys_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/api_keys/{api_key_id}":{"delete":{"tags":["dashboard"],"summary":"Revoke Api Key","operationId":"revoke_api_key_api_dashboard_merchants__merchant_id__api_keys__api_key_id__delete","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"api_key_id","in":"path","required":true,"schema":{"type":"integer","title":"Api Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/webhook_endpoints":{"get":{"tags":["dashboard"],"summary":"List Webhook Endpoints","operationId":"list_webhook_endpoints_api_dashboard_merchants__merchant_id__webhook_endpoints_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["dashboard"],"summary":"Create Webhook Endpoint","operationId":"create_webhook_endpoint_api_dashboard_merchants__merchant_id__webhook_endpoints_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWebhookEndpointBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/webhook_endpoints/{endpoint_id}":{"patch":{"tags":["dashboard"],"summary":"Update Webhook Endpoint","operationId":"update_webhook_endpoint_api_dashboard_merchants__merchant_id__webhook_endpoints__endpoint_id__patch","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateWebhookEndpointBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["dashboard"],"summary":"Delete Webhook Endpoint","operationId":"delete_webhook_endpoint_api_dashboard_merchants__merchant_id__webhook_endpoints__endpoint_id__delete","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/webhook_deliveries":{"get":{"tags":["dashboard"],"summary":"List Webhook Deliveries","operationId":"list_webhook_deliveries_api_dashboard_merchants__merchant_id__webhook_deliveries_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["pending","delivered","failed"],"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/webhook_deliveries/{delivery_id}/replay":{"post":{"tags":["dashboard"],"summary":"Replay Webhook Delivery","operationId":"replay_webhook_delivery_api_dashboard_merchants__merchant_id__webhook_deliveries__delivery_id__replay_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","title":"Delivery Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/payments":{"get":{"tags":["dashboard"],"summary":"List Payments","operationId":"list_payments_api_dashboard_merchants__merchant_id__payments_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/sessions":{"get":{"tags":["dashboard"],"summary":"List Sessions","operationId":"list_sessions_api_dashboard_merchants__merchant_id__sessions_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["dashboard"],"summary":"Create Payment Link","description":"Payment link minted by hand from the dashboard — the same session the\nAPI creates, same gates (approval, treasury, $1 minimum, tier cap), no\nbackend required. Status is followed on the Sessions page.","operationId":"create_payment_link_api_dashboard_merchants__merchant_id__sessions_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePaymentLinkBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}":{"patch":{"tags":["dashboard"],"summary":"Update Merchant","description":"Owner/admin edits what buyers see on the pay page: display name and\nsupport email. `email: \"\"` clears it.","operationId":"update_merchant_api_dashboard_merchants__merchant_id__patch","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateMerchantBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/wallets":{"get":{"tags":["dashboard"],"summary":"Get Wallets","operationId":"get_wallets_api_dashboard_merchants__merchant_id__wallets_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/wallets/generate":{"post":{"tags":["dashboard"],"summary":"Generate Wallets","description":"One-click flow: paykit generates a fresh treasury keypair and returns\nits private key ONCE; merchant must capture and save offline. The\ntreasury private key is NEVER stored server-side — only the address.\nNo relayer is created: sweep gas is paid by the platform relayer.\n\nCalling it again replaces the treasury: future sweeps go to the new\naddress (the dashboard warns first). Owner only, audited.","operationId":"generate_wallets_api_dashboard_merchants__merchant_id__wallets_generate_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/usage":{"get":{"tags":["dashboard"],"summary":"Get Usage","description":"Per-month usage rollup — payments_count + settled volume. Drives\nthe billing UI once Phase 4 Stripe integration lands.","operationId":"get_usage_api_dashboard_merchants__merchant_id__usage_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/wallets/bring_own":{"post":{"tags":["dashboard"],"summary":"Bring Own Wallets","description":"Bring-your-own flow: merchant pastes their treasury address and,\noptionally, a relayer private key to pay their own gas. Paykit\nvalidates, encrypts the relayer key if given, never sees the treasury\nkey. Without a relayer key the merchant is on platform gas (and any\npreviously stored relayer is dropped). Owner only, audited.","operationId":"bring_own_wallets_api_dashboard_merchants__merchant_id__wallets_bring_own_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BringOwnWalletsBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/billing":{"get":{"tags":["dashboard"],"summary":"Get Billing","operationId":"get_billing_api_dashboard_merchants__merchant_id__billing_get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/billing/pay":{"post":{"tags":["dashboard"],"summary":"Billing Pay","description":"Mint (or reuse) the $29 Pro invoice and hand back its pay link.","operationId":"billing_pay_api_dashboard_merchants__merchant_id__billing_pay_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/dashboard/merchants/{merchant_id}/webhook_endpoints/{endpoint_id}/test":{"post":{"tags":["dashboard"],"summary":"Send Test Event","description":"Queue a test delivery to one endpoint: signed like a real event, `data.test`\nis true, ids and hashes are zeros. Goes out on the next dispatcher tick.","operationId":"send_test_event_api_dashboard_merchants__merchant_id__webhook_endpoints__endpoint_id__test_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}},{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"integer","title":"Endpoint Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestEventBody"}}}},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants":{"get":{"tags":["admin"],"summary":"List Merchants","operationId":"list_merchants_api_admin_merchants_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/users":{"get":{"tags":["admin"],"summary":"List Users","description":"All registered accounts with their merchant memberships.","operationId":"list_users_api_admin_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/users/{user_id}/reset_password":{"post":{"tags":["admin"],"summary":"Reset User Password","description":"Issue a temporary password (shown once) so a locked-out user can sign\nin with email + password. Replaces any existing password.","operationId":"reset_user_password_api_admin_users__user_id__reset_password_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"integer","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants/{merchant_id}":{"get":{"tags":["admin"],"summary":"Get Merchant","operationId":"get_merchant_api_admin_merchants__merchant_id__get","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin"],"summary":"Patch Merchant","description":"Operator overrides: tier (Custom = `enterprise`), per-tx fee in bps\n(0 for in-house merchants), or a paid-until date (comped Pro).","operationId":"patch_merchant_api_admin_merchants__merchant_id__patch","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PatchMerchantBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants/{merchant_id}/pause":{"post":{"tags":["admin"],"summary":"Pause Merchant","operationId":"pause_merchant_api_admin_merchants__merchant_id__pause_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants/{merchant_id}/unpause":{"post":{"tags":["admin"],"summary":"Unpause Merchant","operationId":"unpause_merchant_api_admin_merchants__merchant_id__unpause_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants/{merchant_id}/approve":{"post":{"tags":["admin"],"summary":"Approve Merchant","description":"Approval gate: `pending` → `active`. Unblocks POST /api/sessions.","operationId":"approve_merchant_api_admin_merchants__merchant_id__approve_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/merchants/{merchant_id}/reject":{"post":{"tags":["admin"],"summary":"Reject Merchant","operationId":"reject_merchant_api_admin_merchants__merchant_id__reject_post","parameters":[{"name":"merchant_id","in":"path","required":true,"schema":{"type":"integer","title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/audit":{"get":{"tags":["admin"],"summary":"List Audit","description":"Newest-first slice of the append-only audit log, with actor/merchant names.","operationId":"list_audit_api_admin_audit_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":200,"title":"Limit"}},{"name":"merchant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Merchant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/health":{"get":{"tags":["admin"],"summary":"Admin Health","description":"Live ops snapshot for the admin panel: the same metrics the health\nworker alerts on, plus the recent failed webhook deliveries.","operationId":"admin_health_api_admin_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/sessions":{"post":{"tags":["sessions"],"summary":"Post Session","operationId":"post_session_api_sessions_post","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Idempotency-Key"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSessionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/sessions/{token}/status":{"get":{"tags":["sessions"],"summary":"Get Session Status","operationId":"get_session_status_api_sessions__token__status_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/pay/{token}":{"get":{"tags":["pay"],"summary":"Pay Page","operationId":"pay_page_pay__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/internal/treasury":{"get":{"tags":["internal"],"summary":"Treasury","operationId":"treasury_api_internal_treasury_get","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/health":{"get":{"summary":"Health","operationId":"health_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"BringOwnWalletsBody":{"properties":{"treasury_address":{"type":"string","maxLength":42,"minLength":42,"title":"Treasury Address"},"relayer_private_key":{"anyOf":[{"type":"string","maxLength":66,"minLength":64},{"type":"null"}],"title":"Relayer Private Key"}},"type":"object","required":["treasury_address"],"title":"BringOwnWalletsBody"},"ChangePasswordBody":{"properties":{"current_password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Current Password"},"new_password":{"type":"string","maxLength":128,"minLength":10,"title":"New Password"}},"type":"object","required":["new_password"],"title":"ChangePasswordBody"},"CreateApiKeyBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Name"}},"type":"object","title":"CreateApiKeyBody"},"CreateMerchantBody":{"properties":{"name":{"type":"string","maxLength":200,"minLength":1,"title":"Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["name"],"title":"CreateMerchantBody"},"CreatePaymentLinkBody":{"properties":{"amount_usd_cents":{"type":"integer","minimum":1.0,"title":"Amount Usd Cents"},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"},"user_external_id":{"type":"integer","title":"User External Id","default":0},"return_url":{"type":"string","maxLength":2000,"title":"Return Url","default":""}},"type":"object","required":["amount_usd_cents"],"title":"CreatePaymentLinkBody"},"CreateSessionRequest":{"properties":{"user_external_id":{"type":"integer","title":"User External Id"},"return_url":{"type":"string","maxLength":2000,"title":"Return Url"},"amount_usd_cents":{"type":"integer","title":"Amount Usd Cents"},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata"}},"type":"object","required":["user_external_id","return_url","amount_usd_cents"],"title":"CreateSessionRequest"},"CreateWebhookEndpointBody":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"CreateWebhookEndpointBody"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"LoginBody":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"title":"Password"}},"type":"object","required":["email","password"],"title":"LoginBody"},"PatchMerchantBody":{"properties":{"fee_tier":{"anyOf":[{"type":"string","enum":["free","pro","enterprise"]},{"type":"null"}],"title":"Fee Tier"},"fee_bps":{"anyOf":[{"type":"integer","maximum":1000.0,"minimum":0.0},{"type":"null"}],"title":"Fee Bps"},"pro_paid_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Pro Paid Until"}},"type":"object","title":"PatchMerchantBody"},"RegisterBody":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":10,"title":"Password"}},"type":"object","required":["email","password"],"title":"RegisterBody"},"RequestLinkBody":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"RequestLinkBody"},"TestEventBody":{"properties":{"event_type":{"type":"string","title":"Event Type","default":"payment.confirmed"}},"type":"object","title":"TestEventBody"},"UpdateMerchantBody":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Name"},"email":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Email"}},"type":"object","title":"UpdateMerchantBody"},"UpdateWebhookEndpointBody":{"properties":{"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"UpdateWebhookEndpointBody"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookEnvelope":{"type":"object","required":["id","type","created","merchant_id","data"],"properties":{"id":{"type":"string","description":"Delivery id `wd_<32 hex>` — the idempotency key; the same id may be delivered more than once."},"type":{"type":"string","enum":["payment.detected","payment.confirmed","payment.late","payment.swept","session.expired"],"description":"New types may be added; ignore unknown types (return 2xx)."},"created":{"type":"integer","description":"Unix seconds. Every other timestamp in the API is ISO-8601 UTC."},"merchant_id":{"type":"integer"},"data":{"description":"Event-specific; see the per-event schemas."}}},"PaymentEventData":{"type":"object","description":"`data` of payment.detected / payment.confirmed / payment.late (confirmed and late add the two *_total fields).","required":["payment_id","session_token","user_external_id","amount_usd_cents","asset","tx_hash","log_index","block_number","from_address"],"properties":{"payment_id":{"type":"integer"},"invoice_id":{"type":["integer","null"]},"session_token":{"type":["string","null"]},"user_external_id":{"type":["integer","null"],"description":"The id you passed at session creation."},"metadata":{"type":["object","null"],"description":"The object you passed at session creation."},"amount_usd_cents":{"type":"integer","description":"This transfer, floored to cents."},"paid_total_usd_cents":{"type":"integer","description":"Running total for the invoice at emit time (confirmed/late only). Not guaranteed monotonic across deliveries — keep the max."},"expected_amount_usd_cents":{"type":"integer","description":"confirmed/late only."},"asset":{"type":"string","enum":["USDC","USDT"]},"token":{"type":"string","deprecated":true,"description":"Alias of `asset`; will be removed."},"tx_hash":{"type":"string"},"log_index":{"type":"integer"},"block_number":{"type":"integer"},"from_address":{"type":"string"},"test":{"type":"boolean","description":"Present and true only on test events sent from the dashboard — do not fulfil."}}},"PaymentSweptData":{"type":"object","required":["payment_id","amount_usd_cents","fee_usd_cents","net_usd_cents","asset","sweep_tx_hash","treasury_address"],"properties":{"payment_id":{"type":"integer"},"invoice_id":{"type":["integer","null"]},"session_token":{"type":["string","null"]},"user_external_id":{"type":["integer","null"]},"metadata":{"type":["object","null"]},"amount_usd_cents":{"type":"integer","description":"Gross."},"fee_usd_cents":{"type":"integer","description":"Platform fee taken at sweep."},"net_usd_cents":{"type":"integer","description":"What reached the treasury."},"asset":{"type":"string","enum":["USDC","USDT"]},"token":{"type":"string","deprecated":true},"tx_hash":{"type":"string"},"log_index":{"type":"integer"},"block_number":{"type":"integer"},"sweep_tx_hash":{"type":"string"},"treasury_address":{"type":"string"},"test":{"type":"boolean"}}},"SessionExpiredData":{"type":"object","required":["invoice_id","session_token","expires_at","amount_usd_cents"],"properties":{"invoice_id":{"type":"integer"},"session_token":{"type":["string","null"]},"user_external_id":{"type":["integer","null"]},"metadata":{"type":["object","null"]},"expires_at":{"type":"string","format":"date-time"},"amount_usd_cents":{"type":"integer"},"test":{"type":"boolean"}}}}},"webhooks":{"payment.detected":{"post":{"summary":"Transfer seen on chain (not yet credited)","description":"Signed with `X-Paykit-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, '<t>.' + raw_body)`. At-least-once, unordered; dedupe on `id`. Any 2xx = delivered; otherwise retried at 1m/5m/30m/2h/12h (15 s timeout, redirects not followed). Full reference: https://paykit.octomatica.ru/llms-full.txt","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentEventData"}}}]}}}},"responses":{"2XX":{"description":"Acknowledged. Anything else is retried."}}}},"payment.confirmed":{"post":{"summary":"Transfer credited to the invoice","description":"Signed with `X-Paykit-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, '<t>.' + raw_body)`. At-least-once, unordered; dedupe on `id`. Any 2xx = delivered; otherwise retried at 1m/5m/30m/2h/12h (15 s timeout, redirects not followed). Full reference: https://paykit.octomatica.ru/llms-full.txt","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentEventData"}}}]}}}},"responses":{"2XX":{"description":"Acknowledged. Anything else is retried."}}}},"payment.late":{"post":{"summary":"Transfer credited after the session expired","description":"Signed with `X-Paykit-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, '<t>.' + raw_body)`. At-least-once, unordered; dedupe on `id`. Any 2xx = delivered; otherwise retried at 1m/5m/30m/2h/12h (15 s timeout, redirects not followed). Full reference: https://paykit.octomatica.ru/llms-full.txt","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentEventData"}}}]}}}},"responses":{"2XX":{"description":"Acknowledged. Anything else is retried."}}}},"payment.swept":{"post":{"summary":"Funds moved to the merchant treasury","description":"Signed with `X-Paykit-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, '<t>.' + raw_body)`. At-least-once, unordered; dedupe on `id`. Any 2xx = delivered; otherwise retried at 1m/5m/30m/2h/12h (15 s timeout, redirects not followed). Full reference: https://paykit.octomatica.ru/llms-full.txt","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PaymentSweptData"}}}]}}}},"responses":{"2XX":{"description":"Acknowledged. Anything else is retried."}}}},"session.expired":{"post":{"summary":"Pay-page window closed without full payment","description":"Signed with `X-Paykit-Signature: t=<unix>,v1=<hex>` where `v1 = HMAC_SHA256(secret, '<t>.' + raw_body)`. At-least-once, unordered; dedupe on `id`. Any 2xx = delivered; otherwise retried at 1m/5m/30m/2h/12h (15 s timeout, redirects not followed). Full reference: https://paykit.octomatica.ru/llms-full.txt","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/SessionExpiredData"}}}]}}}},"responses":{"2XX":{"description":"Acknowledged. Anything else is retried."}}}}}}