Get a product custom price for a business
GET/api/v1/supplier_products/:id/custom_prices/:business_id
This EP allows you to retrieve the custom price a business is linked to, for a given product. As an option, you can decide if you want the EP to return the default price if no custom price exists.
Request
Path Parameters
id stringrequired
id of the product of which price you want to retrieve
business_id stringrequired
Query Parameters
fallback_to_default boolean
Pass 'true' if you want to have the default price returned as a fallback if no custom price exists. Pass 'false' if '404 Not Found' should be returned instead.
Responses
- 200
Returns a price object linked to the business and product passed in the request. Returns '404 Not Found' if no custom price is found and fallback_to_default is set to false.
- application/vnd.api+json
- Schema
- Example (from schema)
- Example
Schema
data
object
required
id string
type string
attributes
object
in-cents integer
default boolean
supplier-product-id string
businesses array
custom-ref string
{
"data": {
"id": "string",
"type": "string",
"attributes": {
"in-cents": 0,
"default": true,
"supplier-product-id": "string",
"businesses": [
null
],
"custom-ref": "string"
}
}
}
{
"data": {
"id": "c4b81084-9903-411c-a63d-7a19061df864",
"type": "prices",
"attributes": {
"in-cents": 10000,
"default": false,
"supplier-product-id": "20ae7da2-fd68-4619-8a84-ce567d658e64",
"businesses": [
"214e7ec1-d740-45d9-a598-0f5367bc6bcb",
"c2d53c04-4fcc-499c-ba0e-b4255605491d"
],
"custom-ref": "7f647421-81c4-4444-b708-cda3c93696b2"
}
}
}
Loading...