Appearance
LP API reference
Base URL: https://api.rampwire.app
Unless noted, LP routes need:
http
Authorization: Bearer lp_xxxxxxxxCritical: 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 / URL | POST /api/lp/register |
| Auth | None |
Body (JSON)
| Field | Type | Required | Notes |
|---|---|---|---|
xrpl_address | string | yes | XRPL account you operate |
mpesa_phone | string | yes | Ops / contact number |
display_name | string | no | Defaults internally if omitted |
supported_currencies | object | no | Map of CURRENCY → rate_usd (see rates) |
spread_bps | number | no | Basis 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 / URL | GET /api/lp/{lp_key}/dashboard |
| Auth | LP (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 / URL | POST /api/lp/{lp_key}/rates |
| Auth | LP |
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 / URL | POST /api/lp/{lp_key}/assets |
| Auth | LP |
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 / URL | POST /api/lp/{lp_key}/collateral/deposit |
| Auth | LP |
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 / URL | POST /api/lp/{lp_key}/collateral/{deposit_id}/confirm |
| Auth | LP |
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 / URL | GET /api/lp/{lp_key}/balance |
| Auth | LP |
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 / URL | POST /api/lp/{lp_key}/auto-claim |
| Auth | LP |
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 / URL | GET /api/lp/{lp_key}/orders/stream |
| Auth | LP |
Query
| Param | Description |
|---|---|
currencies | Comma-separated (e.g. KES,NGN) |
since | ISO 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 / URL | POST /api/lp/{lp_key}/receipt |
| Auth | LP |
Form fields
| Field | Description |
|---|---|
order_id | Numeric string |
file | png, 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 / URL | POST /api/orders/{order_id}/claim |
| Auth | Authorization: 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 / URL | POST /api/orders/{order_id}/fiat-sent |
| Auth | LP (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}).
Related public endpoints
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}¤cies=KES — see LP WebSocket automation.
Error quick reference
| HTTP | Typical cause |
|---|---|
400 | Bad JSON, missing body fields |
401 | Missing / invalid LP key, path vs token mismatch on /api/lp/{lp_key}/… |
403 | Receipt / order not assigned to this LP |
409 | Claim race lost |
413 | Receipt file too large |
429 | Too many WebSocket connections for this lp_key |
See Errors for shared Agent and system errors.