> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dhmad.tn/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Escrow

> Get detailed information about a specific escrow

<Endpoint method="GET" path="/api/v1/escrows/:id" />

Get detailed information about a specific escrow, including **contract signature status** (whether the seller and buyer have signed the contract). Only accessible if you created the escrow or your associated user account is the seller or buyer.

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://dhmad.tn/api/v1/escrows/507f1f77bcf86cd799439011 \
    -H "Authorization: Bearer sk_live_your_api_key_here" \
    -H "Content-Type: application/json"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://dhmad.tn/api/v1/escrows/507f1f77bcf86cd799439011', {
    method: 'GET',
    headers: {
      'Authorization': 'Bearer sk_live_your_api_key_here',
      'Content-Type': 'application/json'
    }
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'Bearer sk_live_your_api_key_here',
      'Content-Type': 'application/json'
  }

  response = requests.get(
      'https://dhmad.tn/api/v1/escrows/507f1f77bcf86cd799439011',
      headers=headers
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "escrow": {
      "id": "507f1f77bcf86cd799439011",
      "_id": "507f1f77bcf86cd799439011",
      "title": "Web Development Service",
      "amount": 1000.00,
      "escrowFee": 50.00,
      "status": "paid",
      "mode": "standard",
      "seller": {
        "_id": "507f1f77bcf86cd799439013",
        "email": "seller@example.com",
        "firstName": "John",
        "lastName": "Doe"
      },
      "buyer": {
        "_id": "507f1f77bcf86cd799439014",
        "email": "buyer@example.com",
        "firstName": "Jane",
        "lastName": "Smith"
      },
      "estimatedDeliveryDays": 7,
      "expiresAt": "2024-02-15T10:00:00Z",
      "paidAt": "2024-01-16T09:00:00Z",
      "deliveredAt": null,
      "completedAt": null,
      "cancelledAt": null,
      "createdAt": "2024-01-15T10:00:00Z",
      "updatedAt": "2024-01-16T09:00:00Z",
      "createdViaThirdParty": true,
      "createdByApplicationName": "My App",
      "disputeTicketId": "65f1a2b3c4d5e6f7a8b9c0d1",
      "disputeTicket": {
        "ticketNumber": "DHM-00042",
        "type": "dispute",
        "subject": "Dispute: Website redesign",
        "status": "open",
        "createdAt": "2024-01-17T10:00:00Z",
        "previewReason": "Delivered work does not match the agreed scope."
      },
      "signatures": {
        "sellerSigned": true,
        "sellerSignedAt": "2024-01-15T11:00:00Z",
        "buyerSigned": true,
        "buyerSignedAt": "2024-01-16T09:00:00Z",
        "isFullySigned": true,
        "signedAt": "2024-01-16T09:00:00Z"
      }
    }
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="id" type="string" required>
  The escrow ID
</ParamField>

## Response Fields

<ParamField response="escrow.id" type="string">
  Unique identifier for the escrow
</ParamField>

<ParamField response="escrow.title" type="string">
  Escrow title
</ParamField>

<ParamField response="escrow.amount" type="number">
  Transaction amount in TND
</ParamField>

<ParamField response="escrow.escrowFee" type="number">
  Escrow fee
</ParamField>

<ParamField response="escrow.status" type="string">
  Current escrow status (`pending`, `paid`, `delivered`, `completed`, `cancelled`, `disputed`)
</ParamField>

<ParamField response="escrow.seller" type="object">
  Seller user object with \_id, email, firstName, lastName
</ParamField>

<ParamField response="escrow.buyer" type="object|null">
  Buyer user object if buyer exists, otherwise `null`
</ParamField>

<ParamField response="escrow.estimatedDeliveryDays" type="number">
  Estimated delivery days
</ParamField>

<ParamField response="escrow.paidAt" type="string|null">
  ISO 8601 timestamp when payment was made, or `null` if not paid
</ParamField>

<ParamField response="escrow.deliveredAt" type="string|null">
  ISO 8601 timestamp when service was delivered, or `null` if not delivered
</ParamField>

<ParamField response="escrow.completedAt" type="string|null">
  ISO 8601 timestamp when escrow was completed, or `null` if not completed
</ParamField>

<ParamField response="escrow.cancelledAt" type="string|null">
  ISO 8601 timestamp when escrow was cancelled, or `null` if not cancelled
</ParamField>

<ParamField response="escrow.createdAt" type="string">
  ISO 8601 timestamp when escrow was created
</ParamField>

<ParamField response="escrow.updatedAt" type="string">
  ISO 8601 timestamp when escrow was last updated
</ParamField>

<ParamField response="escrow.mode" type="string">
  Escrow mode: `standard` (contract + sign + pay + deliver + complete), `quick` (no contract; pay + deliver + buyer confirms), or `instant` (no contract; auto-complete on deliver). See [Escrow Modes](/api-reference/escrows/overview#escrow-modes).
</ParamField>

<ParamField response="escrow.expiresAt" type="string">
  ISO 8601 timestamp when the escrow expires (pending acceptance)
</ParamField>

<ParamField response="escrow.createdViaThirdParty" type="boolean">
  Whether the escrow was created via the API (third-party application)
</ParamField>

<ParamField response="escrow.createdByApplicationName" type="string">
  Name of the application that created the escrow (when created via API)
</ParamField>

<ParamField response="escrow.disputeTicketId" type="string|null">
  ID of the linked dispute support ticket, or `null` when no dispute ticket exists
</ParamField>

<ParamField response="escrow.disputeTicket" type="object|null">
  Summary of the linked dispute ticket (status, subject, preview reason); present when `disputeTicketId` is set
</ParamField>

<ParamField response="escrow.signatures" type="object|null">
  Contract signature status. Indicates whether the seller and buyer have signed the contract. `null` when no contract exists for this escrow.
</ParamField>

<ParamField response="escrow.signatures.sellerSigned" type="boolean">
  Whether the seller has signed the contract
</ParamField>

<ParamField response="escrow.signatures.sellerSignedAt" type="string">
  ISO 8601 timestamp when the seller signed (present when `sellerSigned` is true)
</ParamField>

<ParamField response="escrow.signatures.buyerSigned" type="boolean">
  Whether the buyer has signed the contract
</ParamField>

<ParamField response="escrow.signatures.buyerSignedAt" type="string">
  ISO 8601 timestamp when the buyer signed (present when `buyerSigned` is true)
</ParamField>

<ParamField response="escrow.signatures.isFullySigned" type="boolean">
  Whether both parties have signed the contract
</ParamField>

<ParamField response="escrow.signatures.signedAt" type="string">
  ISO 8601 timestamp when both parties signed (present when `isFullySigned` is true)
</ParamField>

<Info>
  When no contract exists for the escrow yet, `signatures` is `null`. Use `sellerSigned`, `buyerSigned`, and `isFullySigned` to check contract signing status without calling the contract endpoint.
</Info>

## Error Responses

### 400 Bad Request

**Invalid Escrow ID**

```json theme={null}
{
  "error": "Invalid escrow ID"
}
```

### 403 Forbidden

**Not Your Escrow**

```json theme={null}
{
  "error": "Forbidden",
  "message": "You do not have access to this escrow. You can only view escrows where you are the seller or buyer."
}
```

### 404 Not Found

**Escrow Not Found**

```json theme={null}
{
  "error": "Escrow not found"
}
```

This error occurs if the escrow ID doesn't exist.

***

<Info>
  You can only access escrows where your associated user account is the seller or buyer. If you try to access an escrow you're not involved in, you'll receive a 403 Forbidden error.
</Info>
