Skip to main content
Get a paginated list of escrows for the authenticated user. You can filter by status and role.
curl -X GET "https://dhmad.tn/api/v1/escrows?status=pending&role=seller&page=1&limit=20" \
  -H "Authorization: Bearer sk_live_your_api_key_here" \
  -H "Content-Type: application/json"
{
  "escrows": [
    {
      "id": "507f1f77bcf86cd799439011",
      "title": "Web Development Service",
      "amount": 1000.00,
      "escrowFee": 50.00,
      "status": "pending",
      "seller": {
        "_id": "507f1f77bcf86cd799439013",
        "email": "seller@example.com",
        "firstName": "John",
        "lastName": "Doe"
      },
      "buyer": null,
      "estimatedDeliveryDays": 7,
      "paidAt": null,
      "deliveredAt": null,
      "completedAt": null,
      "cancelledAt": null,
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-15T10:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 45,
    "pages": 3
  }
}

Query Parameters

status
string
Filter by status: pending, paid, delivered, completed, cancelled
role
string
Filter by role: seller or buyer. If not specified, returns escrows where you are either seller or buyer.
page
number
Page number (default: 1)
limit
number
Items per page (default: 20, max: 100)

Response Fields

Examples

Filter by Status

GET /api/v1/escrows?status=paid
Returns only escrows with paid status.

Filter by Role

GET /api/v1/escrows?role=seller
Returns only escrows where you are the seller.

Combined Filters

GET /api/v1/escrows?status=pending&role=buyer&page=1&limit=10
Returns pending escrows where you are the buyer, first page with 10 items per page.
If no filters are provided, the endpoint returns all escrows where you are either the seller or buyer, sorted by creation date (newest first).