Vincent is here! Just say the word, and Vincent will build the campaigns for you! Get early access.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/validation-rules/{validationRuleId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"related_object_type": "voucher",
"related_object_id": "{{voucherId}}"
}
'{
"id": "asgm_kPPiNW3smQLRMWiF",
"rule_id": "val_ZEZmA9oit8aU",
"related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo",
"related_object_type": "campaign",
"created_at": "2022-09-14T07:06:49.557Z",
"object": "validation_rules_assignment"
}Assign validation rule to either one of the following objects: voucher, campaign, promotion tier, earning rule, reward, distribution.
curl --request POST \
--url https://{cluster}.voucherify.io/v1/validation-rules/{validationRuleId}/assignments \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"related_object_type": "voucher",
"related_object_id": "{{voucherId}}"
}
'{
"id": "asgm_kPPiNW3smQLRMWiF",
"rule_id": "val_ZEZmA9oit8aU",
"related_object_id": "camp_Rv9EuIrkT08YEORb2pUMGSUo",
"related_object_type": "campaign",
"created_at": "2022-09-14T07:06:49.557Z",
"object": "validation_rules_assignment"
}Documentation Index
Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
Use this file to discover all available pages before exploring further.
Unique validation rule ID.
"val_TU4de3EP4dlL"
If this flag is set to true, the previous assignment with the same data will be deleted and a new one will be added.
Specify the resource that you would like to assign the validation rule to.
Request body schema for POST v1/validation-rules/{validationRuleId}/assignments.
Defines the related object, e.g. voucher.
voucher, promotion_tier, campaign, earning_rule, distribution, reward_assignment Unique related object ID assigned by Voucherify, e.g. v_lfZi4rcEGe0sN9gmnj40bzwK2FH6QUno for a voucher.
Returns a validation rules assignment object.
Response body for POST v1/validation-rules/{validationRuleId}/assignments.
Validation rule assignment ID.
"asgm_74F7QZoYbUoljwQO"
Validation rule ID.
"val_4j7DCRm2IS59"
The resource ID to which the validation rule was assigned.
"v_JtWunK6jUo7X2qOFj0SyRHq4p9tgENlT"
The type of resource to which the validation rule was assigned.
voucher, campaign, earning_rule, reward_assignment, promotion_tier, distribution Timestamp representing the date and time when the validation rule assignment was created. The value is shown in the ISO 8601 format.
"2022-02-17T08:18:15.085Z"
The type of the object represented by the ID.
validation_rules_assignment Was this page helpful?