Retrieving sales units
Edit on GitHub
You are browsing a previous version of the document. The latest version is 202212.0.
This endpoint allows to retrieve 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: GET https://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units
Response
Response sample
{
"data": [
{
"type": "sales-units",
"id": "34",
"attributes": {
"conversion": 0.01,
"precision": 10,
"isDisplayed": true,
"isDefault": false,
"productMeasurementUnitCode": "CMET"
},
"links": {
"self": "https://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": "https://glue.mysprykershop.com/concrete-products/cable-vga-1-2/sales-units/33"
}
}
],
"links": {
"self": "https://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 Retrieving Measurement Units for more information on managing the sales units.
Possible errors
Code | Reason |
---|---|
302 | Concrete product is not found. |
To view generic errors that originate from the Glue Application, see Reference information: GlueApplication errors.
Thank you!
For submitting the form