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

# Checkout

> Eventos disparados para pagamentos via Checkout (PIX, Cartão e Boleto).

> [tab] checkout.completed
>
> Disparado quando um pagamento via checkout é realizado. O `payerInformation` varia conforme o método.
>
> > [tab] PIX
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.completed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 80,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["PIX"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "PIX",
> >       "PIX": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     }
> >   }
> > }
> > ```
>
> > [tab] Cartão
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.completed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 120,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["CARD"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": 3,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "CARD",
> >       "CARD": {
> >         "number": "1234",
> >         "brand": "VISA"
> >       }
> >     }
> >   }
> > }
> > ```
>
> > [tab] Boleto
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.completed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 100,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["BOLETO"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "BOLETO",
> >       "BOLETO": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     }
> >   }
> > }
> > ```

> [tab] checkout.disputed
>
> Disparado quando um pagamento via checkout sofre uma disputa. O `payerInformation` varia conforme o método.
>
> > [tab] PIX
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.disputed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 80,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["PIX"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "PIX",
> >       "PIX": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```
>
> > [tab] Cartão
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.disputed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 120,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["CARD"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": 3,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "CARD",
> >       "CARD": {
> >         "number": "1234",
> >         "brand": "VISA"
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```
>
> > [tab] Boleto
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.disputed",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 100,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["BOLETO"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "BOLETO",
> >       "BOLETO": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```

> [tab] checkout.refunded
>
> Disparado quando um pagamento via checkout é reembolsado. O `payerInformation` varia conforme o método.
>
> > [tab] PIX
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.refunded",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 80,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["PIX"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "PIX",
> >       "PIX": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```
>
> > [tab] Cartão
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.refunded",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 120,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["CARD"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": 3,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "CARD",
> >       "CARD": {
> >         "number": "1234",
> >         "brand": "VISA"
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```
>
> > [tab] Boleto
> >
> > ```json theme={"theme":{"light":"github-light","dark":"vesper"}}
> > {
> >   "event": "checkout.refunded",
> >   "apiVersion": 2,
> >   "devMode": false,
> >   "data": {
> >     "checkout": {
> >       "id": "bill_abc123xyz",
> >       "externalId": "pedido-123",
> >       "url": "https://whallet.com/pay/bill_abc123xyz",
> >       "amount": 10000,
> >       "paidAmount": 10000,
> >       "platformFee": 100,
> >       "frequency": "ONE_TIME",
> >       "items": [{ "id": "prod_xyz", "quantity": 1 }],
> >       "status": "PAID",
> >       "methods": ["BOLETO"],
> >       "customerId": "cust_abc123",
> >       "receiptUrl": "https://whallet.com/receipt/...",
> >       "installmentsCount": null,
> >       "createdAt": "2024-12-06T18:56:15.538Z",
> >       "updatedAt": "2024-12-06T18:56:20.000Z"
> >     },
> >     "customer": {
> >       "id": "cust_abc123",
> >       "name": "João Silva",
> >       "email": "joao@exemplo.com",
> >       "taxId": "123.***.***-**"
> >     },
> >     "payerInformation": {
> >       "method": "BOLETO",
> >       "BOLETO": {
> >         "name": "João Silva",
> >         "taxId": "123.***.***-**",
> >         "isSameAsCustomer": true
> >       }
> >     },
> >     "reason": "requested_by_customer"
> >   }
> > }
> > ```

## Upsell

Quando o cliente aceita o [upsell](https://whallet.mintlify.site/pages/guides/upsell.md) e paga, chega um segundo `checkout.completed` com o mesmo `checkout.id` da compra e:

* `isUpSell: true` (nos demais eventos, `false`);
* `items` só com o produto de upsell;
* `amount` com o preço do upsell e `paidAmount` com a soma da compra e do upsell.

Trate duplicidade pelo `id` do evento, não pelo `checkout.id`, ou o upsell é descartado como repetição.

## Cartão com repasse de taxa

Quando o checkout foi criado com [`card.passFeesToCustomer: true`](https://whallet.mintlify.site/pages/payment/installments#repassar-a-taxa-ao-cliente), o `checkout.completed` de um pagamento no cartão traz:

* `amount`: o total que o cliente pagou, com o acréscimo.
* `customerFee`: o acréscimo, em centavos. Vem `null` sem repasse e nos pagamentos por PIX e boleto.

## Cupom de 100%

Quando o cliente usa um cupom que zera o valor, nada é cobrado, mas o `checkout.completed` chega do mesmo jeito, com `amount: 0` e `status: "REDEEMED"`. Num link de pagamento, o `status` continua `ACTIVE`, porque o link segue aberto para outros clientes.


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