update_code
Change the attributes of ONE code. Only the fields you send change. IMPORTANT: description, value, external_url, expiration_date and expiration_time accept null, and null CLEARS the field — omitting a field leaves it untouched, sending null empties it. Do not send null unless the user asked to clear that field. The code itself (coupon_code) can only be renamed while it is unassigned and not redeemed. Requires the Codes & Coupons module enabled on the account — on 403 "module not enabled", do NOT retry; tell the user to contact Sweeppea support.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | No | Max 10 characters. null CLEARS it; omit to leave unchanged | |
| coupon_code | No | New code — up to 20 letters, digits, - or _. Only while unassigned and not redeemed; must be unique in the sweepstakes | |
| description | No | Max 5,000 characters. null CLEARS it; omit to leave unchanged | |
| coupon_token | Yes | The code token (CouponToken, UUID v4) | |
| external_url | No | https:// link, max 500 characters. null CLEARS it; omit to leave unchanged | |
| expiration_date | No | YYYY-MM-DD, not in the past. null CLEARS it; omit to leave unchanged | |
| expiration_time | No | HH:mm, 24-hour clock. null CLEARS it; omit to leave unchanged |