Search Docs…

Search Docs…

Guide

Wallet Action Endpoints

Wallet Action Endpoints (you implement)

TS will call the following server-to-server endpoints. Use HTTPS only.

6.1 POST /Wallet/Getbalance

Called before opening a trade to check if funds are sufficient.

Request

{
  "token": "ACCESS-TOKEN-FROM-STEP-2",
  "amount": 100,
  "currency": "USD",
  "hash": "<digest>

Response (approve)

Return current balance (pre‑debit). If insufficient, return status:"InsufficientFunds" (see errors).

6.2 POST /Wallet/Opentrade

Reserve/hold the stake when TS opens a trade.

Request

{
  "token": "ACCESS-TOKEN-FROM-STEP-2",
  "amount": 100,
  "currency": "USD",
  "externalTradeType": "options",
  "externalTradeId": "8461378",
  "hash": "<digest>

Response

Idempotency: Treat (externalTradeId, externalTradeType) as an idempotency key. If you receive duplicates, return the same result without double‑debiting.

6.3 POST /Wallet/Closetrade

Settle outcome and release hold.

Request

{
  "token": "ACCESS-TOKEN-FROM-STEP-2",
  "amount": 190,                  // win amount; 0 for loss; stake for tie
  "currency": "USD",
  "externalTradeType": "options",
  "externalTradeId": "8461378",
  "hash": "<digest>

Response

Outcome convention - In‑the‑money: amount = stake + payout - Out‑of‑the‑money: amount = 0 - At‑the‑money: amount = stake