Developers

API Documentation

The HostraCore API is REST under /v1. Documentation on this page is not a copy — it is fetched live from the production service at api.hostracore.com, so it can never drift from what the API actually serves.

Machine-readable specifications

Live surface area

Loading OpenAPI document…

Try it live

These are public, unauthenticated endpoints. The request runs in your browser against production.

GET https://api.hostracore.com/health — press a button to run the request from your browser.

Fees — card_to_crypto

A quote is priced as a percentage platform fee plus a fixed per-network fee: platform_fee = 1.5% (150 bps) of send_amount and network_fee = $1.00 on Tron, $15.00 on Ethereum, $0.50 on Polygon, $0.80 on BNB Smart Chain. There is no flat platform fee.

platform_fee = 150 bps · network_fee = fixed per chain
Networkplatform_fee (1.5%)network_fee (fixed)ReceiveEffective
Tron (TRC-20)$15.00$1.00$984.001.60%
Ethereum (ERC-20)$15.00$15.00$970.003.00%
Polygon$15.00$0.50$984.501.55%
BNB Smart Chain$15.00$0.80$984.201.58%

The platform fee is a percentage of the send amount, not a flat charge. The network fee is a fixed per-chain amount that covers on-chain disbursement. Small tickets therefore carry a higher effective rate than large ones — a $10 transfer on Tron costs $1.15 (11.50%), a $10,000 transfer on Tron costs $151.00 (1.51%).

POST https://api.hostracore.com/v1/quotes
Content-Type: application/json

{
  "send_currency": "USD",
  "send_amount": "1000.00",
  "receive_asset": "USDT",
  "receive_network": "tron"
}

200 OK
{
  "quote_id": "qt_...",
  "rate": "1.0000",
  "platform_fee": "15.00",
  "network_fee": "1.00",
  "receive_amount": "984.00",
  "expires_at": "<+60s>"
}
POST https://api.hostracore.com/v1/transfers
Idempotency-Key: <uuid>

{
  "flow": "card_to_crypto",
  "quote_id": "qt_...",
  "card_pm": "pm_...",
  "wallet": "T...",
  "network": "tron",
  "asset": "USDT"
}

200 OK -> { "id": "tr_...", "status": "pending", "legs": [...] }
GET /v1/transfers/{id} -> poll until succeeded | failed

A stale quote_id returns HTTP 410 — re-quote and retry.

Quickstart

# 1. Register a machine identity and receive an API key
curl -X POST https://api.hostracore.com/v1/auth/m2m/register \
  -H 'Content-Type: application/json' \
  -d '{"merchant_name":"Acme"}'

# 2. Lock a server-side quote (rate + fee, 60s TTL)
curl -X POST https://api.hostracore.com/v1/quotes \
  -H 'Authorization: Bearer hstra_...' \
  -H 'Content-Type: application/json' \
  -d '{"send_currency":"USD","send_amount":"1000.00","receive_asset":"USDT","receive_network":"tron"}'
# -> platform_fee "15.00" (1.5%), network_fee "1.00" (tron, fixed), receive_amount "984.00"

# 3. Execute the card_to_crypto saga
curl -X POST https://api.hostracore.com/v1/transfers \
  -H 'Authorization: Bearer hstra_...' \
  -H 'Idempotency-Key: 0f1c...' \
  -H 'Content-Type: application/json' \
  -d '{"flow":"card_to_crypto","quote_id":"qt_...","card_pm":"pm_...","wallet":"T...","network":"tron","asset":"USDT"}'

# 4. Poll the saga until a terminal state
curl https://api.hostracore.com/v1/transfers/tr_... -H 'Authorization: Bearer hstra_...'

Cross-origin usage

Production CORS is verified: preflight returns 204 with the full Access-Control-* set and Access-Control-Max-Age: 600, so browsers cache the preflight for ten minutes. Public endpoints work with credentials omitted; authenticated session endpoints require credentials: 'include'.

// public, no cookie
await fetch('https://api.hostracore.com/health', { credentials: 'omit' })

// authenticated, session cookie travels cross-site
await fetch('https://api.hostracore.com/v1/auth/me', { credentials: 'include' })

Swagger UI

If the embed is blocked by the API's frame policy, open the Swagger UI directly.