Evaluate Strategy

Changed on

Evaluate a strategy against provided context to return the desired experience.

post/api/public/strategy/evaluate

Request

  • Base URL
    https://start.aftersell.app
  • Auth
    API key in header X-Strategy-Api-Key

Request body

shopDomainstring required

Your store's permanent domain

strategyIdstring required

The strategy ID to evaluate (a single 24-char hex MongoDB ObjectId)

surface'checkout' | 'post_purchase' | 'thank_you' | 'custom' | 'cart' | 'pdp'

Optional surface the evaluation is running on. Recorded for tracing and reporting.

Example request

{
  "context": {
    "localization": {
      "country": "AU",
      "currency": "AUD",
      "language": "en-AU"
    }
  }
}

Response

Evaluation successful

successboolean

Whether the evaluation succeeded

evaluationIdstring

Unique identifier for this evaluation. Echo it back as a line item property (e.g. __as_offer_id) when a shopper adds a recommended product, so the resulting order attributes back to this specific evaluation in AfterSell reporting. Present on successful evaluations; absent on error responses that short-circuit before evaluation.

Changes

    • warning

      removed the request property //

    • warning

      removed the request property //

    • warning

      removed the request property //

    21 more changes in this revision