add support for product price calculations

This commit is contained in:
Martin
2016-11-19 19:56:39 +01:00
parent b5c8145f96
commit 3433113cb9
5 changed files with 145 additions and 32 deletions
+17 -9
View File
@@ -12,27 +12,30 @@ Calculate price inc VAT of a wallpaper product. The response will contain prices
| `height` | Wallpaper height in cm e.g `50` |
| `territory` | Two letter iso code e.g `SE`. Territory 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://api2.photowall.com/prices/wallpaper?width=200&height=200&territory=SE&dealerurl=ackes'`
`curl -X GET 'https://api2.photowall.com/prices/wallpaper?width=200&height=200&territory=SE&dealerurl=ackes&product=43894'`
Sample response
```
{
"data": [
{
"m2_price": 295.0,
"material": "standard-wallpaper",
"material_id": 1,
"m2_price": 295,
"price": 1180
"price": 1180.0,
"price_excl_vat": 944.0
},
{
"m2_price": 325.0,
"material": "premium-wallpaper",
"material_id": 4,
"m2_price": 325,
"price": 1300
"price": 1300.0,
"price_excl_vat": 1040.0
}
]
}
@@ -48,6 +51,7 @@ Calculate price inc VAT of a canvas product. The response will contain informati
| `height` | Canvas height in cm e.g `50` |
| `territory` | Two letter iso code e.g `SE`. Territory 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
@@ -60,15 +64,19 @@ Sample response
"data": [
{
"framed": true,
"price": 284,
"width": 100,
"height": 50,
"m2_price": 252.37137599999997,
"price": 224.92771680815997,
"price_excl_vat": 179.942173446528,
"width": 100
},
{
"framed": false,
"price": 249,
"width": 100,
"height": 50,
"m2_price": 252.37137599999997,
"price": 126.18568799999998,
"price_excl_vat": 100.94855039999999,
"width": 100
}
]
}