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.

Sale orders created in Odoo’s Sales module can be loaded into the POS for fulfillment. This bridges the back-office order flow with the restaurant POS.

API endpoints

EndpointPurpose
POST /pos-api/v1/sale-orders/listList sale orders for a customer (by partner_id)
POST /pos-api/v1/sale-orders/loadLoad a sale order into POS-compatible format

Loading flow

1

Select customer

A customer must be assigned to the order. The system fetches their pending sale orders.
2

Pick sale order

The sale order picker displays pending orders with name, date, and total amount. The user selects one.
3

Load into POS

Calls /pos-api/v1/sale-orders/load with the sale order ID and POS config ID. Returns order lines with product, quantity, price, discount, and tax information.
4

Add to current order

The loaded lines are added to the active POS order. Products are matched by ID and taxes are mapped to the POS tax configuration.

Response format

The loadSaleOrder endpoint returns:
interface LoadSaleOrderResult {
  sale_order: {
    id: number;
    name: string;
  };
  lines: SaleOrderLine[];
}

interface SaleOrderLine {
  productId: number;
  productName: string;
  quantity: number;
  priceUnit: number;
  discount: number;
  taxIds: number[];
}

Error handling

The API client uses a custom SaleOrderLoadError class that includes an error code and details, handling both API-level errors and validation failures (e.g., product not found in POS catalog).

Source files

src/domain/sale-orders/api.ts      # API client
src/domain/sale-orders/models.ts   # Type definitions