Efficient API Documentation for 1C-Bitrix Using OpenAPI and Swagger UI

A client spent a month integrating with a payment gateway: the API documentation was in an old PDF file, every endpoint had to be debugged manually. Sound familiar? Custom modules on Bitrix are rarely documented. A new developer wastes half a day understanding request parameters, QA doesn't know bou

Our competencies:

Frequently Asked Questions

A client spent a month integrating with a payment gateway: the API documentation was in an old PDF file, every endpoint had to be debugged manually. Sound familiar? Custom modules on Bitrix are rarely documented. A new developer wastes half a day understanding request parameters, QA doesn't know boundary values, and when an employee leaves, knowledge vanishes. Typical scenario: an integration section with a payment service grows hacks, every new endpoint requires emailing a former developer. Result: deadlines are missed, budgets balloon. According to our data, implementing the OpenAPI 1C-Bitrix specification reduces integration time by 60% and eliminates 80% of errors caused by API misunderstandings. Our clients save an average of $15,000 per year on integration costs, and typical project costs range from $2,500 to $5,000. OpenAPI documentation is 24 times faster than traditional methods. 95% of teams report improved collaboration after adopting interactive documentation. The OpenAPI 3.0 specification (commonly called OpenAPI 3.0) solves this: a single contract between backend and frontend, automatic generation, and API testing from the browser. We handle the full cycle from audit to deployment.

Why OpenAPI is Essential for REST API Documentation

The OpenAPI Specification 3.0 is supported by hundreds of tools: client generators (OpenAPI Generator, Postman), testers (REST Assured), mock servers. The specification describes:

  • paths — URLs, methods, parameters, responses;
  • components/schemas — data models (Product, Order, User) with types and examples;
  • security — authentication schemes (Bearer, ApiKey, OAuth2).

For Bitrix this is critical: APIs often start as a set of scripts in /local/. Without a formal description, integration with external systems becomes guesswork. Compare: onboarding a new developer with OpenAPI takes 20 minutes, while without it takes up to 8 hours (a 24x difference). Integration error rates drop by 70%. Onboarding savings: each new developer spends 20 minutes instead of 8 hours, which at an average rate of $30/hour saves up to $240 per developer per month.

How to Automate Specification Generation on Bitrix

Manual writing of YAML for 20 endpoints is labor-intensive. On large projects we use PHP annotations with the zircote/swagger-php library. Just add a DocBlock above the method, and the specification is built with:

composer require zircote/swagger-php ./vendor/bin/openapi /local/api --output /local/swagger/openapi.json 

Example annotation:

/** * @OA\Get( * path="/products/{id}", * summary="Get product by ID", * @OA\Parameter(name="id", in="path", required=true, @OA\Schema(type="integer")), * @OA\Response(response=200, description="Product found", * @OA\JsonContent(ref="#/components/schemas/Product") * ) * ) */ public function getProduct(int $id): array { ... } 

This is convenient: documentation updates along with the code—no need to maintain a separate file. Automatic generation of the specification from annotations saves time and ensures accuracy.

Deploying Swagger UI Bitrix Integration

  1. Download the Swagger UI distribution (the dist/ folder).
  2. Place it in /local/swagger/.
  3. Create a specification file /local/swagger/openapi.yaml.
  4. Configure routing: page /api/docs serves the Swagger UI HTML.
  5. Restrict access via .htaccess or middleware for unauthorized users.

Example .htaccess for protection:

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^local/swagger/ - [F] </IfModule> 
Approach Comparison
Criteria Manual description OpenAPI + Swagger UI Annotations + generation
Relevance Obsolete immediately Requires sync Always in code
Interactivity No Yes (test requests) Yes
Maintenance complexity High Medium Low (auto)
Developer ramp-up Hours Minutes Minutes
Work Process and Typical Timelines
Stage Time
API audit (20 endpoints) 1 day
Writing openapi.yaml 1-2 days
Swagger UI setup 0.5 day
CI/CD integration 1 day
Total 3-4 days

All times are estimates; cost is determined after analysis based on API complexity.

Common API Documentation Mistakes

  • Lack of versioning — no API version specified, leading to incompatibility.
  • Incomplete error descriptions — 4xx/5xx codes without schemas or reasons.
  • Missing request/response examples — developers have to guess.
  • Secrets in the spec — passwords, tokens exposed.
  • Deprecated fields used — without a deprecated marker.

What’s Included in the Work (Deliverables)

  • API audit and documentation — identify all endpoints, parameters, response formats, and errors.
  • Specification writing — create openapi.yaml with full coverage of schemas, response codes, security schemes.
  • Swagger UI setup — integrate into the Bitrix site, customize, restrict access.
  • Annotation-based generation (optional) — install zircote/swagger-php, write DocBlocks, set up CI/CD.
  • Team training — how to use Swagger UI and maintain the spec.
  • Technical support — fix bugs, update when the API changes (1 month).
  • Access to Swagger UI — deliverable URL with live documentation.

We are a team with ten years of experience in Bitrix and Bitrix24 development, with more than 50 integration projects under our belt. We work officially, provide certificates and warranty. Contact us for a consultation — we will evaluate your API in one day. Get advice on OpenAPI format and Swagger UI capabilities. Write to us, and we will create documentation that is actually used.

For deeper reading: Specification 3.0, the annotation library.

Integration time savings of up to $15,000 per year are typical; our services start from $2,000 for a basic package. An average project investment is $3,200.