Pular para o conteúdo

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

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 APIColeção do Postman (v2.1)

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:

EnvironmentBase 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:

VariableUseReference
tokenAccess 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

ProblemWhat to check
401 or 403Whether 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 errorWhether an environment is selected at the top right.
404Whether the path variables on the Params tab are filled in.
400 or 422Whether 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