Skip to content

LP API reference

Base URL: https://api.rampwire.app

Unless noted, LP routes need:

http
Authorization: Bearer lp_xxxxxxxx

Critical: the path placeholder {lp_key} is your secret key string (example lp_a1b2c3d4), not the numeric lp_id. The bearer token and path segment must match.


Register LP

Method / URLPOST /api/lp/register
AuthNone

Body (JSON)

FieldTypeRequiredNotes
xrpl_addressstringyesXRPL account you operate
mpesa_phonestringyesOps / contact number
display_namestringnoDefaults internally if omitted
supported_currenciesobjectnoMap of CURRENCYrate_usd (see rates)
spread_bpsnumbernoBasis points

Response 201

json
{
  "lp_id": 12,
  "lp_key": "lp_a1b2c3d4",
  "user_id": 9001
}

curl

bash
curl -sS -X POST 'https://api.rampwire.app/api/lp/register' \
  -H 'Content-Type: application/json' \
  -d '{
    "display_name": "Nairobi OTC",
    "xrpl_address": "rN4M2UExampleXrpAddress9Rampwire",
    "mpesa_phone": "254712345678",
    "supported_currencies": { "KES": 128.9 },
    "spread_bps": 200
  }'

Errors: 400 invalid JSON or validation (error, message).


Dashboard

Method / URLGET /api/lp/{lp_key}/dashboard
AuthLP (path must match bearer)

Response 200: JSON with lp row, rates array, assets, open_orders, my_orders (each up to ~20 rows).

bash
export LP_KEY='lp_a1b2c3d4'
curl -sS "https://api.rampwire.app/api/lp/${LP_KEY}/dashboard" \
  -H "Authorization: Bearer ${LP_KEY}"

Errors: 401 missing key, wrong key, or path/token mismatch.


Set rate

Method / URLPOST /api/lp/{lp_key}/rates
AuthLP

Body

json
{ "currency": "KES", "rate_usd": 128.9 }

rate_usd: units of local currency per 1 USD (1 USD = rate_usd KES).

Response 200: { "ok": true }

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/rates" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{"currency":"KES","rate_usd":128.9}'

Errors: 400 if currency or rate_usd missing.


Add asset (crypto receive address)

Method / URLPOST /api/lp/{lp_key}/assets
AuthLP

Body

json
{
  "symbol": "USDT",
  "chain": "trx",
  "address": "TXYZExampleTronReceiveAddressRampwire42"
}

Response 201: { "ok": true }

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/assets" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{"symbol":"USDT","chain":"trx","address":"TXYZExampleTronReceiveAddressRampwire42"}'

Errors: 400 missing symbol, chain, or address.


Collateral deposit

Method / URLPOST /api/lp/{lp_key}/collateral/deposit
AuthLP

Body

json
{
  "amount": 250,
  "asset": "XRP",
  "tx_hash": "ledger_tx_optional"
}

Response 200

json
{ "ok": true, "amount": 250, "asset": "XRP" }
bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/collateral/deposit" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{"amount":250,"asset":"XRP","tx_hash":"ABC123"}'

Errors: 400 if amount missing or not positive.


Confirm collateral row

Method / URLPOST /api/lp/{lp_key}/collateral/{deposit_id}/confirm
AuthLP

Body: empty JSON {} is fine.

Response 200: { "ok": true }

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/collateral/55/confirm" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{}'

Balance & fee preview

Method / URLGET /api/lp/{lp_key}/balance
AuthLP

Response 200: balance, recent_deposits, recent_fees, platform_total_fees.

bash
curl -sS "https://api.rampwire.app/api/lp/${LP_KEY}/balance" \
  -H "Authorization: Bearer ${LP_KEY}"

Auto-claim configuration

Method / URLPOST /api/lp/{lp_key}/auto-claim
AuthLP

Body (all optional except enabled semantics)

json
{
  "enabled": true,
  "max_amount_usd": 1500,
  "currencies": ["KES", "NGN"],
  "min_profit_usd": 0
}

Response 200: { "ok": true }

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/auto-claim" \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{"enabled":true,"max_amount_usd":1500,"currencies":["KES","NGN"],"min_profit_usd":0}'

Long-poll order stream

Method / URLGET /api/lp/{lp_key}/orders/stream
AuthLP

Query

ParamDescription
currenciesComma-separated (e.g. KES,NGN)
sinceISO timestamp; defaults to ~1 minute ago

Response 200

json
{
  "orders": [],
  "count": 0,
  "poll_again_ms": 2000
}

Open orders are filtered to your enabled asset symbols when possible.

bash
curl -sS "https://api.rampwire.app/api/lp/${LP_KEY}/orders/stream?currencies=KES" \
  -H "Authorization: Bearer ${LP_KEY}"

Upload receipt (multipart)

Method / URLPOST /api/lp/{lp_key}/receipt
AuthLP

Form fields

FieldDescription
order_idNumeric string
filepng, jpg, webp, gif, pdf, heic (max ~12MB)

Response 201: ok, order_id, receipt_key, receipt_url (helper URL; order must be yours).

bash
curl -sS -X POST "https://api.rampwire.app/api/lp/${LP_KEY}/receipt" \
  -H "Authorization: Bearer ${LP_KEY}" \
  -F "order_id=10042" \
  -F "file=@./mpesa_confirmation.pdf"

Errors: 400 bad multipart or type; 403 order not yours; 413 file too large.


Claim order (LP)

Method / URLPOST /api/orders/{order_id}/claim
AuthAuthorization: Bearer {lp_key} (path uses numeric order_id only)

Body: {} (empty JSON object).

Response 200

json
{
  "status": "claimed",
  "lp_receive_address": "TXYZExampleTronReceiveAddressRampwire42",
  "collateral_locked": 46.55
}

collateral_locked is the USD collateral slice reserved for this order (tier multiplier × order amount_usd; exact value depends on your LP tier).

bash
curl -sS -X POST 'https://api.rampwire.app/api/orders/10042/claim' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{}'

Errors: 400 validation; 409 {"error":"Order not claimable"} (already claimed); 401 bad LP key.


Mark fiat sent (LP)

Method / URLPOST /api/orders/{order_id}/fiat-sent
AuthLP (must already own the order)

Body: {}

Response 200: { "status": "fiat_sent" }

bash
curl -sS -X POST 'https://api.rampwire.app/api/orders/10042/fiat-sent' \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer ${LP_KEY}" \
  -d '{}'

Errors: 403 wrong LP; other cases may return 200 with no row update depending on status (verify with GET /api/orders/{id}).


GET /api/lps — list approved active LPs and assets (no auth).

bash
curl -sS 'https://api.rampwire.app/api/lps'

GET /api/orders/{order_id} — full order row (public; subject to product rules).

bash
curl -sS 'https://api.rampwire.app/api/orders/10042'

WebSocket (summary)

wss://api.rampwire.app/ws/orders?lp_key={lp_key}&currencies=KES — see LP WebSocket automation.


Error quick reference

HTTPTypical cause
400Bad JSON, missing body fields
401Missing / invalid LP key, path vs token mismatch on /api/lp/{lp_key}/…
403Receipt / order not assigned to this LP
409Claim race lost
413Receipt file too large
429Too many WebSocket connections for this lp_key

See Errors for shared Agent and system errors.

Rampwire — fiat–crypto infrastructure