Batches are the entry point for all medical gas cylinders in OxygenDispatch. When a supplier delivers a shipment of cylinders, you create a batch to record the event — capturing the supplier identity, voucher documents, sanitary data, and the date cylinders were received. All individual tank units in the system trace back to the batch they arrived in, making batches the root of the full inventory audit trail.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Janblack07/OxygenDispatch/llms.txt
Use this file to discover all available pages before exploring further.
What is a batch?
A batch represents a single supplier shipment. It is the parent record for every tank unit generated from that delivery. The following data is held at the batch level:| Field | Description |
|---|---|
batch_number | A unique identifier for this shipment (e.g. LOTE-2026-001) |
document_number | The order number, delivery note, or remission document for this shipment |
supplier_name | The name of the supplying company |
supplier_code | The supplier’s internal or registry code |
voucher_type | The type of fiscal voucher (e.g. invoice, note) |
voucher_number | The number printed on the fiscal voucher |
voucher_date | The date the voucher was issued |
received_at | The date and time the batch was physically received |
sanitary_registry | A reference sanitary registry code for this shipment |
manufactured_at | The manufacture date recorded on the delivery |
notes | Free-text notes about this shipment (no length limit) |
expires_at | The expiry date recorded at the batch level |
gas_type and a capacity as referential catalog links. Actual gas type and capacity on individual cylinders are determined by the product selected when generating tanks.
Creating a batch
Submit aPOST /batches request using the form fields below. All nullable fields are optional — you can register a minimal batch with only batch_number and received_at and fill in the rest later via PUT /batches/{batch}.
A unique human-readable identifier for this batch. Maximum 100 characters. Must not already exist in the
batches table.The date (or date-time) the shipment was received at the facility. Accepts any format parseable by PHP’s
strtotime.Optional reference to a gas type catalog entry (
gas_types.id). Used for filtering and reporting at the batch level.Optional reference to a cylinder capacity catalog entry (
cylinder_capacities.id).Free-text notes about this shipment — inspection observations, delivery conditions, or any other contextual information. No maximum length enforced.
The delivery note, order, or remission number. Maximum 100 characters.
Full legal name of the supplying company. Maximum 200 characters.
The supplier’s internal or government-issued code. Maximum 100 characters.
Type of fiscal voucher accompanying the shipment (e.g.
Factura, Boleta, Guía). Maximum 50 characters.The number printed on the fiscal voucher. Maximum 100 characters.
The date the voucher was issued.
Sanitary registry reference code for this shipment. Maximum 100 characters.
Manufacture date as recorded on the delivery documentation.
Batch-level expiry date. Individual tank units each carry their own
expires_at set at generation time.GET /batches/{batch} — the batch detail page.
Generating tank units
Once a batch is created, you can generate the individual cylinder records that belong to it. Submit aPOST /batches/{batch}/generate-tanks request to bulk-create serialized tank units.
Number of tanks to generate. Must be between 1 and 5000 inclusive.
The catalog product (
catalog_products.id) each generated tank will be linked to. Gas type and capacity are resolved from the product — not entered separately.Expiry date to assign to every generated tank unit. Must be today or a future date and must not exceed 50 years from today.
A short alphanumeric prefix for the serial numbers. Maximum 10 characters. Only letters, digits, hyphens (
-), and underscores (_) are allowed (regex ^[A-Za-z0-9_-]+$). Defaults to OXI if omitted.Serial number format
Each generated tank receives a serial number composed of the prefix and a zero-padded 6-digit counter, separated by a hyphen:OXI:
serial_number for that prefix in the database, incremented inside a database transaction with lockForUpdate() to prevent duplicate serials under concurrent requests.
Fixed initial state
Regardless of any other data, every tank generated through this endpoint is always placed into the following initial state:| Attribute | Fixed value |
|---|---|
warehouse_area | Recepción |
technical_status | Pendiente |
Filtering and searching batches
The batch list atGET /batches supports the following query string parameters to narrow results. All filters are combinable and are applied with AND logic. Results are paginated at 15 per page.
| Parameter | Type | Behaviour |
|---|---|---|
q | string | Partial match on batch_number OR document_number (case-insensitive LIKE) |
gas_type_id | integer | Exact match on the batch’s linked gas type |
capacity_id | integer | Exact match on the batch’s linked cylinder capacity |
Batch detail page
GET /batches/{batch} loads the full detail view for a single batch, eager-loading all related data. The page displays:
- The batch’s gas type and cylinder capacity (from catalog references)
- All associated tank units, each showing:
- The linked catalog product and its capacity
- Current warehouse area
- Current technical status
- Quick-action forms for generating additional tanks and managing existing units