taler-docs

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

get-private-units.rst (1360B)


      1 .. http:get:: [/instances/$INSTANCE]/private/units
      2 
      3   Returns the list of measurement units available to an instance.
      4 
      5   **Required permission:** ``units-read``
      6 
      7   **Response:**
      8 
      9   :http:statuscode:`200 OK`:
     10     The backend returned the unit catalog. The body is a `UnitListResponse`.
     11 
     12   **Details:**
     13 
     14   .. ts:def:: UnitListResponse
     15 
     16     interface UnitListResponse {
     17       units: MerchantUnit[];
     18     }
     19 
     20   .. ts:def:: MerchantUnit
     21 
     22     interface MerchantUnit {
     23       // Unique serial for the unit.
     24       unit_serial: Integer;
     25 
     26       // Short identifier used in product definitions.
     27       unit: string;
     28 
     29       // Human-readable long label.
     30       unit_name_long: string;
     31 
     32       // Human-readable short label.
     33       unit_name_short: string;
     34 
     35       // Optional translations for the long label.
     36       unit_name_long_i18n?: { [lang_tag: string]: string };
     37 
     38       // Optional translations for the short label.
     39       unit_name_short_i18n?: { [lang_tag: string]: string };
     40 
     41       // Whether fractional quantities are allowed for this unit.
     42       unit_allow_fraction: boolean;
     43 
     44       // Maximum fractional precision (0-6) enforced for this unit.
     45       unit_precision_level: Integer;
     46 
     47       // Whether the unit is currently active.
     48       unit_active: boolean;
     49 
     50       // True if the unit is provided by the backend and cannot be removed.
     51       unit_builtin: boolean;
     52     }