# /comprasmx/tenders

`POST /api/comprasmx/tenders`

Price: 20 credits

Get one ComprasMX procurement procedure by its id or procedure number: agency, buying and requesting units with the responsible person, law, procedure and contract type, character, status, description, evaluation criteria, guarantees and payment terms, requested items with CUCOP codes and quantities, spending categories, trade treaties, documents, schedule of clarifications, opening and award, and the awarded contracts with supplier and amounts. A direct award listed without contract data returns its summary fields only: number, title, file code, procedure and contract type, character, status, buying unit and state.

## How to use it

Pass the id or number of a comprasmx/tenders/search row. contracts summarises each awarded contract; comprasmx/tenders/contracts adds their priced line items.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `tender` (string, required) — Procedure id or procedure number (examples: "42136edb21764aa1b17b271e73a13a27", "LA-07-110-007000999-T-699-2026")

## Response

### 200 — Successful Response

- `@type` (string) (default: "ComprasmxTender")
- `id` (string, required)
- `procedure_id` (string, nullable)
- `number` (string, nullable)
- `description` (string, nullable)
- `short_description` (string, nullable)
- `file_code` (string, nullable)
- `draft_call_code` (string, nullable)
- `internal_control_number` (string, nullable)
- `law` (string, nullable)
- `procedure_type` (string, nullable)
- `contract_type` (string, nullable)
- `character` (string, nullable)
- `participation` (string, nullable)
- `status` (string, nullable)
- `status_detail` (string, nullable)
- `exception_basis` (string, nullable)
- `agency` (string, nullable)
- `agency_name` (string, nullable)
- `budget_branch` (string, nullable)
- `buying_unit` (string, nullable)
- `buying_unit_name` (string, nullable)
- `buying_unit_email` (string, nullable)
- `buyer_acronym` (string, nullable)
- `responsible_person` (string, nullable)
- `requesting_units` (array) (default: [])
- `state` (string, nullable)
- `budget_year` (integer, nullable)
- `currency` (string, nullable)
- `evaluation_criterion` (string, nullable)
- `other_evaluation_criterion` (string, nullable)
- `technical_points` (number, nullable)
- `economic_points` (number, nullable)
- `price_condition` (string, nullable)
- `price_condition_description` (string, nullable)
- `payment_terms` (string, nullable)
- `advance_payment_share` (number, nullable)
- `supplier_amount_share` (number, nullable)
- `guarantee_beneficiary` (string, nullable)
- `guarantee_delivery_days` (integer, nullable)
- `guarantee_months` (integer, nullable)
- `other_insurance_description` (string, nullable)
- `open_contract_type` (string, nullable)
- `execution_days` (integer, nullable)
- `work_site` (string, nullable)
- `site_visit_place` (string, nullable)
- `clarification_place` (string, nullable)
- `opening_place` (string, nullable)
- `award_place` (string, nullable)
- `joint_bid_justification` (string, nullable)
- `procurement_term` (string, nullable)
- `languages` (array) (default: [])
- `spending_categories` (array) (default: [])
  - `@type` (string) (default: "ComprasmxSpendingCategory")
  - `code` (string, nullable)
  - `name` (string, nullable)
- `line_items` (array) (default: [])
  - `@type` (string) (default: "ComprasmxItem")
  - `number` (integer, nullable)
  - `group` (string, nullable)
  - `group_number` (integer, nullable)
  - `cucop_code` (string, nullable)
  - `cucop_name` (string, nullable)
  - `spending_category_code` (string, nullable)
  - `description` (string, nullable)
  - `unit` (string, nullable)
  - `quantity` (number, nullable)
  - `min_quantity` (number, nullable)
  - `max_quantity` (number, nullable)
  - `min_amount` (number, nullable)
  - `max_amount` (number, nullable)
- `treaties` (array) (default: [])
  - `@type` (string) (default: "ComprasmxTreaty")
  - `code` (string, nullable)
  - `name` (string, nullable)
- `ppp_projects` (array) (default: [])
  - `@type` (string) (default: "ComprasmxPppProject")
  - `project_type` (string, nullable)
  - `modality` (string, nullable)
  - `description` (string, nullable)
  - `location` (string, nullable)
  - `contract_term` (integer, nullable)
  - `bid_documents_cost` (number, nullable)
  - `bid_documents_payment_method` (string, nullable)
  - `consultation_address` (string, nullable)
  - `consultation_hours` (string, nullable)
- `documents` (array) (default: [])
  - `@type` (string) (default: "ComprasmxDocument")
  - `id` (string, nullable)
  - `number` (integer, nullable)
  - `document_type` (string, nullable)
  - `description` (string, nullable)
  - `file_name` (string, nullable)
  - `created_at` (integer, nullable)
  - `updated_at` (integer, nullable)
- `contracts` (array) (default: [])
  - `@type` (string) (default: "ComprasmxContractSummary")
  - `code` (string, nullable)
  - `internal_reference` (string, nullable)
  - `supplier_name` (string, nullable)
  - `amount` (number, nullable)
  - `amount_with_tax` (number, nullable)
  - `max_amount` (number, nullable)
  - `max_amount_with_tax` (number, nullable)
  - `currency` (string, nullable)
  - `status` (string, nullable)
  - `start_date` (string, nullable)
  - `end_date` (string, nullable)
  - `published_at` (integer, nullable)
  - `is_consolidated_purchase` (boolean, nullable)
- `published_at` (integer, nullable)
- `site_visit_at` (integer, nullable)
- `questions_deadline_at` (integer, nullable)
- `clarifications_deadline_at` (integer, nullable)
- `clarifications_at` (integer, nullable)
- `opening_at` (integer, nullable)
- `award_at` (integer, nullable)
- `estimated_contract_date` (string, nullable)
- `estimated_works_start_date` (string, nullable)
- `is_emergency` (boolean, nullable)
- `is_consolidated_purchase` (boolean, nullable)
- `is_open_contract` (boolean, nullable)
- `is_multi_year` (boolean, nullable)
- `is_sme_exclusive` (boolean, nullable)
- `has_external_credit` (boolean, nullable)
- `has_treaty_coverage` (boolean, nullable)
- `has_advance_payment` (boolean, nullable)
- `has_site_visit` (boolean, nullable)
- `has_social_witness` (boolean, nullable)
- `has_performance_guarantee` (boolean, nullable)
- `has_quality_guarantee` (boolean, nullable)
- `has_other_insurance` (boolean, nullable)
- `allows_joint_bids` (boolean, nullable)
- `allows_simultaneous_supply` (boolean, nullable)
- `allows_subcontracting` (boolean, nullable)
- `allows_subsequent_discounts` (boolean, nullable)
- `allows_guarantee_reduction` (boolean, nullable)
- `url` (string, nullable)

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

No procedure with this identifier on ComprasMX

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

