Documentation
Feedback
Guides
API Reference

Guides
API usage
Making your first request
Making your first request

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:

  1. Go to the API reference page of the endpoint you wish to test, such as the List orders endpoint.
  2. Read the documentation and fill in the required parameters, such as headers, query parameters, and request body fields.
  3. In the Authentication section, enter your appKey and appToken in the respective fields: X-VTEX-API-AppKey and X-VTEX-API-AppToken.
  4. Hover over the Base URL field to see the accountName and environment fields.
  5. Enter your VTEX account name in the accountName field.
  6. Fill in the environment field. If you're unsure which environment to use, try vtexcommercestable.
  7. Click the TEST METHOD button to send your request to the desired API endpoint.
  8. Check the API response below the request. A successful request will return a 200 OK, 201 Created, or 204 No Content status. For more information on status codes, refer to Response status codes .

{"base64":"  ","img":{"width":2594,"height":1574,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":385893,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/guides/Getting-Started/getting-started/making-your-first-request-3.png"}}

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.

  1. Open the desired API Reference in the VTEX Developer Portal.
  2. Fill in the request parameters as needed. The request box will automatically update with the full request.
  3. In the Language section, select the programming language you'd like to use (Node.js, Python, or Shell).
  4. Copy the example request displayed below the Base URL field.

{"base64":"  ","img":{"width":1160,"height":1168,"type":"png","mime":"image/png","wUnits":"px","hUnits":"px","length":145282,"url":"https://cdn.jsdelivr.net/gh/vtexdocs/dev-portal-content@main/docs/guides/Getting-Started/getting-started/making-your-first-request-4.png"}}

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 click Download 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, click VIEW 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, click VIEW 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.

Contributors
4
Photo of the contributor
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 4 contributors
Was this helpful?
Yes
No
Suggest Edits (GitHub)
Contributors
4
Photo of the contributor
Photo of the contributor
Photo of the contributor
Photo of the contributor
+ 4 contributors
On this page