API v1.0

GUAP Public API

Integrate prediction markets into your app. Enable your users to trade on real-world events with our simple REST API.

REST API
API Key Auth
Rate Limited

Quick Start

1. Get API Key

Contact us to register as a partner and get your API credentials.

Authorization: Bearer gp_live_xxxxxxxxxxxxxxxx

2. Create User

Create or get a user using your own external ID (e.g., phone number).

curl -X POST https://www.guap.gold/api/v1/users \
  -H "Authorization: Bearer gp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{"externalId": "255712345678"}'

3. Place Trade

Let your users trade on prediction markets.

curl -X POST https://www.guap.gold/api/v1/trades \
  -H "Authorization: Bearer gp_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "255712345678",
    "marketId": "clxyz123",
    "side": "YES",
    "amountTzs": 5000
  }'

Authentication

All API requests require a Bearer token in the Authorization header:

Authorization: Bearer gp_live_xxxxxxxxxxxxxxxx
FREE
100/min
BASIC
500/min
PRO
2,000/min
ENTERPRISE
10,000/min

API Endpoints

Users

Wallet

Markets

Trading

Positions & Redemption

Webhooks

Set a Webhook URL in your dashboard and we'll POST a signed JSON event each time something happens. Events for a user also include that user's externalId.

deposit.completedA user's deposit was confirmed and their balance credited.
deposit.failedA deposit failed; no balance was credited.
withdrawal.completedA withdrawal was paid out.
withdrawal.failedA withdrawal failed; the balance was refunded.
market.createdA market was created via your API.
market.resolvedOne of your markets resolved (includes outcome).

Payload & Verification

POST <your webhook URL> Headers: X-GUAP-Event: market.resolved X-GUAP-Signature: sha256=<hmac> Body: { "event": "market.resolved", "data": { "marketId": "...", "outcomeLabel": "YES", ... }, "timestamp": "2026-06-16T12:00:00.000Z" } Verify: HMAC-SHA256(rawBody, yourSigningSecret) === signature

How Money Works

Funds are custodial and pooled. Your users do not each get an on-chain wallet — they are tracked by a DB balance that represents their claim on our single settlement pool. Real nTZS only moves on-chain at deposit (in) and withdrawal (out); everything in between is ledger movement.

DepositSTK push mints nTZS into the settlement pool → user's DB balance is credited once the payment is confirmed.
Create marketRequires DB balance ≥ creation fee (2,000 TZS). DB balance is debited; the fee moves pool → CREATION_FEE wallet on-chain.
Buy / tradeRequires DB balance ≥ stake. DB balance is debited; the 5% fee moves pool → SETTLEMENT_FEE wallet. The stake already sits in the pool.
Sell / redeemProceeds are credited to the user's DB balance (they stay in the pool); the 5% fee moves pool → SETTLEMENT_FEE wallet.
WithdrawDB balance is debited and real nTZS is sent from the pool → user's phone. Reversed automatically if the payout fails.

So to create a market, trade, or anything that costs money, the user must have a funded DB balance. No nTZS wallet provisioning is required.

Funding users from a treasury (recommended for partners). If you hold funds on your side, you don't need each user to deposit through us. Instead:1. POST /users → create a "treasury" user (any externalId) 2. POST /wallet/deposit → fund the treasury user (one lump sum → our pool) 3. POST /wallet/send → allocate balance: treasury → end-user (DB ledger, no fee) 4. The end-user now trades against their balance.Winnings credit the user's balance; you reconcile per-user on your platform and listen to the deposit/market webhooks.

Fee Structure

5%
Entry Fee
Deducted at trade time
5%
Settlement Fee
Deducted at redemption
~9.75%
Total Per Cycle
All fees go to platform.
Partner markup: in your dashboard you can set a trading markup (%) and a creation markup (TZS). These are charged on top of the platform fee on your markets, and 100% accrues to your earnings balance (shown on the dashboard). The platform base fee is unaffected.

Error Codes

400Bad Request
401Unauthorized
403Forbidden
404Not Found
429Rate Limited
500Server Error

Ready to Integrate?

Register for a partner account to get your API credentials instantly.

Request API Access