---
agentTools:
  projectIndex: https://docs.ninepay.com.br/llms.txt
  projectSearch: https://docs.ninepay.com.br/agentSearch?query=term1%20term2
---

# Postman

Import the API collection into Postman, pick an environment and send your first request.

Use the Postman collection to try the API endpoints before implementing the calls in your application.

> 📘 By the end of this guide
>
> You will have the collection and an environment imported into Postman, your token set and a request sent.

## Before you start

- Install [Postman](https://www.postman.com/downloads/) or use the web version.
- Have an API token for the environment you are going to test (see [Authentication](/docs/authentication) and [Test Environment](/docs/sandbox-en)).

> ⚠️ Keep your token safe
>
> Do not publish your token in public workspaces, screenshots, repositories or chats. Use sandbox tokens (`sk_hmlg_`) while testing.

## 1. Download the files

Download the collection and the environment of the server you will use. The collection is the same for every environment: only the environment changes.

- [NinePay API — coleção do Postman](https://docs.ninepay.com.br/postman/ninepay-api.postman_collection.json)
- [NinePay API — ambiente Servidor de Testes (sandbox)](https://docs.ninepay.com.br/postman/ninepay-api.servidor-de-testes-sandbox.postman_environment.json)

## 2. Import into Postman

1. In Postman, open the workspace that will hold the collection and click **Import**.
2. Drop the collection and the environment into the window or click **files** to pick them. You can also paste a file address (right-click a download button and copy the link).
3. Confirm with **Import**. The collection shows up under **Collections** and the environment under **Environments**.

## 3. Select the environment

Each environment sets the `baseUrl` variable to the base URL of one API server:

| Environment | Base URL (`baseUrl`) |
| --- | --- |
| Servidor de Testes (sandbox) | `https://api.sandbox.cefispay.com.br/api/v1` |
| Servidor de Produção (production) | `https://payments.cefis.com.br/api/v1` |

In the environment selector at the top right, pick the imported environment. Without one, requests use the collection's own `baseUrl` (the first server, the sandbox).

## 4. Enter your token

Authentication is already set on the collection's **Authorization** tab and the requests inherit it. It uses the variable below, which starts empty:

| Variable | Use | Reference |
| --- | --- | --- |
| `token` | Access token, sent as `Authorization: Bearer <token>` | `{{token}}` |

Under **Environments**, open the selected environment, fill in the variable value and save (**Ctrl+S** or **Cmd+S**). The credential variable is **secret**: the value is masked on screen.

## 5. Send a request

1. Open a folder of the collection and select an endpoint.
2. Check the URL and the **Params** tab: path variables (`:id`) and optional parameters, which start unchecked.
3. Adjust the example body on the **Body** tab, when there is one.
4. Click **Send** and check the status and the response body.

A `2xx` status means success. The exact code and response format are on the endpoint page in the API Reference.

## Common errors

| Problem | What to check |
| --- | --- |
| `401` or `403` | Whether the `token` variable is filled in on the selected environment and the token belongs to the same environment as the URL. |
| URL shows `{{baseUrl}}` or an invalid URL error | Whether an environment is selected at the top right. |
| `404` | Whether the path variables on the **Params** tab are filled in. |
| `400` or `422` | Whether the body is valid JSON and follows the fields described on the endpoint page. |

## Updates

To get new or changed endpoints, download the collection again and import it. Postman notices the collection already exists and asks whether to replace it or import a copy.

## Next steps

- [Browse the API Reference](/reference/criar-novo-pagamento)
- [Use the collection in Insomnia](/docs/insomnia-en)
- [See all collections](/docs/collections-en)
