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

# Payment flow

> How DoglyTdc Pay receives payments: hosted checkout with PIX or Balance.

```mermaid theme={null}
flowchart LR
  A[Buyer opens checkout] --> B{Method}
  B -->|PIX| C[QR Code / copy and paste]
  B -->|DoglyTdc Balance| D[Debited from balance]
  C -->|pix_generated| E[Awaiting payment]
  E -->|paid| F[purchase_approved]
  D --> F
  F --> G[Seller balance]
  G --> H[Withdrawal via PIX]
```

## Methods

| Method | How it works | Event |
| - | - | - |
| PIX | QR Code and copy and paste; approved when the bank confirms | `pix_generated` → `purchase_approved` |
| DoglyTdc Balance | Deducted from the buyer's balance instantly | `purchase_approved` |

> [!NOTE]
>
> There is no credit card option in DoglyTdc Pay.

## After approval

1. The order changes to paid and the `purchase_approved` event is sent to your webhooks.
2. The amount is credited to your balance (pending → available).
3. Refund: `purchase_refunded`. Subscription: `subscription_created`, `subscription_renewed`, `subscription_canceled`.


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