# 教程 (/zh/docs/pix-processamento/tutoriais)

独立的端点只是工具。教程展示如何将它们组合成真实的流程。每一个都附有可直接复制的代码。

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/endpoints" title="API 参考" />

  <QuickLink href="/docs/pix-processamento/glossary" title="术语表" />

  <QuickLink href="/docs/pix-processamento/webhooks" title="Webhooks" />
</QuickLinks>

## 按使用场景 [#按使用场景]

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/tutoriais/receive-pix" title="接收 Pix" />

  <QuickLink href="/docs/pix-processamento/tutoriais/send-pix" title="发送 Pix（cash out）" />

  <QuickLink href="/docs/pix-processamento/tutoriais/internal-transfer" title="内部转账" />

  <QuickLink href="/docs/pix-processamento/tutoriais/reconciliation" title="对账" />

  <QuickLink href="/docs/pix-processamento/tutoriais/infractions" title="违规（MED）" />
</QuickLinks>

## 每个教程涵盖的内容 [#每个教程涵盖的内容]

| 教程                                                          | 主要端点                                                    | 何时使用                              |
| ----------------------------------------------------------- | ------------------------------------------------------- | --------------------------------- |
| [接收 Pix](/docs/pix-processamento/tutoriais/receive-pix)     | `POST /pix`、`GET /pix`、callback `COMPLETED`             | 在线商店、网关、订阅收费。                     |
| [发送 Pix](/docs/pix-processamento/tutoriais/send-pix)        | `GET /pix/key`、`POST /withdraw`、`POST /withdraw/qrcode` | 支付供应商、向用户转账、市场平台 payout。          |
| [内部转账](/docs/pix-processamento/tutoriais/internal-transfer) | `POST /internal-transfer`、`GET /internal-transfer`      | 在 PayZu 账户之间转移余额，无需触及 Pix。        |
| [对账](/docs/pix-processamento/tutoriais/reconciliation)      | `GET /user/transactions`、`POST /user/report`            | 日终结账、审计、BI。                       |
| [违规（MED）](/docs/pix-processamento/tutoriais/infractions)    | `GET /user/infractions`、`POST .../defenses`             | 收到带有 `infraction` 已开启的 webhook 时。 |

## 涵盖的流程 [#涵盖的流程]

<Mermaid
  chart="`
flowchart LR
  A[&#x22;接收 Pix&#x22;] --> A1[&#x22;创建收款&#x22;]
  A1 --> A2[&#x22;显示 QR&#x22;]
  A2 --> A3[&#x22;Callback COMPLETED&#x22;]

  B[&#x22;发送 Pix&#x22;] --> B1[&#x22;查询 DICT&#x22;]
  B1 --> B2[&#x22;通过 key 或 QR 进行 Pix 付款&#x22;]
  B2 --> B3[&#x22;Callback COMPLETED&#x22;]

  C[&#x22;对账&#x22;] --> C1[&#x22;列出交易&#x22;]
  C1 --> C2[&#x22;与你的 DB 对比&#x22;]

  click A &#x22;/zh/docs/pix-processamento/tutoriais/receive-pix&#x22; &#x22;打开接收 Pix 教程&#x22;
  click A1 &#x22;/zh/docs/pix-processamento/endpoints/pix-operations/post_pix&#x22; &#x22;POST /pix&#x22;
  click A2 &#x22;/zh/docs/pix-processamento/endpoints/pix-operations/get_pix_qrcode&#x22; &#x22;GET /pix/qr-code&#x22;
  click A3 &#x22;/zh/docs/pix-processamento/webhooks&#x22; &#x22;Webhooks&#x22;

  click B &#x22;/zh/docs/pix-processamento/tutoriais/send-pix&#x22; &#x22;打开发送 Pix 教程&#x22;
  click B1 &#x22;/zh/docs/pix-processamento/endpoints/keys-and-dict/get_pix_key&#x22; &#x22;GET /pix/key (DICT)&#x22;
  click B2 &#x22;/zh/docs/pix-processamento/endpoints/withdrawals/post_withdraw&#x22; &#x22;POST /withdraw&#x22;
  click B3 &#x22;/zh/docs/pix-processamento/webhooks&#x22; &#x22;Webhooks&#x22;

  click C &#x22;/zh/docs/pix-processamento/tutoriais/reconciliation&#x22; &#x22;打开对账教程&#x22;
  click C1 &#x22;/zh/docs/pix-processamento/endpoints/reports/get_user_transactions&#x22; &#x22;GET /user/transactions&#x22;
  click C2 &#x22;/zh/docs/pix-processamento/glossary#common-api-fields&#x22; &#x22;clientReference, endToEndId, id&#x22;

  style A fill:#14ce71,stroke:#0eb464,color:#ffffff
  style B fill:#f59e0b,stroke:#d97706,color:#ffffff
  style C fill:#3b82f6,stroke:#1d4ed8,color:#ffffff
`"
/>

## 示例中的约定 [#示例中的约定]

示例使用 `$TOKEN` 变量表示 Bearer token，并提供 curl、Node、Python、Go 和 PHP 代码；其余调用约定（Base URL、`Content-Type`、以雷亚尔计的金额）统一收录在概念页的表格中。

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/concepts" title="概念 · API 约定" />
</QuickLinks>