Skip to content

YeboSafe API Routes

Base URL

Production: https://api.yebosafe.com/api

Authentication

API Key (Server-to-Server)

Authorization: Bearer sk_live_xxx

JWT Token (Dashboard)

Authorization: Bearer eyJhbGc...

Health Check

MethodRouteDescription
GET/healthService health check

Public Routes

Escrow Lookup

MethodRouteDescription
GET/escrows/lookup/:codeLookup escrow by completion code

Response:

json
{
  "success": true,
  "data": {
    "id": "clx...",
    "reference": "clx...",
    "amount": 100.00,
    "currency": "USD",
    "description": "Product purchase",
    "status": "PENDING",
    "createdAt": "2024-01-15T10:00:00Z",
    "merchantName": "ACME Store"
  }
}

Merchant Authentication

/auth

MethodRouteDescriptionBody
POST/auth/registerRegister merchant{ name, email, password }
POST/auth/loginLogin{ email, password }
POST/auth/refreshRefresh token{ refreshToken }
GET/auth/meGet current merchant-

Merchant Routes

/merchants

MethodRouteDescription
GET/merchants/meGet merchant profile
PUT/merchants/meUpdate profile
PUT/merchants/me/webhookUpdate webhook URL
GET/merchants/me/api-keysList API keys
POST/merchants/me/api-keysCreate API key
DELETE/merchants/me/api-keys/:idRevoke API key

Escrow Routes

/escrows

MethodRouteDescription
GET/escrowsList escrows
POST/escrowsCreate escrow
GET/escrows/:idGet escrow details
POST/escrows/:id/acceptAccept escrow
POST/escrows/:id/refuseRefuse escrow
POST/escrows/:id/completeComplete with code
POST/escrows/:id/disputeOpen dispute
POST/escrows/:id/cancelCancel escrow

Create Escrow

POST /escrows

json
{
  "amount": 100.00,
  "currency": "USD",
  "description": "Product purchase",
  "payerName": "John Doe",
  "payerEmail": "john@example.com",
  "payerPhone": "+1234567890",
  "metadata": {
    "orderId": "ORD-123"
  },
  "webhookUrl": "https://your-app.com/webhook"
}

Response:

json
{
  "success": true,
  "data": {
    "id": "clx...",
    "reference": "clx...",
    "completionCode": "123456",
    "status": "PENDING",
    "amount": "100.00",
    "currency": "USD",
    ...
  }
}

List Escrows

GET /escrows?status=PENDING&page=1&limit=20

Query Parameters:

  • status: PENDING | ACCEPTED | COMPLETED | REFUSED | DISPUTED | CANCELLED | REFUNDED
  • page: Page number (default: 1)
  • limit: Items per page (default: 20)

Accept Escrow

POST /escrows/:id/accept

No body required. Returns updated escrow.

Refuse Escrow

POST /escrows/:id/refuse

json
{
  "reason": "Unable to fulfill order"
}

Complete Escrow

POST /escrows/:id/complete

json
{
  "completionCode": "123456"
}

Dispute Escrow

POST /escrows/:id/dispute

json
{
  "reason": "Item not as described"
}

Cancel Escrow

POST /escrows/:id/cancel

json
{
  "reason": "Customer requested cancellation"
}

Wallet Routes

/wallet

MethodRouteDescription
GET/wallet/balanceGet balance
GET/wallet/transactionsList transactions

Balance Response:

json
{
  "success": true,
  "data": {
    "balance": 1500.00,
    "currency": "USD"
  }
}

Admin Routes

/admin

MethodRouteDescription
GET/admin/statsPlatform statistics
GET/admin/escrowsAll escrows (paginated)
GET/admin/merchantsAll merchants

Error Responses

json
{
  "success": false,
  "error": {
    "code": "ESCROW_NOT_FOUND",
    "message": "Escrow not found"
  }
}

Error Codes:

  • INVALID_AMOUNT - Amount must be positive
  • ESCROW_NOT_FOUND - Escrow doesn't exist
  • ESCROW_NOT_PENDING - Escrow not in pending state
  • ESCROW_NOT_ACCEPTED - Must be accepted before completion
  • ALREADY_COMPLETED - Escrow already completed
  • ALREADY_DISPUTED - Dispute already opened
  • ALREADY_CANCELLED - Already cancelled
  • ESCROW_ALREADY_CLOSED - Cannot modify closed escrow
  • INVALID_CODE - Completion code not found

One chat. Everything done.