POST /v1/rule-completions
Requires a signed-in shopper. The award amount comes from the shop’s active earning rule. Purchase points, email subscription points, birthday rewards and welcome gifts are awarded separately; a new customer receives the welcome gift automatically when they first sign in.
Request
POST /apps/nasp-rewards/v1/rule-completions
Content-Type: application/json
{
"customer_id": "729001",
"activity": "visit_instagram"
}
| Required field | Meaning |
|---|---|
customer_id |
The signed-in shopper’s Shopify ID, as a string. |
activity |
The activity from Configuration. Allowed values are visit_facebook, visit_instagram, visit_tiktok, visit_x, visit_youtube, visit_linkedin and visit_website. |
A visit claim records the shopper’s action in your theme. It does not verify a follow or a video view.
Response
A shopper with 525 points opens the shop’s Instagram link, worth 30 points. The API returns 200 OK.
{
"activity": "visit_instagram",
"awarded": true,
"points": "30",
"points_balance": "555"
}
awarded is true when this request adds points. A repeat claim for the same active rule returns 200 with awarded: false and the original award amount in points. Both responses include the current balance. The theme can update the page from this response alone.
Errors
| Response | Meaning and recovery |
|---|---|
400 invalid_request |
Check that both required fields are present and have valid values. |
404 earning_activity_claim_unavailable |
The activity is inactive or unsupported, or a new visit claim has no usable link. welcome_gift always returns this, because the welcome gift is awarded automatically. Reload Configuration. |
409 shopper_changed |
The shopper has changed accounts. Clear the previous shopper’s details and reload. |
| Lost response | Repeat the same activity for the same shopper. A completed claim cannot award additional points. If the rule has since been disabled, a 404 does not indicate whether the first claim succeeded. |
See Requests and errors for sign-in, plan and rate limit responses.
Request handling
Send the documented JSON fields. Extra fields are ignored; required values and business rules are still validated. Handle other failures using the generic fallback described in Requests and errors. An unclear redemption result must retain the original idempotency key for recovery.