Files
api2/docs/prices.md
T

164 lines
4.8 KiB
Markdown

# Prices
The prices resource provides a simple API to retrive price information about wallpaper and canvas products.
## Calculate wallpaper price
Calculate price inc VAT of a wallpaper product. The response will contain prices for all available materials.
| Parameter | Description |
| --------- | ------------|
| `width` | Wallpaper width in cm e.g `100` |
| `height` | Wallpaper height in cm e.g `50` |
| `market` | Market id e.g `1` for sweden. Markets affect the price in different ways like VAT, currency exchanges etc. |
| `dealerurl` | Optional parameter e.g `ackes`. Should always be used when calling the api from a dealerstore. If a dealerstore exists with this url additional fees will be applied to the price. |
| `product` | Optional parameter e.g `43894`. If a product with this id exists the api will calculate the price for the given product. |
Sample request
`curl -X GET 'https://api.photowall.com/prices/wallpaper?width=200&height=200&market=1&dealerurl=ackes&product=43894'`
Sample response
```
{
"data": [
{
"m2_price": 295.0,
"m2_price_excl_vat": 236.0,
"material": "standard-wallpaper",
"material_id": 1,
"price": 1180.0,
"price_excl_vat": 944.0
},
{
"m2_price": 325.0,
"m2_price_excl_vat": 260.0,
"material": "premium-wallpaper",
"material_id": 4,
"price": 1300.0,
"price_excl_vat": 1040.0
}
]
}
```
## Calculate external product price
Calculate price inc VAT of a print product printed with an external partner.
| Parameter | Description |
| --------- | ------------|
| `id` | External product id |
| `market` | Market id e.g `1` for sweden. Markets affect the price in different ways like VAT, currency exchanges etc. |
| `product` | Optional parameter e.g `43894`. If a product with this id exists the api will calculate the price for the given product. |
Sample request
`curl -X GET 'https://api.photowall.com/prices/external_product?id=flat_450x600-mm-18x24-inch_200-gsm-80lb-uncoated_4-0_ver&market=1`
Sample response
```
{
"data": [
{
"id": "flat_450x600-mm-18x24-inch_200-gsm-80lb-uncoated_4-0_ver"
"price": 557.5,
"price_excl_vat": 446.0,
}
]
}
```
## Calculate inquiry price
Calculates the price of an inquiry.
For wallpapers inquiries the response will contain price information for all available materials. The width and height stored on the inquiry will be used in the calculations by default. If you want to override these values you can send in your own width/height parameters in the request.
External print products (canvas, posters, framed prints) uses the `external_product_id` attribute.
The `group` attribute tells which kind of product you are dealing with.
Parameters wallpapers
| Parameter | Description |
| --------- | ------------|
| `width` | Width in cm e.g `100`. Defaults to the inquiry stored width |
| `height` | Height in cm e.g `50`. Defaults to the inquiry stored height |
Parameters external print products
| Parameter | Description |
| --------- | ------------|
| `external_product_id` | e.g. `canvas_400x600-mm-16x24-inch_canvas_wood-fsc-slim_4-0_ver` |
| `listprice` | Optional, one of `canvas` or `poster`. Will return the price for the cheapest product in group. Used for "Price from x kr" value |
Wallpaper inquiry - sample request
`curl -X GET 'https://api.photowall.com/prices/inquiry/41015`
Sample response
```
{
"group": "wallpaper",
"height": 600,
"id": 41015,
"prices": [
{
"inquiry_price": 3595.50219975,
"inquiry_price_excl_retouch": 3595.50219975,
"inquiry_price_excl_vat": 2876.4017598,
"inquiry_price_excl_price_premium": 2876.4017598,
"m2_price": 268.72213750000003,
"m2_price_excl_vat": 214.97771,
"material": "standard-wallpaper",
"material_id": 1
},
{
"inquiry_price": 3961.1464912499996,
"inquiry_price_excl_retouch": 3961.1464912499996,
"inquiry_price_excl_vat": 3168.9171929999998,
"inquiry_price_excl_price_premium": 3168.9171929999998,
"m2_price": 296.04981250000003,
"m2_price_excl_vat": 236.83985,
"material": "premium-wallpaper",
"material_id": 4
}
],
"retouch_price": 0,
"width": 223
}
```
## Calculate wallpaper kit price
Calculate the price for a wallpaper kit
| Parameter | Description |
| --------- | ------------|
| `market` | Market id e.g `1` for sweden. Markets affect the price in different ways like VAT, currency exchanges etc. |
| `dealerurl` | Optional parameter e.g `ackes`. Should always be used when calling the api from a dealerstore. If a dealerstore exists with this url additional fees will be applied to the price. |
Sample request
`curl -X GET 'https://api.photowall.com/prices/wallpaper-kit?market=4`
Sample response
```
{
"data": [
{
"price": 166.46999999999997,
"price_excl_vat": 133.176
}
]
}
```