taler-docs

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

get-private-categories.rst (1107B)


      1 .. http:get:: [/instances/$INSTANCE]/private/categories
      2 
      3   This request returns the known product categories
      4   and the number of products in each category.
      5   Since API version **v16**.
      6 
      7   **Required permission:** ``categories-read``
      8 
      9   **Response:**
     10 
     11   :http:statuscode:`200 Ok`:
     12     The body is a `CategoryListResponse`.
     13   :http:statuscode:`500 Internal Server Error`:
     14     The server experienced an internal failure.
     15     Returned with ``TALER_EC_GENERIC_DB_FETCH_FAILED``.
     16 
     17   **Details:**
     18 
     19   .. ts:def:: CategoryListResponse
     20 
     21     interface CategoryListResponse {
     22 
     23       // Array with all of the categories we know.
     24       categories: CategoryListEntry[];
     25 
     26     }
     27 
     28   .. ts:def:: CategoryListEntry
     29 
     30     interface CategoryListEntry {
     31 
     32       // Unique number for the category.
     33       category_id: Integer;
     34 
     35       // Name of the category.
     36       name: string;
     37 
     38       // Translations of the name into various
     39       // languages.
     40       name_i18n?: { [lang_tag: string]: string };
     41 
     42       // Number of products in this category.
     43       // A product can be in more than one category.
     44       product_count: Integer;
     45 
     46     }