Learn how to make your first API request using the VTEX API Reference and popular API testing tools like Postman.
In this guide, you'll learn how to make your first API request using the VTEX API reference and the built-in TEST METHOD
feature.
You'll also discover how to import API specifications into popular API testing platforms such as Postman for easier testing and integration.
Before you begin
To interact with VTEX APIs, you need to authenticate your requests. Authentication can be done via either application keys or user tokens.
For testing using the Developer Portal TEST METHOD
feature, you will need a valid application key, which consists of a pair of an appKey
and appToken
. These credentials should be associated with roles that grant you the necessary permissions to run the desired requests. If you don't have this credential yet, refer to the Application keys guide to learn how to create them.
Testing a request in the Developer Portal
To test an API request directly in the Developer Portal, follow these steps:
- Go to the API reference page of the endpoint you wish to test, such as the List orders endpoint.
- Read the documentation and fill in the required parameters, such as headers, query parameters, and request body fields.
- In the Authentication section, enter your
appKey
andappToken
in the respective fields:X-VTEX-API-AppKey
andX-VTEX-API-AppToken
. - Hover over the
Base URL
field to see theaccountName
andenvironment
fields. - Enter your VTEX account name in the
accountName
field. - Fill in the
environment
field. If you're unsure which environment to use, tryvtexcommercestable
. - Click the
TEST METHOD
button to send your request to the desired API endpoint. - Check the API response below the request. A successful request will return a
200 OK
,201 Created
, or204 No Content status
. For more information on status codes, refer to Response status codes .
If you get a
401 - Unauthorized
response, double-check your application key and token. Ensure the values are correctly entered in the request headers, and verify that they are associated with the appropriate roles and permissions.
Using an API testing platform
For more advanced testing, you can export the API specifications or copy example requests to integrate with tools like Postman and other API testing platforms.
Using request examples
You can copy the generated request from the VTEX API reference and use it in Postman, or export it to other tools for further testing. For example, to import the request into Postman, copy the cURL
request from the desired API Reference and follow the Postman Import cURL commands guide.
- Open the desired API Reference in the VTEX Developer Portal.
- Fill in the request parameters as needed. The request box will automatically update with the full request.
- In the Language section, select the programming language you'd like to use (Node.js, Python, or Shell).
- Copy the example request displayed below the Base URL field.
Downloading API specifications
The VTEX API documentation follows the OpenAPI 3.0 (OAS 3.0) standard, which provides a detailed description of the API's structure and behavior. You can download the API specifications as follows:
- GitHub: Access the OpenAPI Schemas repository, click the
\<\>Code
button, and clickDownload ZIP
to download the schema files. - API SPEC: On the Developer Portal API Reference page, click
DOWNLOAD OPENAPI SPEC
to download the schema in JSON format. Alternatively, clickVIEW OPENAPI SPEC
to view it in your browser. - Postman: On the Developer Portal API Reference page, click
DOWNLOAD POSTMAN COLLECTION
to download the collection schema in JSON format. Alternatively, clickVIEW POSTMAN COLLECTION
to view it in your browser.
Once you've downloaded the OpenAPI spec or Postman collection, you can import them into your preferred API testing tool for easy integration and testing.