Skip to main content
POST
Custom actions let you award points for things that happen outside Shopify — a mobile app install, an in-app purchase, an event check-in, a completed survey, or any milestone your own systems track. You create a custom action once in the Mage admin (Loyalty Program → Earning rules → Advanced → Custom Action), give it a stable action key, then call this endpoint from your backend whenever the action happens. You can also trigger it with no code using the Shopify Flow action.
Custom actions are available on the Growth plan and above. The customer must already be a loyalty member — a call for someone who is not enrolled returns 404.
Points come from the rule’s configured amount, with any applicable VIP tier and bonus campaign multipliers applied automatically. Each rule is either once per customer or unlimited, depending on how you configured it.

Request body

Idempotency

If you pass an idempotency_key, a repeated request with the same key for the same rule returns the original award with 200 OK and replayed: true — points are never granted twice. For an unlimited rule where each completion should count once, set the key to a stable id for that completion, such as an event id or order id.
An unlimited rule awards on every call. Without an idempotency_key there is nothing to deduplicate on, so any retry — a network failure, an app relaunch, a repeated event — awards again and double-grants points. Always send a stable idempotency_key per real completion on unlimited rules.Once-per-customer rules are protected regardless: a second award returns 409, with or without a key.

Validations

  • Customer must exist and not be excluded from the loyalty program
  • A custom action with the given action_key must exist and be active
  • For a once-per-customer rule, the customer must not have already been awarded this action

Response

Returns 201 Created on success, or 200 OK for an idempotent replay. The points and points_balance fields are minor currency units on store-credit shops, and the response carries loyalty_mode and currency. On store-credit shops it also includes credit_earned and credit_balance companions (major-unit decimal strings), which are absent in points mode. See Loyalty modes.
When the rule has an approval delay configured, status is pending, points_given_at is null, points_due_at reflects when the points will be approved, and points_balance excludes the pending points until then.
If the loyalty program is disabled, or test mode is filtering this customer, the request still succeeds with 200 OK but no points are awarded:

Errors

Example 409 response:

Trigger from Shopify Flow

If you would rather not write code, add the Award Custom Action action to any Shopify Flow workflow and set:
  • Action key — the same key from the rule’s setup page
  • Customer — map a customer from the workflow’s trigger
  • Idempotency key (optional) — leave blank to use the Flow run id automatically, so a retried run never awards twice
Shopify Flow signs and sends the request for you, so no API key is needed for this path.