> For the complete documentation index, see [llms.txt](https://docs.gestao.plus/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gestao.plus/api/private-erp/cancel_order.md).

# Cancelar Pedido

## Cancelar Pedido

<mark style="color:red;">`DELETE`</mark> `https://api.gestao.plus/order-external/:orderId`

Com esta rota você pode cancelar um pedido.

#### Path Parameters

| Name                                      | Type   | Description                       |
| ----------------------------------------- | ------ | --------------------------------- |
| orderId<mark style="color:red;">\*</mark> | string | ID do pedido                      |
| q                                         | string | Motivo do cancelamento (Opcional) |

#### Headers

| Name                                        | Type   | Description         |
| ------------------------------------------- | ------ | ------------------- |
| x-api-key<mark style="color:red;">\*</mark> | string | Token de acesso ERP |
| Origin<mark style="color:red;">\*</mark>    | string | URL de origem       |

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

```json
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Unknown",
    "status": 200,
    "detail": "Order successfully canceled"
}
```

{% endtab %}

{% tab title="403 " %}

```json
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Forbidden",
    "status": 403,
    "detail": "Forbidden (Invalid token)"
}
```

{% endtab %}

{% tab title="403 " %}

```json
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Forbidden",
    "status": 403,
    "detail": "Forbidden, invalid key (x-api-key)"
}
```

{% endtab %}

{% tab title="404 " %}

```json
{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Not Found",
    "status": 404,
    "detail": "Order not found"
}
```

{% endtab %}
{% endtabs %}
