# 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**: Sandbox, Production and Mock.

The JSON served at [docs.payzu.com.br/payzu-pix.postman\_collection.json](https://docs.payzu.com.br/payzu-pix.postman_collection.json) covers the 48 `/v1` routes. Folders follow the route path, one segment per folder: `POST /user/callbacks/resend/webhook` sits in `user › callbacks › resend › webhook`. Each request carries a saved response example per status.

## 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                            |

    `baseUrl` and `token` are the collection's only variables: auth sits at collection level and every request inherits the `Authorization: Bearer {{token}}` header, with no token of its own. This describes the JSON served at [docs.payzu.com.br](https://docs.payzu.com.br/payzu-pix.postman_collection.json); if some request in your fork carries its own token, it came from an older copy, and reimporting from the link fixes it.
  </Step>

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

    Before sending anything, switch `baseUrl` to the sandbox (`https://pix.sandbox.payzu.dev/v1`) or select the **Sandbox** environment.

    <Callout type="warn">
      With the default `baseUrl` you are on **production**. The charge you create is real, and paying the QR Code moves real money.
    </Callout>

    Then: &#x2A;*pix → Create Charge (Pix deposit)** → **Send**. The example is already filled with `amount` and `clientReference`, and returns the `qrCodeText`.
  </Step>
</Steps>

## Sandbox: the recommended way to test without production [#sandbox-the-recommended-way-to-test-without-production]

Point `baseUrl` at the sandbox and run the whole collection against a real API, with a 24-hour credential and no signup:

```
https://pix.sandbox.payzu.dev/v1
```

Same `/v1` routes, so whatever works here works in production by swapping the host. Unlike the mock, the sandbox **keeps state**: the charge you create can be paid, the withdrawal changes status, and the webhook actually reaches your endpoint.

<QuickLinks>
  <QuickLink href="/docs/pix-processamento/sandbox/credencial" title="Get a sandbox credential" />

  <QuickLink href="/docs/pix-processamento/sandbox/cenarios" title="Test scenarios" />

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

## Mock Server [#mock-server]

The mock is there for when you do not even want a sandbox credential yet, or you need to **work around CORS** in a web tool. It returns a fixed example and keeps no state.

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

<Callout type="warn">
  Keep the `/v1` at the end of the URL. Without it the mock answers 404 to everything.
</Callout>

| Request                           | Mock response                                                                             |
| --------------------------------- | ----------------------------------------------------------------------------------------- |
| `POST /v1/pix`                    | `{ id, status: "PENDING", amount, type: "DEPOSIT", qrCodeText, qrCodeBase64, qrCodeUrl }` |
| `GET /v1/pix?clientReference=...` | the same object, always `PENDING`                                                         |
| `GET /v1/user/balance`            | `{ balanceAvailable: 231.46, balanceBlocked: 0 }`                                         |

<Callout type="info">
  The mock always returns the same example, whatever you send: the response `amount` does not follow the request and the status never advances. To see a transaction change state, use the sandbox.
</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 sandbox and production (`https://pix.sandbox.payzu.dev/v1` vs `https://api.payzu.processamento.com/v1`).
* **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**                 |