Evaluate Strategy
Evaluate a strategy against provided context to return the desired experience.
POST
/
api
/
public
/
strategy
/
evaluate
Evaluate Strategy
curl --request POST \
--url https://start.aftersell.app/api/public/strategy/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Strategy-Api-Key: <api-key>' \
--data '
{
"shopDomain": "<string>",
"strategyId": "<string>",
"context": {
"products": [
{
"productId": "<string>",
"variantId": "<string>",
"quantity": 1,
"price": 1,
"handle": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"tags": [
"<string>"
],
"collections": [
"<string>"
],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
}
],
"cartToken": "<string>",
"checkoutToken": "<string>",
"sessionId": "<string>",
"cart": {
"subtotal": 1,
"itemCount": 1,
"lineCount": 1,
"attributes": {},
"notes": "<string>"
},
"customer": {
"customerId": "<string>",
"tags": [
"<string>"
],
"countryCode": "<string>",
"provinceCode": "<string>",
"locale": "<string>",
"orderCount": 1,
"totalSpent": 1,
"acceptsMarketing": true
},
"session": {
"utmSource": "<string>",
"utmMedium": "<string>",
"utmCampaign": "<string>",
"utmContent": "<string>",
"utmTerm": "<string>",
"currencyCode": "<string>",
"shippingCountryCode": "<string>",
"shippingProvinceCode": "<string>",
"shippingMethod": "<string>"
}
}
}
'{
"success": true,
"products": [
{
"productId": "<string>",
"handle": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"price": "<string>",
"compareAtPrice": "<string>",
"availableForSale": true,
"description": "<string>",
"url": "<string>",
"tags": [
"<string>"
],
"collectionIds": [
"<string>"
],
"images": [
{
"src": "<string>",
"altText": "<string>",
"position": 123
}
],
"variants": [
{
"variantId": "<string>",
"title": "<string>",
"price": "<string>",
"compareAtPrice": "<string>",
"availableForSale": true,
"sku": "<string>",
"selectedOptions": [
{
"name": "<string>",
"value": "<string>"
}
]
}
]
}
],
"resolution": {
"strategyId": "<string>",
"matchedRuleIds": [
"<string>"
],
"selectionMethod": "<string>",
"fallbackUsed": true
},
"meta": {
"servedFromCache": true,
"processingTimeMs": 123,
"data": {},
"explanation": "<string>"
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}
Documentation Index
Fetch the complete documentation index at: https://docs.aftersell.com/llms.txt
Use this file to discover all available pages before exploring further.
Authorizations
Body
application/json
Was this page helpful?
Previous
Post-Purchase AnalyticsUnderstand your post-purchase funnel performance and product page upsell metrics in Aftersell.
Next
⌘I
Evaluate Strategy
curl --request POST \
--url https://start.aftersell.app/api/public/strategy/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Strategy-Api-Key: <api-key>' \
--data '
{
"shopDomain": "<string>",
"strategyId": "<string>",
"context": {
"products": [
{
"productId": "<string>",
"variantId": "<string>",
"quantity": 1,
"price": 1,
"handle": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"tags": [
"<string>"
],
"collections": [
"<string>"
],
"metafields": [
{
"namespace": "<string>",
"key": "<string>",
"value": "<string>"
}
]
}
],
"cartToken": "<string>",
"checkoutToken": "<string>",
"sessionId": "<string>",
"cart": {
"subtotal": 1,
"itemCount": 1,
"lineCount": 1,
"attributes": {},
"notes": "<string>"
},
"customer": {
"customerId": "<string>",
"tags": [
"<string>"
],
"countryCode": "<string>",
"provinceCode": "<string>",
"locale": "<string>",
"orderCount": 1,
"totalSpent": 1,
"acceptsMarketing": true
},
"session": {
"utmSource": "<string>",
"utmMedium": "<string>",
"utmCampaign": "<string>",
"utmContent": "<string>",
"utmTerm": "<string>",
"currencyCode": "<string>",
"shippingCountryCode": "<string>",
"shippingProvinceCode": "<string>",
"shippingMethod": "<string>"
}
}
}
'{
"success": true,
"products": [
{
"productId": "<string>",
"handle": "<string>",
"title": "<string>",
"vendor": "<string>",
"productType": "<string>",
"price": "<string>",
"compareAtPrice": "<string>",
"availableForSale": true,
"description": "<string>",
"url": "<string>",
"tags": [
"<string>"
],
"collectionIds": [
"<string>"
],
"images": [
{
"src": "<string>",
"altText": "<string>",
"position": 123
}
],
"variants": [
{
"variantId": "<string>",
"title": "<string>",
"price": "<string>",
"compareAtPrice": "<string>",
"availableForSale": true,
"sku": "<string>",
"selectedOptions": [
{
"name": "<string>",
"value": "<string>"
}
]
}
]
}
],
"resolution": {
"strategyId": "<string>",
"matchedRuleIds": [
"<string>"
],
"selectionMethod": "<string>",
"fallbackUsed": true
},
"meta": {
"servedFromCache": true,
"processingTimeMs": 123,
"data": {},
"explanation": "<string>"
},
"errors": [
{
"code": "<string>",
"message": "<string>"
}
]
}