Postman Collection Setup for 1C-Bitrix API

Why a Postman Collection Is Essential for Bitrix API A CusDev developer deals with dozens of endpoints—1C product exchange, lead creation, order processing. Without pre-built requests, every test turns into copying cURL from the docs. We set up Postman collections so that one click and the API re

Our competencies:

Frequently Asked Questions

Why a Postman Collection Is Essential for Bitrix API

A CusDev developer deals with dozens of endpoints—1C product exchange, lead creation, order processing. Without pre-built requests, every test turns into copying cURL from the docs. We set up Postman collections so that one click and the API responds. Our Bitrix experience: over 10 years, 50+ projects, quality guarantee.

A Postman collection for 1C-Bitrix is not just a set of HTTP requests; it's a full automation tool for testing and documenting the API. It includes automatic authorization, environment variables for different stages, and tests for status and response structure. With such a collection, regression testing of 20 endpoints takes 1–2 minutes instead of 30–60 minutes of manual work. Time savings per cycle: up to 20 hours per month.

Problems the Collection Solves

  • Missing documentation. Bitrix developers often rely on verbal agreements. The collection becomes a single source of truth.
  • Authorization errors. JWT tokens expire, API keys get mixed up. Automation via Pre-request Script eliminates human error.
  • Long regression. After every update you need to check all endpoints. Collection Runner and Newman do it in minutes.
Scenario Without Collection With Collection
Checking 20 endpoints 30–60 minutes 1–2 minutes
Switching environment (dev→prod) Edit every request Change one environment variable
Regression after deployment Manual, error-prone Automatic, 100% coverage

How to Automate Authorization in Postman

When working with JWT authorization, the token must be obtained and inserted into each request. In Postman this is solved via a Pre-request Script in the login request:

pm.sendRequest({ url: pm.environment.get('base_url') + '/api/v1/auth/login', method: 'POST', header: { 'Content-Type': 'application/json' }, body: { mode: 'raw', raw: JSON.stringify({ login: pm.environment.get('api_login'), password: pm.environment.get('api_password') }) } }, function(err, res) { if (!err) { pm.environment.set('token', res.json().token); } }); 

For other requests, in the Authorization section select Bearer Token and use {{token}}. Or set authorization at the collection level—then all requests inherit it. This reduces setup time per request from 5 minutes to 10 seconds—30x faster.

What Is Included in the Collection Setup

  • Designing the collection structure (endpoint groups: Auth, Catalog, Orders, CRM)
  • Creating environment variables for dev/stage/prod
  • Configuring Pre-request Script for automatic authorization
  • Adding tests for each request (status, response structure, required fields)
  • Exporting the collection in JSON (Collection v2.1) and integration with Git
  • Documentation on running (including Newman for CI/CD)
  • Team training (1 hour online)

How We Set Up the Collection: Process

  1. API analysis. Study the endpoints, methods, authorization, data formats.
  2. Structure design. Break into logical groups, create folders.
  3. Environment creation. Prepare variables for each stage.
  4. Request implementation. Add headers, bodies, parameters.
  5. Authorization automation. Write Pre-request Script.
  6. Tests. Add checks for each request.
  7. Export and integration. Save to repository, set up Newman in CI/CD.

Collection Runner and Newman

Collection Runner lets you run all requests sequentially and see if all tests pass. This is basic smoke testing for the API.

Newman is a CLI tool for running collections from the command line. It integrates into CI/CD:

npm install -g newman newman run bitrix-api.postman_collection.json \ -e production.postman_environment.json \ --reporters cli,html 

After each deploy, CI automatically runs the collection and checks API health. Time savings on regression: up to 20 hours per month.

How to Avoid Common Setup Mistakes

One frequent issue is improper storage of sensitive data. Never put logins and passwords in the collection itself. Use environment variables that don't end up in Git. Another mistake is forgetting to update the collection after API changes. We recommend storing the JSON collection file in the same repository as the code and updating it within the same task.

Mistake Consequence Solution
Passwords in collection Data leak Environment variables
Collection not in Git Desync with team Store in repository
No tests Missing errors Add tests for each request

Documentation from the Collection

Postman automatically generates documentation from the collection: description of each request, example responses, parameters. It's not a full OpenAPI spec, but sufficient for internal use.

Why Invest in Collection Setup?

Setting up a collection for an API with 15–20 endpoints, including tests and environments, takes 1–2 days. Contact us for a consultation—we'll assess your project in one day. Order Postman collection setup and forget manual testing. Get a consultation via the form on our website—we'll respond within a business day.