# Postman (/en/docs/pix-processamento/postman)

<QuickLinks>
  <QuickLink href="https://dev.payzu.com.br" title="Postman docs" />

  <QuickLink href="/openapi.json" title="OpenAPI" />

  <QuickLink href="/api-scalar" title="Scalar" />

  <QuickLink href="/api-swagger" title="Swagger" />
</QuickLinks>

The official PayZu Pix collection is published at &#x2A;*[dev.payzu.com.br](https://dev.payzu.com.br)** (Postman) with **Bearer Auth** via `{{token}}` and **3 ready environments** (Mock, Sandbox, Production).

## Import the collection [#import-the-collection]

<PostmanButton />

Or via URL in Postman: **Import → Link**:

```
https://docs.payzu.com.br/payzu-pix.postman_collection.json
```

## Setup in 3 steps [#setup-in-3-steps]

<Steps>
  <Step>
    ### Import into your workspace [#import-into-your-workspace]

    Click **Run in Postman** above. The collection is forked into your personal workspace, with the whole structure: folders, authentication, examples.
  </Step>

  <Step>
    ### Configure the token [#configure-the-token]

    In the PayZu Pix collection → **Variables** tab:

    | Variable  | Value                                              |
    | --------- | -------------------------------------------------- |
    | `baseUrl` | `https://api.payzu.processamento.com/v1` (default) |
    | `token`   | Your PayZu Bearer token                            |

    The token appears **automatically** in the `Authorization: Bearer {{token}}` header of every request.
  </Step>

  <Step>
    ### Test a call [#test-a-call]

    Open **Pix Charges → POST /pix** → **Send**. The example is already filled with `amount`, `clientReference`, `callbackUrl`. It returns the `qrCodeText` to test with any bank that supports Pix.
  </Step>
</Steps>

## Mock Server [#mock-server]

For development without a real token, the collection has a **public mock server** that responds with the OpenAPI examples. Also useful to **work around CORS** in web tools.

```
https://a8aa4f94-6b53-4994-bc60-7b2347f008e1.mock.pstmn.io
```

Use it instead of `https://api.payzu.processamento.com/v1` while developing the front-end.

| Request                            | Mock response                                |
| ---------------------------------- | -------------------------------------------- |
| `POST /pix`                        | `{ id, qrCodeText, status: "PENDING", ... }` |
| `GET /pix?clientReference=order-1` | `{ status: "COMPLETED", ... }`               |
| `GET /user/balance`                | `{ available: 12450.75, blocked: 0, ... }`   |

<Callout type="info">
  The mock responds based on the OpenAPI `examples`. It does not persist state between calls, but the format is identical to the real API.
</Callout>

## Best practices [#best-practices]

* **Create a fork** of the official collection instead of editing the original. Forks receive upstream updates.
* **Use environments** to switch `baseUrl` between dev/prod (`api.payzu.processamento.com/v1` vs mock).
* **Code snippets**: click `</>` on the right of any request to export it as curl, Node, Python, Go, PHP, etc.
* **Monitor**: enable Postman Monitor to test the API every 5 min and get alerted if it goes down.

## Comparison with other viewers [#comparison-with-other-viewers]

| Feature            | Postman              | [Scalar](/api-scalar) | [Swagger](/api-swagger) |
| ------------------ | -------------------- | --------------------- | ----------------------- |
| Try-it with CORS   | **Yes (no browser)** | No (CORS blocks)      | No (CORS blocks)        |
| Public mock server | **Yes**              | No                    | No                      |
| Environments       | **Yes**              | No                    | No                      |
| Scheduled monitor  | **Yes**              | No                    | No                      |
| Code snippets      | Yes                  | Yes                   | Yes                     |
| Try-it in browser  | No (Postman Web yes) | Yes                   | Yes                     |
| No install         | Postman Web          | **Yes**               | **Yes**                 |