https://{your-orchestrator-domain}/api/v1API Reference
Complete REST API reference for OFFER-HUB — endpoints, parameters, and response schemas.
The OFFER-HUB Orchestrator exposes a RESTful JSON API. All endpoints are prefixed with /api/v1.
Base URL
For local development:
Authentication
All requests require authentication via a Bearer token (API Key).
Request Header
Getting an API Key
Create an API key using your master key:
Response:
Save the key value immediately - it's only shown once!
API Key Scopes
| Scope | Permissions |
|---|---|
read | All GET endpoints |
write | POST to create/modify resources |
support | Resolve disputes, add comments |
Common Headers
Request Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer {api_key} |
Content-Type | Yes (POST/PUT) | application/json |
Idempotency-Key | Conditional | UUID for state-changing POSTs |
X-Request-ID | No | UUID for correlation/debugging |
Response Headers
| Header | Description |
|---|---|
X-Request-ID | Echo of request ID or auto-generated |
X-Idempotency-Key | Echo of key if applied |
X-RateLimit-Limit | Request limit |
X-RateLimit-Remaining | Remaining requests |
X-RateLimit-Reset | Reset timestamp |
Response Format
Success Response
List Response
Error Response
Error Codes
| Code | HTTP | When to Use |
|---|---|---|
VALIDATION_ERROR | 400 | Invalid fields in request |
UNAUTHORIZED | 401 | Missing or invalid API key |
INSUFFICIENT_SCOPE | 403 | API key lacks required scope |
USER_NOT_FOUND | 404 | User does not exist |
ORDER_NOT_FOUND | 404 | Order does not exist |
INVALID_STATE | 409 | Invalid state transition |
IDEMPOTENCY_KEY_REUSED | 409 | Same key with different body |
INSUFFICIENT_FUNDS | 422 | Balance too low |
RATE_LIMITED | 429 | Too many requests |
PROVIDER_TIMEOUT | 504 | External provider timeout |
Escrows
Escrow contracts hold funds securely between buyers and sellers until project completion.
Initialize an Escrow
POST /api/v1/orders/{id}/escrow
Creates a new escrow contract between buyer and seller. Funds are held until release.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount to escrow |
currency | string | Yes | Currency code (USD, XLM, USDC) |
Response
Fund Escrow
POST /api/v1/orders/{id}/escrow/fund
Funds an existing escrow contract.
Returns 422 INSUFFICIENT_FUNDS if the buyer has insufficient balance.
Release Escrow
POST /api/v1/orders/{id}/resolution/release
Releases held funds from an escrow to the seller upon project completion.
Response
Refund Escrow
POST /api/v1/orders/{id}/resolution/refund
Refunds escrowed funds back to the buyer.
Open Dispute
POST /api/v1/orders/{id}/resolution/dispute
Opens a dispute on an escrow for resolution.
Transactions
Retrieve user transaction and balance history.
Get User Balance
GET /api/v1/users/{id}/balance
Returns the user's current balance across all currencies.
curl -X GET http://localhost:4000/api/v1/users/usr_abc/balance -H "Authorization: Bearer TOKEN"Response
| Field | Type | Description |
|---|---|---|
currency | string | Currency code |
available | string | Spendable balance |
held | string | Balance locked in escrows |
Get Deposit Address
GET /api/v1/users/{id}/wallet/deposit
Returns a deposit address for the user to fund their account.
Webhooks
Receive real-time event notifications from OFFER-HUB via HTTP webhooks.
See the Webhooks documentation for complete details on:
- Payload structures
- Signature verification
- Retry logic
Available Events
| Event | Trigger |
|---|---|
escrow.created | New escrow contract created |
escrow.funded | Escrow has received funds |
escrow.released | Seller paid; escrow completed |
escrow.disputed | Dispute opened on an escrow |
escrow.refunded | Escrow refunded to buyer |
Assets
Create Withdrawal
POST /api/v1/withdrawals
Initiate a withdrawal from user balance.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id | string | Yes | User requesting withdrawal |
amount | string | Yes | Amount to withdraw |
currency | string | Yes | Currency code |
destination | object | Yes | Withdrawal destination |
Get Withdrawal
GET /api/v1/withdrawals/{id}
Returns withdrawal status and details.
Pagination
List endpoints support cursor-based pagination:
Request
| Param | Default | Max | Description |
|---|---|---|---|
limit | 20 | 100 | Items per page |
cursor | - | - | ID of last item from previous page |
Response
Filters
List endpoints accept query parameter filters:
| Filter | Type | Example |
|---|---|---|
status | string | IN_PROGRESS |
buyer_id | string | usr_abc123 |
seller_id | string | usr_xyz789 |
created_after | ISO date | 2026-01-01T00:00:00Z |
created_before | ISO date | 2026-01-31T23:59:59Z |
Idempotency
All state-changing POSTs accept Idempotency-Key to prevent duplicate operations:
Behavior
- First request: Processed normally
- Repeated request (same key): Returns original response
- Different body + same key: Returns
409 IDEMPOTENCY_KEY_REUSED
Idempotency Windows
| Resource | Window |
|---|---|
| Top-ups | 24 hours |
| Withdrawals | 24 hours |
| Orders | 7 days |
| Escrow ops | 7 days |
| Disputes | Forever |
Rate Limiting
| Endpoint | Limit |
|---|---|
| General | 100 req/min per API key |
| POST /topups | 10 req/min per user |
| POST /withdrawals | 5 req/min per user |
| GET /events | 1 SSE connection per user |
Response When Exceeded
Available Endpoints
Auth & Config
| Endpoint | Method | Description |
|---|---|---|
/auth/api-keys | POST | Create API key |
/auth/api-keys | GET | List API keys |
/health | GET | Health check |
Users
| Endpoint | Method | Description |
|---|---|---|
/users | POST | Create user |
/users | GET | List users |
/users/{id} | GET | Get user |
/users/{id}/balance | GET | Get balance |
/users/{id}/wallet/deposit | GET | Get deposit address |
Orders
| Endpoint | Method | Description |
|---|---|---|
/orders | POST | Create order |
/orders | GET | List orders |
/orders/{id} | GET | Get order |
/orders/{id}/reserve | POST | Reserve funds |
/orders/{id}/cancel | POST | Cancel order |
Escrow
| Endpoint | Method | Description |
|---|---|---|
/orders/{id}/escrow | POST | Create escrow |
/orders/{id}/escrow/fund | POST | Fund escrow |
Resolution
| Endpoint | Method | Description |
|---|---|---|
/orders/{id}/resolution/release | POST | Release to seller |
/orders/{id}/resolution/refund | POST | Refund to buyer |
/orders/{id}/resolution/dispute | POST | Open dispute |
/disputes/{id}/resolve | POST | Resolve dispute |
Withdrawals
| Endpoint | Method | Description |
|---|---|---|
/withdrawals | POST | Create withdrawal |
/withdrawals/{id} | GET | Get withdrawal |
/withdrawals/{id}/commit | POST | Commit withdrawal (AirTM) |
Events
| Endpoint | Method | Description |
|---|---|---|
/events | GET | SSE event stream |
Versioning
The API uses path versioning:
v1is the current stable version- Deprecated versions will have 6 months notice
Next Steps
- Webhooks - Receive event notifications
- Quick Start - Your first API call
- SDK Guide - Use the TypeScript SDK