Skip to content

Estimate the points a cart would earn

POST /estimates
Scopeprogram:read
Customer session tokenAccepted with the read scope, for the token’s own customer
Rate limit classread (limits)
Idempotency keyNot needed: this call has no side effect
MCP toolcharm_estimate_cart_points

The points a whole cart would earn, computed like the order award: line exclusions, the program’s amount basis and tax handling, order campaigns and, with customer_id, the customer’s tier multiplier. Send unit prices in the shop currency; no Shopify lookup happens. No idempotency key: an estimate has no side effect.

FieldTypeDescription
linesarray of object
customer_idstringPrices the cart for this customer (tier, campaigns). (optional)
discounts_totalnumberOrder-level discounts in the shop currency. (optional)

Returns CartEstimate.

FieldTypeDescription
enabledbooleanFalse when nothing would be earned; see reason.
reasonstring or null: program_disabled, no_points_layer, customer_excluded, no_eligible_lines, nothing_earned(nullable)
pointsintegerTotal the cart would earn.
base_pointsintegerBefore tier and campaign multipliers.
bonus_pointsintegerFrom the tier multiplier and campaigns.
tier_multipliernumber
campaign_multipliernumber
points_per_currencynumberThe order rule’s rate, points per unit of the shop currency.
eligible_amountnumberThe amount that earns, in the shop currency, after exclusions and tax handling.
linesarray of CartEstimateLine
currencystring or null(nullable)
customer_idstring or nullThe customer the estimate was priced for; null for anonymous. (nullable)
estimatetrue
{
"enabled": true,
"reason": "program_disabled",
"points": 120,
"base_points": 120,
"bonus_points": 120,
"tier_multiplier": 1,
"campaign_multiplier": 1,
"points_per_currency": 120,
"eligible_amount": 1,
"lines": [
{
"index": 1,
"product_id": "8123456789",
"eligible": false
}
],
"currency": "EUR",
"customer_id": "gid://shopify/Customer/7712345",
"estimate": true
}
Terminal window
curl -X POST "https://charm.appfleece.app/api/v1/estimates" \
-H "Authorization: Bearer chrm_live_..." \
-H "Content-Type: application/json" \
-d '{"lines":[{"product_id":"8123456789","variant_id":"44123456789","price":1,"quantity":1,"collection_ids":["collection ids"],"tags":["tags"]}]}'

unauthorized · invalid_token · token_expired · insufficient_scope · access_required · validation_error · rate_limited

Every error body carries code, message, request_id and a doc_url pointing at the matching entry in the error catalog.