taler-docs

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

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


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