> For the complete documentation index, see [llms.txt](https://developers.myhubdelivery.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.myhubdelivery.io/orders/merchants/sale-channels.md).

# Sale Channels

## Lista de todos os canais de venda

<mark style="color:blue;">`GET`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels`

#### Query Parameters

| Name                                          | Type   | Description               |
| --------------------------------------------- | ------ | ------------------------- |
| merchantId <mark style="color:red;">\*</mark> | String | Identificador do merchant |

#### Headers

| Name                                            | Type   | Description          |
| ----------------------------------------------- | ------ | -------------------- |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer ZjQ2MTRiY.... |

{% tabs %}
{% tab title="200: OK " %}

```javascript
[
  {
    "id": "er125wded",
    "sourceAppId": "b9d3ae05b30e4235b6ac1992aef5970b",
    "name": "Ifood",
    "installed": true
  }
]
```

{% endtab %}
{% endtabs %}

## Habilita o canal de vendas no merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/{saleChannelId}`

{% hint style="success" %}
**Exemplo do conteúdo da requisição**
{% endhint %}

```json
{
  "tradePolicy": {
    "policy": "NONE|UP|DOWN",
    "value": 0
  },
  "configurations": [
    {
      "key": "",
      "value": ""
    }
  ]
}
```

## Atualiza o canal de vendas no merchant

<mark style="color:orange;">`PUT`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/{saleChannelId}`

{% hint style="success" %}
**Exemplo do conteúdo da requisição**
{% endhint %}

```json
{
  "tradePolicy": {
    "policy": "NONE|UP|DOWN",
    "value": 0
  },
  "configurations": [
    {
      "key": "",
      "value": ""
    }
  ]
}
```

## Remove o canal de venda para o Merchant

<mark style="color:red;">`DELETE`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/{saleChannelId}`

## Inicia a captação de vendas em todos os canais habilitados para o Merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/start`

## Pausa a captação de vendas em todos os canais habilitados para o Merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/stop`

## Inicia a captação de vendas no canal de venda para o Merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/{saleChannelId}/start`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

## Pausa a captação de vendas no canal de venda para o Merchant

<mark style="color:green;">`POST`</mark> `https://{account}.myhubdelivery.io/merchants/api/v1/{merchantId}/saleChannels/{saleChannelId}/stop`

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**Considerações importantes**
{% endhint %}

Por questão de segurança, no ambiente sandbox a comunicação com os canais de venda e operadores logísticos são restritos, para a criação de pedidos utilize a rota de pedidos [Fake](/orders/orders.md).
