update_code_settings
Change how a sweepstakes hands out codes. Partial update — only the fields you send change. Read get_code_settings first. The registration modes are integers: 0 none, 1 assign an existing code, 2 generate a new code, 3 ask the participant for their code. Modes reject_invalid_coupon_code, coupon_code_case_sensitive, invalid_coupon_code_error_message and coupon_request_field_label only matter in mode 3. NOTE: coupon_code_type is an INTEGER here (1 numeric, 2 alphanumeric) while generate_codes uses the STRING type ("alphanumeric" / "numeric") — do not copy a value between the two. The three text fields accept null, which CLEARS them. 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 |
|---|---|---|---|
| coupon_code_type | No | Generated codes: 1 numeric, 2 alphanumeric. An INTEGER — generate_codes uses a string for the same idea | |
| sweepstakes_token | Yes | The sweepstakes token (UUID v4) of a sweepstakes of your account | |
| coupon_code_length | No | Generated code length, 4 to 20 | |
| coupon_code_case_sensitive | No | Mode 3 only: compare codes case-sensitively | |
| coupon_request_field_label | No | Mode 3 only: label of the code field. Plain text, max 200. Empty uses the default label. null CLEARS it | |
| reject_invalid_coupon_code | No | Mode 3 only: refuse the registration when the code is invalid | |
| coupon_amoe_page_registration | No | AMOE page: same values as coupon_entry_page_registration | |
| coupon_thank_you_page_message | No | Message on the thank-you page. Plain text, max 1,000. null CLEARS it | |
| coupon_entry_page_registration | No | Entry page: 0 none, 1 assign an existing code, 2 generate a new code, 3 ask the participant for their code | |
| invalid_coupon_code_error_message | No | Mode 3 only: message shown for an invalid code. Plain text, max 500. null CLEARS it | |
| send_coupon_code_to_participant_by_sms | No | Text the code to the participant | |
| display_coupon_code_on_confirmation_page | No | Show the code on the confirmation page | |
| send_coupon_code_to_participant_by_email | No | Email the code to the participant | |
| what_to_do_when_no_coupon_code_is_available | No | 0 nothing, 1 generate a new code |