{"openapi":"3.1.0","info":{"title":"Rally API","description":"Rally backend services that complement Supabase (scheduler, payments, complex business logic).","version":"0.1.5"},"paths":{"/health":{"get":{"tags":["meta"],"summary":"Health","description":"Liveness probe. `version` is sourced from /VERSION via pyproject.toml.","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/api/v1/account":{"delete":{"tags":["account"],"summary":"Delete My Account","description":"Close the authenticated user's account and lock them out permanently.","operationId":"delete_my_account_api_v1_account_delete","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"boolean"},"title":"Response Delete My Account Api V1 Account Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/intent":{"post":{"tags":["payments"],"summary":"Create Payment Intent","description":"Create a card / e-wallet payment intent for a paid game's fee.\n\n403 holding_disabled without the `holding_payments` flag; 409\nseller_not_ready when the host cannot receive online. Inserts the\n`payments` row (status='initiated') and returns `pay_url` to the holding\nprovider's checkout. The amount is derived server-side (rpc\ngame_fee_amount), never from the client.","operationId":"create_payment_intent_api_v1_payments_intent_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/booking-intent":{"post":{"tags":["payments"],"summary":"Create Booking Payment Intent","description":"The host's court-booking fee: no online path under the holding model.\n\nAlways 400 method_unavailable until court-booking holding is designed\n(the demo-wallet settlement it used is removed). See gateway.py.","operationId":"create_booking_payment_intent_api_v1_payments_booking_intent_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentIntentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/{payment_id}":{"get":{"tags":["payments"],"summary":"Get Payment Status","description":"Polled by the app after the checkout: status + settlement_status\n('held' once the provider confirmed) + failure_reason when settlement\nfailed. Own payments only (404 otherwise).","operationId":"get_payment_status_api_v1_payments__payment_id__get","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/{payment_id}/confirm":{"post":{"tags":["payments"],"summary":"Confirm Payment","description":"Settles a 0đ order (100%-off voucher, no provider involved); for any\nreal charge it only reports the current status, because settlement comes\nfrom the provider's side. Idempotent.","operationId":"confirm_payment_api_v1_payments__payment_id__confirm_post","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfirmResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/{payment_id}/refund":{"post":{"tags":["payments"],"summary":"Refund Payment","description":"There is no client-initiated refund. Refunds are queued by the DB\n(cancel / reject / expire paths enqueue payment_refunds) and sent to the\nprovider by POST /api/v1/holding/dispatch.","operationId":"refund_payment_api_v1_payments__payment_id__refund_post","parameters":[{"name":"payment_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Payment Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"501":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"string"},"title":"Response Refund Payment Api V1 Payments  Payment Id  Refund Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/webhooks/vnpay":{"get":{"tags":["payments"],"summary":"Vnpay Webhook","description":"VNPay IPN: a GET with vnp_* query params. Verify → check → settle,\nanswering the spec's RspCode JSON so VNPay stops retrying.","operationId":"vnpay_webhook_api_v1_payments_webhooks_vnpay_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Vnpay Webhook Api V1 Payments Webhooks Vnpay Get"}}}}}}},"/api/v1/payments/webhooks/momo":{"post":{"tags":["payments"],"summary":"Momo Webhook","description":"MoMo IPN: POST JSON signed with HMAC-SHA256; expects HTTP 204.","operationId":"momo_webhook_api_v1_payments_webhooks_momo_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/payments/webhooks/zalopay":{"post":{"tags":["payments"],"summary":"Zalopay Webhook","description":"ZaloPay callback: {\"data\": <json str>, \"mac\"}; mac uses key2. Only\nfires on success; merchant answers return_code 1 (2 = bad mac).","operationId":"zalopay_webhook_api_v1_payments_webhooks_zalopay_post","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Payload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Zalopay Webhook Api V1 Payments Webhooks Zalopay Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/holding/dispatch":{"post":{"tags":["holding"],"summary":"Dispatch","description":"Claim queued payouts + refunds, call the provider, report each result.","operationId":"dispatch_api_v1_holding_dispatch_post","parameters":[{"name":"x-holding-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Holding-Secret"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DispatchRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Dispatch Api V1 Holding Dispatch Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/holding/reconcile":{"post":{"tags":["holding"],"summary":"Reconcile","description":"Provider balance vs the system's held total, recorded for the admin.","operationId":"reconcile_api_v1_holding_reconcile_post","parameters":[{"name":"x-holding-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Holding-Secret"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Reconcile Api V1 Holding Reconcile Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/holding/payout-account":{"post":{"tags":["holding"],"summary":"Save Payout Account","description":"Bank name lookup -> normalised name check -> save as the active account.\n422 {code: \"name_mismatch\", holder_name, registered_name} saves nothing.","operationId":"save_payout_account_api_v1_holding_payout_account_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutAccountRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutAccountResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/econtracts/draft":{"post":{"tags":["econtracts"],"summary":"Create Draft","operationId":"create_draft_api_v1_econtracts_draft_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/econtracts/{contract_id}/otp":{"post":{"tags":["econtracts"],"summary":"Send Otp","operationId":"send_otp_api_v1_econtracts__contract_id__otp_post","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OtpResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/econtracts/{contract_id}/sign":{"post":{"tags":["econtracts"],"summary":"Sign","operationId":"sign_api_v1_econtracts__contract_id__sign_post","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Contract Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/gamemaking/plan":{"post":{"tags":["gamemaking"],"summary":"Plan","operationId":"plan_api_v1_gamemaking_plan_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/test":{"post":{"tags":["notifications"],"summary":"Send Test Push","description":"Send a test push to a device token. Caller must own the token (the\nmobile-side `device_tokens` insert is RLS-gated to self).\n\nBody: {\"device_token\": \"...\", \"title\": \"...\", \"body\": \"...\"}","operationId":"send_test_push_api_v1_notifications_test_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Test Push Api V1 Notifications Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/deliver-push":{"post":{"tags":["notifications"],"summary":"Deliver Push","description":"Relay a notification row to APNs. Called server-to-server by the Postgres\n`trg_deliver_push` trigger (pg_net), NOT by the mobile app — so it's gated on\na shared secret rather than a user JWT.\n\nBody: {\"tokens\": [\"...\"], \"title\": \"...\", \"body\": \"...\",\n       \"deeplink\": \"/game/123?tab=participants\", \"type\": \"join_request\"}\n\nThe trigger already resolved the target user's device tokens, so this stays\nDB-free (consistent with the backend not being wired to Supabase).","operationId":"deliver_push_api_v1_notifications_deliver_push_post","parameters":[{"name":"x-push-secret","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Push-Secret"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Deliver Push Api V1 Notifications Deliver Push Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/media/presign-upload":{"post":{"tags":["media"],"summary":"Presign Upload","description":"Presigned PUT URLs. Every key must live under the caller's own prefix.","operationId":"presign_upload_api_v1_media_presign_upload_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignUploadRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/media/presign-download":{"post":{"tags":["media"],"summary":"Presign Download","description":"Presigned GET URLs for displaying private post media (posts are public).","operationId":"presign_download_api_v1_media_presign_download_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresignResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/media/delete":{"post":{"tags":["media"],"summary":"Delete Media","description":"Delete GCS objects — only from the caller's own prefix.","operationId":"delete_media_api_v1_media_delete_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeysRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"integer"},"title":"Response Delete Media Api V1 Media Delete Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/form-uploads/init":{"post":{"tags":["form-uploads"],"summary":"Init Form Upload","operationId":"init_form_upload_api_v1_form_uploads_init_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Init Form Upload Api V1 Form Uploads Init Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/klipy/{media_type}/trending":{"get":{"tags":["klipy"],"summary":"Trending","operationId":"trending_api_v1_klipy__media_type__trending_get","parameters":[{"name":"media_type","in":"path","required":true,"schema":{"enum":["gifs","stickers"],"type":"string","title":"Media Type"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":24,"title":"Per Page"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":8,"default":"vi","title":"Locale"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Trending Api V1 Klipy  Media Type  Trending Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/klipy/{media_type}/search":{"get":{"tags":["klipy"],"summary":"Search","operationId":"search_api_v1_klipy__media_type__search_get","parameters":[{"name":"media_type","in":"path","required":true,"schema":{"enum":["gifs","stickers"],"type":"string","title":"Media Type"}},{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":100,"title":"Q"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":1,"title":"Page"}},{"name":"per_page","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":8,"default":24,"title":"Per Page"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":8,"default":"vi","title":"Locale"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Search Api V1 Klipy  Media Type  Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/klipy/{media_type}/categories":{"get":{"tags":["klipy"],"summary":"Categories","operationId":"categories_api_v1_klipy__media_type__categories_get","parameters":[{"name":"media_type","in":"path","required":true,"schema":{"enum":["gifs","stickers"],"type":"string","title":"Media Type"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","minLength":2,"maxLength":8,"default":"vi_VN","title":"Locale"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Categories Api V1 Klipy  Media Type  Categories Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/klipy/{media_type}/share/{slug}":{"post":{"tags":["klipy"],"summary":"Share","operationId":"share_api_v1_klipy__media_type__share__slug__post","parameters":[{"name":"media_type","in":"path","required":true,"schema":{"enum":["gifs","stickers"],"type":"string","title":"Media Type"}},{"name":"slug","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"title":"Slug"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Q"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Share Api V1 Klipy  Media Type  Share  Slug  Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DispatchRequest":{"properties":{"limit":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Limit","default":50}},"type":"object","title":"DispatchRequest"},"DraftRequest":{"properties":{"role":{"type":"string","enum":["host","court_owner"],"title":"Role"}},"type":"object","required":["role"],"title":"DraftRequest"},"DraftResponse":{"properties":{"contract_id":{"type":"string","format":"uuid","title":"Contract Id"},"contract_no":{"type":"string","title":"Contract No"},"title":{"type":"string","title":"Title"},"body_markdown":{"type":"string","title":"Body Markdown"},"content_sha256":{"type":"string","title":"Content Sha256"},"status":{"type":"string","title":"Status"}},"type":"object","required":["contract_id","contract_no","title","body_markdown","content_sha256","status"],"title":"DraftResponse"},"FileMetadata":{"properties":{"field":{"type":"string","maxLength":40,"minLength":1,"title":"Field"},"content_type":{"type":"string","maxLength":80,"minLength":1,"title":"Content Type"},"size":{"type":"integer","exclusiveMinimum":0.0,"title":"Size"}},"type":"object","required":["field","content_type","size"],"title":"FileMetadata"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HistoryMatchIn":{"properties":{"team_a":{"items":{"type":"string"},"type":"array","maxItems":2,"minItems":1,"title":"Team A"},"team_b":{"items":{"type":"string"},"type":"array","maxItems":2,"minItems":1,"title":"Team B"}},"type":"object","required":["team_a","team_b"],"title":"HistoryMatchIn"},"InitRequest":{"properties":{"form_type":{"type":"string","enum":["venue","host","feedback"],"title":"Form Type"},"page_token":{"type":"string","maxLength":4000,"minLength":20,"title":"Page Token"},"files":{"items":{"$ref":"#/components/schemas/FileMetadata"},"type":"array","maxItems":11,"minItems":1,"title":"Files"}},"type":"object","required":["form_type","page_token","files"],"title":"InitRequest"},"KeysRequest":{"properties":{"keys":{"items":{"type":"string"},"type":"array","maxItems":60,"minItems":1,"title":"Keys"}},"type":"object","required":["keys"],"title":"KeysRequest"},"OtpResponse":{"properties":{"destination_masked":{"type":"string","title":"Destination Masked"},"expires_in_seconds":{"type":"integer","title":"Expires In Seconds"},"sandbox_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Code"}},"type":"object","required":["destination_masked","expires_in_seconds"],"title":"OtpResponse"},"PaymentConfirmResponse":{"properties":{"payment_id":{"type":"string","format":"uuid","title":"Payment Id"},"status":{"type":"string","title":"Status"},"participant_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Participant Status"},"payment_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Status"}},"type":"object","required":["payment_id","status"],"title":"PaymentConfirmResponse"},"PaymentIntentRequest":{"properties":{"game_id":{"type":"string","format":"uuid","title":"Game Id"},"method":{"type":"string","enum":["card","ewallet","momo","vnpay","zalopay","applepay"],"title":"Method"},"voucher_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Voucher Id"}},"type":"object","required":["game_id","method"],"title":"PaymentIntentRequest"},"PaymentIntentResponse":{"properties":{"payment_id":{"type":"string","format":"uuid","title":"Payment Id"},"provider":{"type":"string","title":"Provider"},"method":{"type":"string","title":"Method"},"amount":{"type":"integer","title":"Amount"},"currency":{"type":"string","title":"Currency"},"order_id":{"type":"string","title":"Order Id"},"mode":{"type":"string","title":"Mode"},"provider_payload":{"$ref":"#/components/schemas/ProviderPayload"},"base_amount":{"type":"integer","title":"Base Amount"},"discount_amount":{"type":"integer","title":"Discount Amount","default":0},"pay_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pay Url"},"provider_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Code"},"provider_display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider Display Name"}},"type":"object","required":["payment_id","provider","method","amount","currency","order_id","mode","provider_payload","base_amount"],"title":"PaymentIntentResponse"},"PaymentStatusResponse":{"properties":{"payment_id":{"type":"string","format":"uuid","title":"Payment Id"},"status":{"type":"string","enum":["initiated","succeeded","failed","cancelled"],"title":"Status"},"settlement_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Settlement Status"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"}},"type":"object","required":["payment_id","status"],"title":"PaymentStatusResponse"},"PayoutAccountRequest":{"properties":{"bank_bin":{"type":"string","pattern":"^\\d{6}$","title":"Bank Bin"},"bank_short_name":{"type":"string","maxLength":50,"minLength":1,"title":"Bank Short Name"},"account_number":{"type":"string","pattern":"^\\d{4,20}$","title":"Account Number"}},"type":"object","required":["bank_bin","bank_short_name","account_number"],"title":"PayoutAccountRequest"},"PayoutAccountResponse":{"properties":{"verified":{"type":"boolean","title":"Verified"},"holder_name":{"type":"string","title":"Holder Name"},"account_masked":{"type":"string","title":"Account Masked"}},"type":"object","required":["verified","holder_name","account_masked"],"title":"PayoutAccountResponse"},"PlanPlayerIn":{"properties":{"id":{"type":"string","maxLength":64,"minLength":1,"title":"Id"},"skill":{"type":"integer","maximum":10.0,"minimum":1.0,"title":"Skill"},"gender":{"type":"string","enum":["male","female","other","prefer_not_to_say"],"title":"Gender","default":"prefer_not_to_say"},"state":{"type":"string","enum":["active","resting","absent"],"title":"State","default":"active"},"played":{"type":"integer","minimum":0.0,"title":"Played","default":0},"streak":{"type":"integer","minimum":0.0,"title":"Streak","default":0},"arrival_rank":{"type":"integer","minimum":0.0,"title":"Arrival Rank","default":0}},"type":"object","required":["id","skill"],"title":"PlanPlayerIn"},"PlanRequest":{"properties":{"game_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Game Id"},"sport":{"type":"string","enum":["badminton","pickleball","tennis"],"title":"Sport","default":"badminton"},"courts_count":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Courts Count","default":1},"formats":{"items":{"type":"string"},"type":"array","maxItems":8,"title":"Formats"},"gender_flex":{"type":"boolean","title":"Gender Flex","default":false},"epsilon":{"type":"integer","maximum":9.0,"minimum":1.0,"title":"Epsilon","default":2},"bias":{"type":"string","enum":["balance","neutral","variety"],"title":"Bias","default":"neutral"},"max_streak":{"type":"integer","maximum":4.0,"minimum":1.0,"title":"Max Streak","default":2},"remaining_minutes":{"anyOf":[{"type":"number","maximum":1440.0,"minimum":0.0},{"type":"null"}],"title":"Remaining Minutes"},"avg_match_minutes":{"anyOf":[{"type":"number","maximum":120.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Avg Match Minutes"},"seed":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Seed"},"players":{"items":{"$ref":"#/components/schemas/PlanPlayerIn"},"type":"array","maxItems":128,"minItems":1,"title":"Players"},"history":{"items":{"$ref":"#/components/schemas/HistoryMatchIn"},"type":"array","maxItems":500,"title":"History"}},"type":"object","required":["players"],"title":"PlanRequest"},"PlanResponse":{"properties":{"matches":{"items":{"$ref":"#/components/schemas/PlannedMatchOut"},"type":"array","title":"Matches"},"stats":{"additionalProperties":true,"type":"object","title":"Stats"}},"type":"object","required":["matches","stats"],"title":"PlanResponse"},"PlannedMatchOut":{"properties":{"court_index":{"type":"integer","title":"Court Index"},"wave":{"type":"integer","title":"Wave"},"format":{"type":"string","title":"Format"},"team_a":{"items":{"type":"string"},"type":"array","title":"Team A"},"team_b":{"items":{"type":"string"},"type":"array","title":"Team B"},"relaxed":{"type":"boolean","title":"Relaxed"}},"type":"object","required":["court_index","wave","format","team_a","team_b","relaxed"],"title":"PlannedMatchOut"},"PresignResponse":{"properties":{"urls":{"items":{"$ref":"#/components/schemas/PresignedUrl"},"type":"array","title":"Urls"}},"type":"object","required":["urls"],"title":"PresignResponse"},"PresignUploadRequest":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UploadItem"},"type":"array","maxItems":20,"minItems":1,"title":"Items"}},"type":"object","required":["items"],"title":"PresignUploadRequest"},"PresignedUrl":{"properties":{"key":{"type":"string","title":"Key"},"url":{"type":"string","title":"Url"}},"type":"object","required":["key","url"],"title":"PresignedUrl"},"ProviderPayload":{"properties":{"pay_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pay Url"},"deeplink":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deeplink"},"qr_code_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Code Url"},"raw":{"additionalProperties":true,"type":"object","title":"Raw"}},"type":"object","title":"ProviderPayload"},"SignRequest":{"properties":{"otp":{"type":"string","maxLength":12,"minLength":1,"title":"Otp"}},"type":"object","required":["otp"],"title":"SignRequest"},"SignResponse":{"properties":{"status":{"type":"string","const":"certified","title":"Status"},"signed_at":{"type":"string","title":"Signed At"},"certified_at":{"type":"string","title":"Certified At"},"certification_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Certification Ref"}},"type":"object","required":["status","signed_at","certified_at","certification_ref"],"title":"SignResponse"},"UploadItem":{"properties":{"key":{"type":"string","title":"Key"},"content_type":{"type":"string","title":"Content Type"}},"type":"object","required":["key","content_type"],"title":"UploadItem"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}