# 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).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.myhubdelivery.io/orders/merchants/sale-channels.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
