Skip to main content
Update a pending escrow transaction. Only escrows in pending status can be updated. You can modify the title, amount, description, and estimated delivery days. At least one field must be provided in the request body. The escrow fee is recalculated automatically when the amount is updated.
curl -X PUT https://dhmad.tn/api/v1/escrows/507f1f77bcf86cd799439011 \
  -H "Authorization: Bearer sk_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Updated Web Development Service",
    "amount": 1500.00,
    "description": "Full-stack website with admin panel",
    "estimatedDeliveryDays": 14
  }'
{
  "message": "Escrow updated successfully",
  "escrow": {
    "id": "507f1f77bcf86cd799439011",
    "title": "Updated Web Development Service",
    "amount": 1500.00,
    "escrowFee": 75.00,
    "status": "pending",
    "description": "Full-stack website with admin panel",
    "estimatedDeliveryDays": 14,
    "createdAt": "2024-01-15T10:00:00Z",
    "updatedAt": "2024-01-15T11:30:00Z"
  }
}

Path Parameters

id
string
required
Escrow ID

Request Body

All fields are optional, but at least one must be provided.
title
string
Updated title for the escrow
amount
number
Updated transaction amount in TND (must be greater than 0). Escrow fee is recalculated automatically.
description
string
Updated description (max 2000 characters)
estimatedDeliveryDays
number
Updated estimated delivery days (must be at least 1)

Response Fields

Error Responses

400 Bad Request

Escrow Not Pending
{
  "error": "Bad Request",
  "message": "Can only update escrows in pending status"
}
No Valid Fields
{
  "error": "Bad Request",
  "message": "No valid fields to update"
}

401 Unauthorized

{
  "error": "Unauthorized"
}

403 Forbidden

{
  "error": "Forbidden",
  "message": "Developer account must be associated with a user account. Please associate your account in the developer dashboard."
}

404 Not Found

{
  "error": "Escrow not found"
}

Only escrows in pending status can be updated. Once the buyer has paid, the escrow moves to paid status and can no longer be updated via this endpoint.