# Pedidos (Orders) e Assinaturas (Subscriptions)

***

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-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: 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://docs.barte.com/guias/webhooks/pedidos-orders-e-assinaturas-subscriptions.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.
