> For the complete documentation index, see [llms.txt](https://coindisco.gitbook.io/coindisco/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coindisco.gitbook.io/coindisco/white-label-api/sell-flow.md).

# Sell flow

## 1. Collect sell-compatible inputs

Use providers with `sell_available: true` and payment methods with `sell_available: true`. Still validate the complete region, asset, network, currency, method, and amount combination through sell quote search.

## 2. Search sell quotes

```bash
curl 'https://api.coindisco.com/api/white-label/v1/search-sell-quotes/' \
  --request POST \
  --header 'Partner-Api-Key: pk_test_YOUR_PUBLIC_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "region": 157,
    "currency": 3,
    "network": 2,
    "payment_method": 39,
    "cryptocurrency": 2,
    "cryptocurrency_amount": "0.05"
  }'
```

```json
{
  "search_id": "e0070884-d502-44ba-93c2-ee77101897cb"
}
```

## 3. Poll the sell search

```bash
curl 'https://api.coindisco.com/api/white-label/v1/search-sell-quotes/e0070884-d502-44ba-93c2-ee77101897cb/' \
  --header 'Partner-Api-Key: pk_test_YOUR_PUBLIC_KEY'
```

```json
{
  "status": "completed",
  "progress": {
    "objects_done": 1,
    "objects_total": 1
  },
  "data": [
    {
      "currency_amount": "94.05",
      "cryptocurrency_amount": "0.05",
      "total_fee": "4.94",
      "profit_rate": 1881,
      "true_fee": 8.378875997311278,
      "is_best_rate": true,
      "nokyc": false,
      "service": {
        "id": 5,
        "name": "Example Provider",
        "sell_available": true
      },
      "payment_method": {
        "id": 39,
        "name": "Debit card"
      }
    }
  ]
}
```

As with buy quotes, adding `service` requests one provider synchronously.

## 4. Create the sell transaction

```bash
curl 'https://api.coindisco.com/api/white-label/v1/retrieve-sell-link/' \
  --request POST \
  --header 'Partner-Api-Key: pk_test_YOUR_PUBLIC_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "region": 157,
    "service": 5,
    "currency": 3,
    "cryptocurrency": 2,
    "network": 2,
    "payment_method": 39,
    "cryptocurrency_amount": "0.05",
    "redirect_url": "https://app.example.com/transactions"
  }'
```

```json
{
  "link": "https://api.coindisco.com/api/service-integration/retrieve-redirect-link/?transaction-id=638a68f8-111d-4d0c-b6ab-da6a805c419f",
  "transaction_id": "638a68f8-111d-4d0c-b6ab-da6a805c419f"
}
```

Open the link and instruct the user to follow the provider's deposit and payout steps exactly.
