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