Skip to main content
PATCH/point-exchange-rule/:id/

Update point exchange rule

You can update a specific point exchange rule.

Attributes

Optional unless marked required

namestringrequired
A point exchange rule name.
amountintegerrequired
An amount
end_datestring
A DateTime when point campaign ends
max_daily_use_countinteger
A daily maximum number of an exchange rule usage.
max_trigger_count_intervalinteger
A maximum number of interval days in between triggering this rule for a user.
max_trigger_count_valueinteger
A maximum number of times that rule triggers for this specific user
perkobjectrequired
An object with additional user benefits, e.g. coupon or a discount.
point_campaignintegerrequired
A unique identifier for the point campaign which is given by User
user_attributestring
A standardized name for the user attribute (e.g. "My attribute" is standardized to "my_attribute"). An attribute has to be an integer type.
level_thresholdinteger
A unique identifier for the customer level which is given by User

Request​

curl -X PATCH "https://<your_app_subdomain>.user.com/api/public/point-exchange-rule/:id/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "10 EUR voucher",
"point_campaign": 13,
"amount": 40,
"perk": {
"name": "10 EUR voucher"
}
}'

Response examples​

{
"id": 6,
"name": "10 EUR voucher",
"amount": 40,
"end_date": null,
"max_daily_use_count": null,
"max_trigger_count_interval": null,
"max_trigger_count_value": null,
"product_event": null,
"point_campaign": 12,
"user_attribute": null,
"event": null,
"level_thresholds": [],
"reward": {
"type": "10 EUR voucher"
}
}

Response fields​

Fields returned in the 200 OK response body.

idinteger
ID of the point exchange rule.
namestring
A point exchange rule name.
amountinteger
An amount
end_datestringnullable
A DateTime when point campaign ends
max_daily_use_countintegernullable
A daily maximum number of an exchange rule usage.
max_trigger_count_intervalintegernullable
A maximum number of interval days in between triggering this rule for a user.
max_trigger_count_valueintegernullable
A maximum number of times that rule triggers for this specific user
product_eventintegernullable
Product event type that spends the points automatically when the contact triggers it, for example 2 (purchase); null if none.
point_campaigninteger
A unique identifier for the point campaign which is given by User
user_attributestringnullable
A standardized name for the user attribute (e.g. "My attribute" is standardized to "my_attribute"). An attribute has to be an integer type.
eventintegernullable
ID of the event that spends the points automatically when the contact triggers it; null if none.
level_thresholdsarray of integer
IDs of the customer levels a contact needs to use this rule; empty for everyone.
rewardobject
What the contact gets for the points.
reward.typestring
Reward type: 0 amount discount, 1 percentage off, 2 free shipping, 3 free product, 4 coupon code, 5 create event or 6 API.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.