Glue API: Retrieve sales units

Edit on GitHub

This endpoint allows retrieving sales units of concrete products.

Installation

For detailed information on the modules that provide the API functionality and related installation instructions, see:

Retrieve sales units

To retrieve sales units of a concrete product, send the request:


GET /concrete-products/{{concrete_product_sku}}/sales-units


PATH PARAMETER DESCRIPTION
{{concrete_product_sku}} SKU of a concrete product to get sales units for.

Request

Request sample: retrieve sales units

GET http://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units

Response

Response sample: retrieve sales units
{
    "data": [
        {
            "type": "sales-units",
            "id": "34",
            "attributes": {
                "conversion": 0.01,
                "precision": 10,
                "isDisplayed": true,
                "isDefault": false,
                "productMeasurementUnitCode": "CMET"
            },
            "links": {
                "self": "http://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units/34"
            }
        },
        {
            "type": "sales-units",
            "id": "33",
            "attributes": {
                "conversion": 1,
                "precision": 100,
                "isDisplayed": true,
                "isDefault": true,
                "productMeasurementUnitCode": "METR"
            },
            "links": {
                "self": "http://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units/33"
            }
        }
    ],
    "links": {
        "self": "http://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units"
    }
}

ATTRIBUTE TYPE DESCRIPTION
conversion integer Factor to convert a value from sales to base unit. If it is “null”, the information is taken from the global conversions.
precision integer Ratio between a sales unit and a base unit.
is displayed boolean Defines if the sales unit is displayed on the product details page.
is default boolean Defines if the sales unit is selected by default on the product details page.
measurementUnitCode string Code of the measurement unit.

See Retrieve measurement units for more information on managing the sales units.

Possible errors

CODE REASON
302 Concrete product is not found.
312 Concrete product SKU is not specified.

To view generic errors that originate from the Glue Application, see Reference information: GlueApplication errors.