Add external product prices (#47)

Co-authored-by: Niklas Fondberg <niklas.fondberg@photowall.se>
This commit is contained in:
Fredrik Ringqvist
2022-02-17 12:52:04 +01:00
committed by GitHub
co-authored by Niklas Fondberg
parent f0b18c6757
commit b1177a1e1c
5 changed files with 244 additions and 3 deletions
+29 -1
View File
@@ -152,6 +152,33 @@ Sample response
}
```
## 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 "Do it yourself frame" price
Calculate the price for the "do it yourself frame" (DIY). Note that width and height parameters may be adjusted if they go over or under the limits that are valid for a canvas-frame. The values that are used in the price-calculation are always returned in the response.
@@ -211,13 +238,14 @@ Sample response
## Calculate inquiry price
Calculates the price of an inquiry. For wallpapers inquiries the response will contain price information for all available materials and for canvas it will contain the price for both the framed and the not-framed canvas. The `group` attribute tells which kind of product you are dealing with.
Calculates the price of an inquiry. For wallpapers inquiries the response will contain price information for all available materials and for canvas it will contain the price for both the framed and the not-framed canvas. External print products uses the `external_product_id` attribute. The `group` attribute tells which kind of product you are dealing with.
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.
| 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 |
| `external_product_id` | e.g. `canvas_400x600-mm-16x24-inch_canvas_wood-fsc-slim_4-0_ver` |
Wallpaper inquiry - sample request