Index | Conventions

api/v1/stock/{stockno}/prices

Path: api/v1/stock/{stockno}/prices

This API is JSON:API compliant.

This endpoint supports the following methods:
GET

This endpoint requires an OAuth bearer token, and returns errors in a standard shape. See API Conventions for authentication, error responses and paging, which apply to every endpoint.

The resource type for this endpoint is StockPrices
The identifier is stockNo-stockPriceId

Attributes

The StockPrices resource type attributes are as follows:

AttributeTypeDescription
basePriceLevelstringThe base price level this price is derived from.
branchCodestringThe branch code.
Branches are optional in Jim2 - this is only set when your site is configured to use branches.
Note: Will not be returned in the response if value is null.
branchNointegerThe internal branch number used to identify the branch.
Branches are optional in Jim2 - this is only set when your site is configured to use branches.
Note: Will not be returned in the response if value is null.
currencyCodestringThe currency code for the price.
discountPercnumberThe discount percentage applied to the base price.
priceBreaksarray of objectQuantity price breaks for this price level.
See the priceBreaks section below.
priceCalcMethodstringHow the price is calculated (e.g. Fixed Price, Last COGS + Markup, List - Discount).
priceExclnumberThe price excluding tax.
priceInclnumberThe price including tax.
priceLevelstringThe price level (label, prefixed with the level number for custom levels).
stockPriceIdintegerThe internal price id used to identify the price.
taxCodestringThe tax code for the price.

priceBreaks

Attributes of each element in the priceBreaks array.

AttributeTypeDescription
discountPercnumberThe discount percentage at this price break.
priceExclnumberThe price excluding tax at this price break.
priceInclnumberThe price including tax at this price break.
qtyGreaterOrEqualnumberThe minimum quantity (>=) at which this price break applies.

Example GET (Return all)

Path: api/v1/stock/10/prices

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

This is a list. To keep the example readable, only the first item below is written out; the later items have been trimmed down in this documentation. In a real response each item comes back with the data applicable to that record (as described above).

Side-loading related resources with the include query parameter is not supported on list endpoints: an include parameter is ignored here and no included section is returned. To retrieve a related resource, request it directly using the id shown in each item's relationships, or use the single-resource (get by id) endpoint, which does support include.

{
    "data": [
        {
            "id": "10-123",
            "type": "StockPrices",
            "attributes": {
				"stockPriceId": 123,
                "priceLevel": "1-Retail",
                "priceCalcMethod": "List - Percent",
                "basePriceLevel": "",
                "currencyCode": "AUD",
                "taxCode": "G",
                "branchNo": 1,
                "branchCode": "ACT",
                "discountPerc": 0.0,
                "priceExcl": 44.37,
                "priceIncl": 48.807,
                "priceBreaks": [
                    {
                        "qtyGreaterOrEqual": 10.0,
                        "discountPerc": 5.0,
                        "priceExcl": 42.15,
                        "priceIncl": 46.365
                    },
                    {
                        "qtyGreaterOrEqual": 50.0,
                        "discountPerc": 10.0,
                        "priceExcl": 39.93,
                        "priceIncl": 43.923
                    },
                    {
                        "qtyGreaterOrEqual": 100.0,
                        "discountPerc": 15.0,
                        "priceExcl": 37.71,
                        "priceIncl": 41.481
                    }
                ]
            }
        },
        {
            "id": "10-129",
            "type": "StockPrices",
            "attributes": {
                "priceLevel": "3-Do & Charge",
                "priceExcl": 44.37
            }
        }
	]
}

Example GET (Return specific)

Path: api/v1/stock/10/prices/10-129

Response:

This example shows the maximum set of fields the endpoint can return, all populated. A real response only contains the data that applies to that record, so fields that are empty or not relevant are omitted — do not assume every field shown here will be present in every response.

{
    "data": {
		"id": "10-129",
		"type": "StockPrices",
		"attributes": {
			"stockPriceId": 129,
			"priceLevel": "3-Do & Charge",
			"priceCalcMethod": "List - Percent",
			"basePriceLevel": "",
			"currencyCode": "AUD",
			"taxCode": "G",
			"branchNo": 1,
			"branchCode": "ACT",
			"discountPerc": 0.0,
			"priceExcl": 44.37,
			"priceIncl": 48.807,
			"priceBreaks": [
				{
					"qtyGreaterOrEqual": 10.0,
					"discountPerc": 5.0,
					"priceExcl": 42.15,
					"priceIncl": 46.365
				},
				{
					"qtyGreaterOrEqual": 50.0,
					"discountPerc": 10.0,
					"priceExcl": 39.93,
					"priceIncl": 43.923
				},
				{
					"qtyGreaterOrEqual": 100.0,
					"discountPerc": 15.0,
					"priceExcl": 37.71,
					"priceIncl": 41.481
				}
			]
		}
	}
}