> For the complete documentation index, see [llms.txt](https://docs.barte.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.barte.com/guias/webhooks/pedidos-orders-e-assinaturas-subscriptions.md).

# Pedidos (Orders) e Assinaturas (Subscriptions)

Nesta página, você encontrará informações sobre os Webhooks de pedidos (orders) e assinaturas (subscriptions).

{% hint style="danger" %}
**Webhook de `ORDER` — formato v1 em descontinuação.**\
A partir de **10/08/2026**, o formato v1 será descontinuado. Todos os sellers deverão estar integrados ao [Webhook v2](https://docs.barte.com/guias/webhooks/webhooks-overview/webhook-v2-visao-geral.md). Sellers que ainda não possuem integração ativa devem integrar diretamente pelo novo modelo.

**Webhook de `SUBSCRIPTION`** — o formato atual permanece inalterado e não será migrado para v2 neste momento.
{% endhint %}

***

Os webhooks de **Orders** (pedidos) e **Subscriptions** (assinaturas) compartilham **o mesmo formato de payload**.\
A única diferença entre eles está no valor do campo `domain` e nos **status possíveis** para cada tipo.

###

### <i class="fa-arrow-right-arrow-left">:arrow-right-arrow-left:</i> Diferenças principais

| Campo                | ORDER                                                                                                       | SUBSCRIPTION                                 |
| -------------------- | ----------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| **domain**           | `ORDER`                                                                                                     | `SUBSCRIPTION`                               |
| **tipo de operação** | Pedido único                                                                                                | Cobrança recorrente                          |
| **status possíveis** | `SENT`, `ABANDONED`, `PAID`, `CANCELED`, `LATE`, `PARTIALLY_PAID`, `REFUND`, `CHARGEBACK`, `PRE_AUTHORIZED` | `PENDING`, `ACTIVE`, `DEFAULTER`, `INACTIVE` |
| **payload**          | Mesmo formato JSON                                                                                          | Mesmo formato JSON                           |

***

### <i class="fa-right">:right:</i> Status válidos

#### **Pedidos (`ORDER`)**

* SENT
* PRE\_AUTHORIZED
* PARTIALLY\_PAID
* PAID
* CANCELED
* REFUND
* LATE
* CHARGEBACK
* ABANDONED

> 🔸 Pedidos com status `LATE` há mais de **90 dias** são automaticamente marcados como `ABANDONED`.

#### **Assinaturas (`SUBSCRIPTION`)**

* PENDING
* ACTIVE
* DEFAULTER
* INACTIVE

***

### <i class="fa-gear-code">:gear-code:</i> Estrutura do Payload (único)

A estrutura abaixo é **idêntica** para ambos os domínios (`ORDER` e `SUBSCRIPTION`).

```json
{
  "uuid": "5503ad3a-d9c4-4072-a7cb-12cf2dd0eaa7",
  "dateTime": "2025-10-21T14:04:05.930643751",
  "status": "SENT",
  "domain": "ORDER",
  "uuidBuyer": "33236116-743a-4c1c-afc4-79b8d5dbb5b5",
  "documentBuyer": "518287216",
  "address": {
    "country": "AU",
    "state": "TAS",
    "city": "",
    "district": "",
    "street": "balers way sunset beach",
    "zipCode": "7330",
    "number": "17",
    "complement": ""
  },
  "emailBuyer": "cliente@example.com",
  "metadata": null,
  "cnpjSeller": "56210126000145",
  "idSeller": 4922,
  "authorizationCode": "496847",
  "authorizationNsu": "155224",
  "cards": [],
  "refunds": []
}
```

### <i class="fa-credit-card">:credit-card:</i> Exemplo de Cards

Em cobranças com cartão, o campo `cards` traz o cartão usado na cobrança, conforme o exemplo abaixo:

```json
"cards": [
  {
    "uuid": "0f3c2a9e-6b1d-4f7a-9c2e-8d5b1a7e4c30",
    "holderName": "MARIA SILVA",
    "bin": "650956",
    "lastFourDigits": "1842",
    "brand": "elo",
    "expirationMonth": "08",
    "expirationYear": "2028",
    "uuidCharge": "9a1d7c52-3e84-4b6f-a0d9-27c6e5f81b44"
  }
]
```

{% hint style="info" %}
Em pedidos feitos na maquininha (POS), a validade do cartão não é informada: `expirationMonth` e `expirationYear` vêm como `""`. `holderName` também vem como `""` quando o titular não é informado.
{% endhint %}

### <i class="fa-memo">:memo:</i> Exemplo de Refunds

Quando houver estorno, o campo `refunds` será preenchido conforme o exemplo abaixo:

```json
"refunds": [
  {
    "date": "2025-04-04",
    "amount": 121.12,
    "status": "SUCCESS"
  }
]
```

<i class="fa-tickets">:tickets:</i> Em caso de dúvidas, entre em contato com o nosso time através do suporte disponibilizado.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.barte.com/guias/webhooks/pedidos-orders-e-assinaturas-subscriptions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
