curl --request PUT \
--url https://{cluster}.voucherify.io/v1/vouchers/{code} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"category": "Second",
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "PERCENT",
"percent_off": 45,
"percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)",
"amount_limit": 1800,
"effect": "APPLY_TO_ORDER"
},
"start_date": "2020-02-01T00:00:00Z",
"expiration_date": "2023-12-31T23:59:59Z",
"validity_timeframe": {
"duration": "PT2H",
"interval": "P3D"
},
"validity_day_of_week": [
0,
1,
2
],
"active": false,
"additional_info": "This voucher can be used with other coupons. Please feel free to do so.",
"metadata": {
"Season": "Winter"
}
}
'{
"id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m",
"code": "percent1",
"campaign": null,
"campaign_id": null,
"category": "Second",
"category_id": "cat_0bb81a481615a37b5e",
"categories": [
{
"id": "cat_0bb81a481615a37b5e",
"name": "Second",
"hierarchy": 2,
"created_at": "2022-09-20T05:58:01.561Z",
"object": "category"
}
],
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "PERCENT",
"amount_limit": 1800,
"percent_off": 45,
"percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)",
"effect": "APPLY_TO_ORDER"
},
"gift": null,
"loyalty_card": null,
"start_date": "2020-02-01T00:00:00.000Z",
"expiration_date": "2023-12-31T23:59:59.000Z",
"validity_timeframe": {
"interval": "P3D",
"duration": "PT2H"
},
"validity_day_of_week": [
0,
1,
2
],
"active": false,
"additional_info": "This voucher can be used with other coupons. Please feel free to do so.",
"metadata": {
"Season": "Winter"
},
"assets": {
"qr": {
"id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-09-19T14:41:30.976Z",
"updated_at": "2022-09-20T06:00:50.202Z",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"redemption": {
"quantity": 101,
"redeemed_quantity": 0,
"object": "list",
"url": "/v1/vouchers/percent1/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 0,
"url": "/v1/vouchers/percent1/publications?page=1&limit=10"
},
"object": "voucher"
}Update Voucher
Updates the specified voucher by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
Fields other than the ones listed in the request body won’t be modified. Even if provided, they will be silently skipped.
If you want to change the amount on a gift card or the number of points on a loyalty card (legacy loyalty), use the Adjust voucher balance endpoint.
curl --request PUT \
--url https://{cluster}.voucherify.io/v1/vouchers/{code} \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"category": "Second",
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "PERCENT",
"percent_off": 45,
"percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)",
"amount_limit": 1800,
"effect": "APPLY_TO_ORDER"
},
"start_date": "2020-02-01T00:00:00Z",
"expiration_date": "2023-12-31T23:59:59Z",
"validity_timeframe": {
"duration": "PT2H",
"interval": "P3D"
},
"validity_day_of_week": [
0,
1,
2
],
"active": false,
"additional_info": "This voucher can be used with other coupons. Please feel free to do so.",
"metadata": {
"Season": "Winter"
}
}
'{
"id": "v_9PbXndxO3S8xfztwMtIvuMXReonF248m",
"code": "percent1",
"campaign": null,
"campaign_id": null,
"category": "Second",
"category_id": "cat_0bb81a481615a37b5e",
"categories": [
{
"id": "cat_0bb81a481615a37b5e",
"name": "Second",
"hierarchy": 2,
"created_at": "2022-09-20T05:58:01.561Z",
"object": "category"
}
],
"type": "DISCOUNT_VOUCHER",
"discount": {
"type": "PERCENT",
"amount_limit": 1800,
"percent_off": 45,
"percent_off_formula": "IF(ORDER_AMOUNT > 100;CUSTOMER_METADATA(\"age\");CUSTOMER_METADATA(\"age\") / 2)",
"effect": "APPLY_TO_ORDER"
},
"gift": null,
"loyalty_card": null,
"start_date": "2020-02-01T00:00:00.000Z",
"expiration_date": "2023-12-31T23:59:59.000Z",
"validity_timeframe": {
"interval": "P3D",
"duration": "PT2H"
},
"validity_day_of_week": [
0,
1,
2
],
"active": false,
"additional_info": "This voucher can be used with other coupons. Please feel free to do so.",
"metadata": {
"Season": "Winter"
},
"assets": {
"qr": {
"id": "U2FsdGVkX19MPtNCPjoG/pKloolK+BZH/OCIpjYqj+B6IVJJmTYKeBINcB0JioL/tSw3iuK4FvgF8VyDyTfL26IpzbT81DDOnKeFIDUJraQDJiKxWcrG/RCFsVky4olBJ+GZFb9pLpN5gC/rn0pqYw==",
"url": "{{internalVoucherifyURL}}"
},
"barcode": {
"id": "U2FsdGVkX1/J73XXWgMf2BsVM21kpnFLQak5dpGzThYNTYPT62U6q+5RDlh/CXylkTrhegRnWJw1HA7iehT8iUoV4M4cV0KBdp5WgJ3lXeFZcpX3Mpu0T02PRcYbdCIiSO1kO50Y8Hg/heHcshw22Q==",
"url": "{{internalVoucherifyURL}}"
}
},
"is_referral_code": false,
"created_at": "2022-09-19T14:41:30.976Z",
"updated_at": "2022-09-20T06:00:50.202Z",
"validation_rules_assignments": {
"object": "list",
"data_ref": "data",
"data": [],
"total": 0
},
"redemption": {
"quantity": 101,
"redeemed_quantity": 0,
"object": "list",
"url": "/v1/vouchers/percent1/redemptions?page=1&limit=10"
},
"publish": {
"object": "list",
"count": 0,
"url": "/v1/vouchers/percent1/publications?page=1&limit=10"
},
"object": "voucher"
}Authorizations
Scopes
Body
Specify the parameters to be updated.
- Update loyalty card
- Update gift card
- Update voucher in a discount campaign
Request body schema for PUT v1/vouchers/{code}.
The name of the category that this voucher belongs to. Useful when listing vouchers with the List Vouchers endpoint.
Unique identifier assigned by Voucherify to the name of the category that this voucher belongs to. Useful when listing vouchers with the List Vouchers endpoint.
"cat_0bb81a481615a37b5e"
Response
Returns the voucher object if the update succeeded.
Response body schema for PUT v1/vouchers/{code}.

