Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.laportenard.com/llms.txt

Use this file to discover all available pages before exploring further.

All order endpoints require authentication.

Create or update order

POST /pos-api/v1/orders/create
Creates a new order or updates an existing one. Order creation is idempotent — sending the same pos_reference returns the existing order.

Key fields

FieldTypeDescription
pos_referencestringUnique order reference (idempotency key)
table_idintegerFloor plan table ID
linesarrayOrder line items
fiscal_typestringNCF fiscal type for Dominican tax
The pos_reference field is the idempotency key. Duplicate submissions with the same reference are safe and return the existing order.

Reserve NCF

POST /pos-api/v1/orders/reserve-ncf
Reserves a fiscal number (NCF) for the order. Required for Dominican tax compliance before finalizing.

Hub batch sync

POST /pos-api/v1/hub/batch-sync
Used by the sync hub to forward completed orders upstream to Odoo. Accepts an array of order snapshots.

Hub order finalization

POST /pos-api/v1/hub/finalize
Called by the sync hub when a terminal completes payment. Receives a full order snapshot (lines, totals, payment lines) and runs the complete Odoo fiscal pipeline (create_from_ui) inside a database savepoint.

Behaviors

BehaviorDetail
Savepointcreate_from_ui runs inside self.env.cr.savepoint() — any failure rolls back atomically, preventing phantom draft orders
Default partnerWhen no customer is provided, falls back to config.default_partner_id
Payment verificationAfter creation, verifies statement_ids are present; raises if empty
IdempotencySame pos_reference returns the existing paid order
Fiscal pipelineFull NCF/DGII processing (same as direct API orders)

Response

{
  "status": "ok",
  "pos_reference": "NU/CFG1/S42/1709123456789-3f7a",
  "order_id": 9585,
  "created": true,
  "line_id_map": { "client-line-1": 12345 },
  "fiscal": {
    "reference": "B0200000160",
    "fiscal_type_code": "B02"
  }
}

Audit

Each hub finalization is logged as a hub_finalize event in the nu_restaurant_pos.order_audit model.