What is POSTMAN?
Postman is an API client that makes it easy for developers to create, share, test, and document APIs. This is done by allowing users to create and save simple and complex HTTP and HTTP requests as well as read their responses.
Why use POSTMAN?
In addition to the practicality of having all the integration examples and codes ready, POSTMAN is the official test tool for Cielo’s development and support teams. This way, when integrating, if you have doubts, it will be faster and simpler to confirm what may be happening with your code.
Other advantages of POSTMAN:
- Free tool
- No need to install EXE - it’s an extension of Google Chrome
- Works on any platform: Windows, MacOS and Linux
- Converts JSON into several languages (EX: Python, PHP, Ruby)
- Synchronization between various applications
- Synchronize code between teams (Paid version)
Download and register
To use Postman, simply install the APP on your computer. This can be done in two ways:
- Installing the desktop version: Just go to , download the version for your platform and install the executable
- Installing the Chrome extension: Just go to the Chrome Store and install the Postman extension
Installing the Chrome extension
1.Go to the Chrome Store, search for POSTMAN in APPs
- At the App’s tab, in your Google Chrome, go to the Postman icon
- When accessing Postman for the first time,a login account will be requested. This step is optional. If you choose to creat an account, It will synchronize your settings and APIs through any device where a Postman instance is running with the same account
- Set up your Collections and environments to start testing
Explaining POSTMAN Components
In this area we will explain the different components of the Postman and its functions. After this introduction, the next parts of this tutorial will focus on the settings for API testing
A - Environment: Environment to which requests will be directed. In this area, data will be defined as:
|MerchantId||Store ID on Sky APIs|
|MerchantKey||Store Security Key at Sky APIs|
|POST / PUT URL||Endpoint To create or edit transactions|
|GET URL||Endpoint for Querying Transactions|
We suggest creating two environments, one with production data and another Sandbox, each with its own credentials and URLs. In this way it becomes much simpler to perform tests with the same contract for both environments.
B - Header
Here is the MerchantId / MerchantKey, which by default uses the same data registered in
C - Body:
It is the content of the Requisitions. Here is where you can change or create examples for the API and validate the contents of your
D - Collection:
Location that contains all examples and codes that can be used in the API. Here are the transactions, queries, and other features that exist in the Cielo’s APIs. The number of collections is unlimited, meaning you can create multiple collections to fit your Postman style of use.
Creating Environment Heaven
The first step in using postman is the creation of the API environment. This setting will define which credentials and endpoints will be used by default, thus avoiding the need to perform configurations for each test.
Creating the environment:
1 - In the upper right corner, click on the gear and select “Manage environment”.
2 - In the management screen, just fill in the settings according to the screen below:
3 - Now the endpoints and credentials for tests are already registered. We suggest you create two environments:
In the Cielo Cielo Ecommerce credentials,
MerchantKey, must match the URL environment, that is, Sandbox credentials only work with Sandbox URLs The Checkout Cielo has no
MerchantKeyor a sandbox environment. To perform tests, the “Test Mode” must be activated. For more information about Test Mode, access the Backoffice Tutorial.
Importing a Collection
Cielo has standard collections for its APIs. You can import them directly into your POSTMAN and have all the examples ready to use instantly, without the need to copy them directly from our manuals.
Follow the steps below:
- Access the area of the manual where the Collection link is available.Copy it.
IMPORTANT: In order for your collection to always be up to date, we suggest you always look for the latest version of the collection in the manual. IMPORTED COLLECTIONS DOES NOT HAVE AUTOMATICAL UPDATES
- With Postman opened, use the IMPORT button, and select the “IMPORT FROM LINK” option.
- Your Cielo collection is now available. Just select Environment and the requisition. By clicking on SEND, Postman will execute communication with Cielo.
Collections and Environments Cielo
Below, we list the collections and Environments Cielo. Use them in your Postman to perform tests and integrations.
Api Cielo Ecommerce
- Collection -
|Sandbox||** Transaction submission **: https://apisandbox.cieloecommerce.cielo.com.br
** Transaction query **: https: //apiquerysandbox.cieloecommerce.cielo.com.br/
|Production||** Transaction submission **: https://api.cieloecommerce.cielo.com.br/
** Transaction query **: https: //apiquery.cieloecommerce.cielo.com.br/
- Collection -
|Production||Transaction submission: https: //cieloecommerce.cielo.com.br/api|
Making a requisition
With its Collection and Environmet configured, creating a transaction with Cielo is extremely easy:
- Select which request you want to use.
- Verify that the correct Environment is selected
- Click SEND.
- At the bottom you will see 2 information:
Response Body- Here is where the data returned from your transactions are listed
HTTP Status- Here you check if your request worked.
OBS: If you do not receive a response, check the HTTP status.
Generating examples in other languages.
POSTMAN allows you to create examples of other languages based on the JSON requests for Cielo products.
Below we show how to generate an example in Python
1 - Access the request you want to convert and click
CODE in the right corner of the screen.
OBS: If this link does not exist on your screen, click
2 - Select the language you want to convert, in this case, Python.
3 - The Json sample is converted to Python