taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

get-private-pos.rst (3354B)


      1 .. http:get:: [/instances/$INSTANCE]/private/pos
      2 
      3   This is used to return the point-of-sale (POS) configuration with full details on all items in the inventory.
      4 
      5   Endpoint was introduced in protocol **v15**.
      6 
      7   **Required permission:** ``products-read``
      8 
      9   **Response:**
     10 
     11   :http:statuscode:`200 OK`:
     12     The backend has successfully returned the inventory. Returns
     13     a `FullInventoryDetailsResponse`.
     14   :http:statuscode:`404 Not found`:
     15     The backend has does not know about the instance.
     16   :http:statuscode:`500 Internal Server Error`:
     17     The server experienced an internal failure.
     18     Returned with ``TALER_EC_GENERIC_DB_FETCH_FAILED``.
     19 
     20   **Details:**
     21 
     22   .. ts:def:: FullInventoryDetailsResponse
     23 
     24     interface FullInventoryDetailsResponse {
     25 
     26       // List of products that are present in the inventory.
     27       products: MerchantPosProductDetail[];
     28 
     29       // List of categories in the inventory.
     30       categories: MerchantCategory[];
     31 
     32     }
     33 
     34   .. ts:def:: MerchantPosProductDetail
     35 
     36     interface MerchantPosProductDetail {
     37 
     38       // A unique numeric ID of the product
     39       product_serial: Integer;
     40 
     41       // A merchant-internal unique identifier for the product.
     42       product_id: string;
     43 
     44       // Human-readable product name.
     45       // Since API version **v20**.
     46       product_name: string;
     47 
     48       // A list of category IDs this product belongs to.
     49       // Typically, a product only belongs to one category, but more than one is supported.
     50       categories: Integer[];
     51 
     52       // Human-readable product description.
     53       description: string;
     54 
     55       // Map from IETF BCP 47 language tags to localized descriptions.
     56       description_i18n: { [lang_tag: string]: string };
     57 
     58       // Unit in which the product is measured (liters, kilograms, packages, etc.).
     59       unit: string;
     60 
     61       // Does the backend allow fractional quantities for this unit?
     62       unit_allow_fraction: boolean;
     63 
     64       // Maximum fractional precision (0-6) enforced for inventory operations.
     65       unit_precision_level: Integer;
     66 
     67       // Price tiers for this product. The first entry represents the base price and MUST include
     68       // applicable taxes. Zero implies the product is not sold separately or that the price is not
     69       // fixed, and must be supplied by the front-end.
     70       unit_price: Amount[];
     71 
     72       // Legacy price field kept for compatibility. Deprecated; equal to the first element of ``unit_price``.
     73       price: Amount;
     74 
     75       // An optional base64-encoded product image.
     76       image?: ImageDataUrl;
     77 
     78       // A list of taxes paid by the merchant for one unit of this product.
     79       taxes?: Tax[];
     80 
     81       // Legacy integer stock counter kept for compatibility. ``-1`` indicates unlimited stock.
     82       total_stock?: Integer;
     83 
     84       // Stock expressed using "<integer>[.<fraction>]" syntax with up to six fractional digits.
     85       // Use ``"-1"`` for unlimited stock.
     86       unit_total_stock: string;
     87 
     88       // Minimum age buyer must have (in years).
     89       minimum_age?: Integer;
     90 
     91     }
     92 
     93   .. ts:def:: MerchantCategory
     94 
     95     interface MerchantCategory {
     96       // A unique numeric ID of the category
     97       id: Integer;
     98 
     99       // The name of the category. This will be shown to users and used in the order summary.
    100       name: string;
    101 
    102       // Map from IETF BCP 47 language tags to localized names
    103       name_i18n?: { [lang_tag: string]: string };
    104     }