> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Documentação das APIs da DeliveryVip, em português. Regras que mais quebram integrações: (1) Merchant API: faça polling em GET /merchant/v3/events:polling no máximo a cada 30 s por token; confirme todo evento recebido com POST /merchant/v3/events/acknowledgment e corpo [{"id": "<eventId>"}] (o campo lido é id, não eventId), inclusive eventos repetidos ou que o sistema não trata; deduplique por eventId; o evento é só um aviso, busque o pedido na orderURL. (2) Tokens client_credentials valem 24 h e não têm refresh_token: peça outro ao receber 401. (3) Webhooks: valide a assinatura HMAC sobre o corpo bruto e responda 2xx rápido; o polling é a reconciliação. (4) Open Delivery: host od.deliveryvip.com.br, um client_secret por loja, datas em UTC. (5) Fidelidade: o operador implementa 5 rotas assinadas com HMAC e chama o config push; o estorno precisa ser idempotente. (6) Partner API: scope dv.partner. Não invente endpoints: use a referência gerada das specs OpenAPI.

# Listando faturas das lojas diretas

> Liste a fatura do mês só das lojas atendidas diretamente pelo parceiro ou pela revenda.

`GET /partner/v2/{partnerId}/merchants/invoices` devolve as mesmas faturas de [Listando faturas](/docs/guides/partner/invoices/utilizando-a-api/listando-invoices.md), mas só das lojas **atendidas diretamente** pelo `partnerId`.

| `partnerId` | Lojas na resposta |
| - | - |
| ID do parceiro | Só as lojas sem revenda. As lojas das revendas ficam de fora. |
| ID de uma revenda | As lojas da revenda (o mesmo que `GET /{partnerId}/invoices`). |

| Status | Quando |
| - | - |
| `200 OK` | Lista de faturas. |
| `204 No Content` | Nenhuma fatura no período. |
| `403 Forbidden` | `partnerId` fora do alcance do token. |

> [!TIP]
>
> Para fechar o mês de um parceiro com revendas, combine este endpoint (lojas diretas, uma a uma) com o [resumo por revenda](/docs/guides/partner/invoices/utilizando-a-api/listando-resales-invoices.md).

## Requisição

**partnerId** `uuid` *required*

ID do parceiro ou de uma revenda.

**year** `integer`

Ano. Sem ele, vale o ano corrente.

**month** `integer`

Mês, de 1 a 12. Sem ele, vale o mês corrente.

```bash cURL theme={null}
curl 'https://api.deliveryvip.com.br/partner/v2/{partnerId}/merchants/invoices?year=2025&month=4' \
  --header 'Authorization: Bearer {token}'
```

```js Node.js theme={null}
const response = await fetch(
  `https://api.deliveryvip.com.br/partner/v2/${partnerId}/merchants/invoices?year=2025&month=4`,
  { headers: { Authorization: `Bearer ${token}` } },
)
const invoices = response.status === 204 ? [] : await response.json()
```

```python Python theme={null}
response = requests.get(
    f"https://api.deliveryvip.com.br/partner/v2/{partner_id}/merchants/invoices",
    params={"year": 2025, "month": 4},
    headers={"Authorization": f"Bearer {token}"},
)
invoices = [] if response.status_code == 204 else response.json()
```

## Resposta

```json Resposta (200) theme={null}
[
  {
    "month": "4",
    "year": "2025",
    "merchantId": "aa67c98c-d81f-5a9c-b0bc-26caa0051aea",
    "planId": "b01ea148-c315-486f-8511-57c72327d114",
    "totalPrice": [
      { "type": "PAYABLE", "value": 150.0, "usageTimeValue": 150.0, "currency": "BRL" },
      { "type": "RECEIVABLE", "value": 300.0, "usageTimeValue": 300.0, "currency": "BRL" }
    ],
    "items": [
      {
        "itemType": "DELIVERY_TAKEOUT",
        "quantity": 1,
        "totalPrice": [
          { "type": "PAYABLE", "value": 100.0, "usageTimeValue": 100.0, "currency": "BRL" },
          { "type": "RECEIVABLE", "value": 200.0, "usageTimeValue": 200.0, "currency": "BRL" }
        ]
      },
      {
        "itemType": "MULTI_STORE",
        "quantity": 1,
        "totalPrice": [
          { "type": "PAYABLE", "value": 50.0, "usageTimeValue": 50.0, "currency": "BRL" },
          { "type": "RECEIVABLE", "value": 100.0, "usageTimeValue": 100.0, "currency": "BRL" }
        ]
      }
    ]
  }
]
```

Os campos e a regra do bloco `RECEIVABLE` estão em [Definições de faturas](/docs/guides/partner/invoices/definicoes.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.