taler-docs

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

get-private-products-PRODUCT_ID.rst (3251B)


      1 .. http:get:: [/instances/$INSTANCE]/private/products/$PRODUCT_ID
      2 
      3   This is used to obtain detailed information about a product in the inventory.
      4 
      5   **Required permission:** ``products-read``
      6 
      7   **Response:**
      8 
      9   :http:statuscode:`200 OK`:
     10     The backend has successfully returned the inventory. Returns
     11     a `ProductDetailResponse`.
     12   :http:statuscode:`404 Not found`:
     13     The product (ID) is unknown to the backend.
     14 
     15   **Details:**
     16 
     17   .. ts:def:: ProductDetailResponse
     18 
     19     interface ProductDetailResponse {
     20 
     21       // Human-readable product name.
     22       // Since API version **v20**.
     23       product_name: string;
     24 
     25       // Human-readable product description.
     26       description: string;
     27 
     28       // Map from IETF BCP 47 language tags to localized descriptions.
     29       description_i18n: { [lang_tag: string]: string };
     30 
     31       // Unit in which the product is measured (liters, kilograms, packages, etc.).
     32       unit: string;
     33 
     34       // Does the backend allow fractional quantities for this unit?
     35       unit_allow_fraction: boolean;
     36 
     37       // Maximum fractional precision (0-6) enforced for inventory operations.
     38       unit_precision_level: Integer;
     39 
     40       // Categories into which the product belongs.
     41       // Since API version **v16**.
     42       categories: Integer[];
     43 
     44       // Price tiers for this product. The first entry represents the base price and MUST include
     45       // applicable taxes. Zero implies the product is not sold separately or that the price is not
     46       // fixed, and must be supplied by the front-end.
     47       unit_price: Amount[];
     48 
     49       // Legacy price field kept for compatibility.
     50       // Deprecated since **v25**;
     51       // equal to the first element of ``unit_price``.
     52       price: Amount;
     53 
     54       // An optional base64-encoded product image.
     55       image: ImageDataUrl;
     56 
     57       // A list of taxes paid by the merchant for one unit of this product.
     58       // Optional since **v15**.
     59       taxes?: Tax[];
     60 
     61       // True if the price(s) given are a net prices, false if they are
     62       // gross prices.
     63       // Since protocol **vTAXES**.
     64       price_is_net: boolean;
     65 
     66       // Legacy integer stock counter kept for compatibility. ``-1`` indicates unlimited stock.
     67       total_stock: Integer;
     68 
     69       // Stock expressed using "<integer>[.<fraction>]" syntax with up to six fractional digits.
     70       // Use ``"-1"`` for unlimited stock.
     71       unit_total_stock: DecimalQuantity;
     72 
     73       // Number of units of the product that have already been sold.
     74       total_sold: Integer;
     75 
     76       // Number of units of the product that were lost (spoiled, stolen, etc.).
     77       total_lost: Integer;
     78 
     79       // Identifies where the product is in stock.
     80       // Optional since **v15**.
     81       address?: Location;
     82 
     83       // Identifies when we expect the next restocking to happen.
     84       next_restock?: Timestamp;
     85 
     86       // Minimum age buyer must have (in years).
     87       minimum_age?: Integer;
     88 
     89       // Product group the product belongs to. Missing means default.
     90       // Since **v25**.
     91       product_group_id?: Integer;
     92 
     93       // Money pot revenue on the product should be accounted in.
     94       // Missing means no money pot (revenue accounted
     95       // in money pot of the overall order or not at all).
     96       // Since **v25**.
     97       money_pot_id?: Integer;
     98 
     99     }