Update Coupon

Update a given coupon or group of coupons.

There are 2 main ways to select which coupon(s) you want to update:

  • Updating a single coupon code? Specify coupon_code.
  • Updating a group of coupons? Specify their unique group name.

You can then apply any changes you wish, for example:

  • Rename the coupon name (note: if you have already distributed the coupon code to your customers, it’s best not to rename it anymore)
  • Extend the expiry date to keep a successful promotion going
  • Update the discount amount because you changed your mind
  • Make a new product eligible with the coupons

Accepted Fields

https://vendors.paddle.com/api/2.1/product/update_coupon

  • vendor_id (int) - Vendor ID (required)
  • vendor_auth_code (string) - Vendor API Auth Code (required) - Docs: https://paddle.com/docs/api-authentication.
  • coupon_code (string) - Identifies the coupon to update (You must specify either coupon_code or group, but not both)
  • group (string) - The name of the group of coupons you want to update. (You must specify either coupon_code or group, but not both)
  • new_coupon_code (string) - The new code to rename the coupon to, can’t be used in conjunction with group. (optional)
  • new_group (string) - New group name to move coupon(s) to a new group. (optional)
  • product_ids (string) - Comma separated list of products e.g. 499531,1234,123546. If blank then remove associated products. (optional)
  • expires (string) - The date the coupon is valid until, in the format YYYY-MM-DD. Coupon will expire at the start of this date (eg. YYYY-MM-DD 00:00:00). If blank then expiry is removed. (optional)
  • allowed_uses (int) - Number of times each coupon can be used. (optional - default: unlimited)
  • currency (string) - Currency of the discount_amount. (required - if discount_type is flat or updating discount_amount.)
  • minimum_threshold - The minimum threshold (total in cart) that needs to be exceeded for the coupon to work. If blank or 0 then threshold is removed. (optional - unless changing currency when a minimum threshold is already set.)
  • discount_amount (decimal) - A currency amount (eg. 10.00) if discount_type is flat, or a percentage amount (eg. 10 for 10%) if discount_type is percentage. (required)

Example Request


curl -X POST \
	 -d 'vendor_id=123' \
	 -d 'vendor_auth_code=123:456abc...' \
	 -d 'group=Christmas' \
	 -d 'new_coupon_code=Christmas2017' \		 
	 -d 'new_group=Christmas2017' \
	 -d 'product_ids=499531,2134234' \	
	 -d 'allowed_uses=5' \
	 -d 'currency=usd' \
	 -d 'discount_amount=20' \
	 -d 'minimum_threshold=10' \
     https://vendors.paddle.com/api/2.1/product/update_coupon

Example Response

{
   "success": true,
   "updated": 123
}