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

# Mark Listing as Sold

> Mark a listing as sold

# Mark Listing as Sold

Mark a listing as sold by external reference. This is a soft delete - the listing remains in the system with status `sold`.

<Note>
  Requires the `write:listings` scope. Contact support to enable write access.
</Note>

## Path Parameters

<ParamField path="externalReference" type="string" required>
  Your unique reference for this listing
</ParamField>

## Response

<ResponseField name="data.listingId" type="string">
  Okasie listing UUID
</ResponseField>

<ResponseField name="data.externalReference" type="string">
  Your provided reference
</ResponseField>

<ResponseField name="data.status" type="string">
  Always `sold`
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://www.okasie.be/api/external/v1/listings/MY-REF-001" \
    -H "Authorization: Bearer YOUR_API_SECRET"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    "https://www.okasie.be/api/external/v1/listings/MY-REF-001",
    {
      method: "DELETE",
      headers: {
        Authorization: `Bearer ${process.env.PARTNER_SECRET}`,
      },
    }
  );

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

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

  url = "https://www.okasie.be/api/external/v1/listings/MY-REF-001"
  headers = {"Authorization": f"Bearer {os.getenv('PARTNER_SECRET')}"}

  response = requests.delete(url, headers=headers)
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "data": {
      "listingId": "0c52cae7-bcaa-4b37-be0d-1b78c92c5225",
      "externalReference": "MY-REF-001",
      "status": "sold"
    }
  }
  ```
</ResponseExample>

## Error Responses

| Status | Code                | Description                        |
| ------ | ------------------- | ---------------------------------- |
| 400    | `INVALID_REFERENCE` | External reference is required     |
| 401    | `UNAUTHORIZED`      | Invalid or missing API key         |
| 403    | `PROFILE_FORBIDDEN` | No access to this listing          |
| 404    | `NOT_FOUND`         | Listing not found for this partner |

<Info>
  This operation is idempotent. Calling DELETE on an already-sold listing will return the same response.
</Info>
