E-commerce API
POST /services/webshop/v1/pricing/resolve Public

Resolve Contextual Prices

Returns ONLY the products whose price changes for this visitor (customer or campaign overlay). Products absent from the response should keep their static price.

Request Body Required

FieldTypeRequiredDescriptionExample
website_id string Yes 1
project_id string Yes 1
campaign_key string|null
max: 64
No BLACK_FRIDAY
product_ids integer[] Yes [12,14,18]

Responses

200
422
429
Resolved overlays keyed by product id
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 120
X-RateLimit-Remaining integer Number of requests remaining in the current window 117
FieldTypeDescription
data string
context object
context.campaign_key string customer_id intentionally not returned — the frontend sent the Bearer token, so it already knows who's logged in. Re-echoing it would only add noise (and a tiny info leak in shared network logs).
context.campaign_applied string
Validation error
FieldTypeDescription
message string Errors overview.
errors object A detailed description of each field that failed validation.
Too Many Requests — rate limit exceeded
Headers
HeaderTypeDescriptionExample
X-RateLimit-Limit integer Maximum number of requests allowed per minute 120
X-RateLimit-Remaining integer Number of requests remaining in the current window 117
Retry-After integer Seconds until the rate limit resets 60
FieldTypeDescription
error boolean
message string
Base URL
https://api.wemasy.nl/api
Authentication

Request Sample
cURL
JS
PHP
Python
curl -X POST "https://api.wemasy.nl/api/services/webshop/v1/pricing/resolve" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "website_id": "1",
    "project_id": "1",
    "campaign_key": "BLACK_FRIDAY",
    "product_ids": [
        12,
        14,
        18
    ]
}'
fetch('https://api.wemasy.nl/api/services/webshop/v1/pricing/resolve', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Accept': 'application/json',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "website_id": "1",
    "project_id": "1",
    "campaign_key": "BLACK_FRIDAY",
    "product_ids": [
        12,
        14,
        18
    ]
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
    ->accept('application/json')
    ->post('https://api.wemasy.nl/api/services/webshop/v1/pricing/resolve', {
    "website_id": "1",
    "project_id": "1",
    "campaign_key": "BLACK_FRIDAY",
    "product_ids": [
        12,
        14,
        18
    ]
});
$data = $response->json();
import requests

headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Accept": "application/json"
}
data = {
    "website_id": "1",
    "project_id": "1",
    "campaign_key": "BLACK_FRIDAY",
    "product_ids": [
        12,
        14,
        18
    ]
}
r = requests.post("https://api.wemasy.nl/api/services/webshop/v1/pricing/resolve", headers=headers, json=data)
print(r.json())
Response Example
{
    "data": {
        "12": {
            "price_excl_tax": 22,
            "price_incl_tax": 26.62,
            "original_price_excl_tax": 39.99,
            "original_price_incl_tax": 48.39,
            "discount_label": "-45%",
            "source": "customer"
        }
    },
    "context": {
        "customer_id": 7,
        "campaign_key": "BLACK_FRIDAY",
        "campaign_applied": true
    }
}

Try It
Request Body Required

Export