POST/tenants/{tenantId}/transactions/simulate

Run earn-rule evaluation without writing to the database. The response looks identical to evaluate() — same pointsAwarded, same campaigns[] — but no member is created, no transaction is recorded, and no points are credited.

sk_test_* keys only

This endpoint is only available with test API keys. It is not available in production.

Path Parameters

tenantIdstring uuid
required
Your tenant UUID.

Request Body

memberRefstring
required
Your customer's identifier. Member does not need to exist.
amountinteger
required
Basket total in cents.
storeRefstring
optional
Store identifier for store-targeted campaigns.
productsarray
optional
Line items for product-purchase campaign evaluation.

Response 200

Same shape as evaluate() — see the evaluate reference for field descriptions.

When to use simulate vs evaluate

simulateevaluate
Writes to DB
Awards points
Creates member if new
"You would earn X" previews
Campaign QA testing
Available in production

Request

cURL
curl -X POST "https://loyalty-engine-production-e5cb.up.railway.app/v1/tenants/$TENANT_ID/transactions/simulate" \
  -H "X-API-Key: sk_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "memberRef": "customer_27821234567",
    "amount":    25000
  }'

Response

200 OK
{
  "pointsAwarded": 250,
  "pointsBalance": 1700,
  "campaigns": [
    {
      "campaignId":   "5a7b3c9d-...",
      "campaignName": "Spend & Earn",
      "pointsEarned": 250,
      "rewardIds":    []
    }
  ],
  "state": "PROCESSED",
  "_debug": null
}
Simulate — API Reference