create_codes
Add 1 to 1,000 codes you ALREADY have — from a POS, a CRM or a printed batch — to a sweepstakes, with attributes shared by all of them. To have Sweeppea invent the codes for you, use generate_codes instead. Codes are up to 20 letters, digits, - or _; whitespace is stripped; they are matched exactly and case-sensitively. The response reports Duplicates and Invalid separately from Created — always tell the user those counts rather than claiming every code landed. 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 |
|---|---|---|---|
| codes | Yes | 1 to 1,000 codes — up to 20 letters, digits, - or _ each | |
| value | No | Applied to every code, max 10 characters (e.g. $10, 15%) | |
| description | No | Applied to every code in this batch, max 5,000 characters | |
| external_url | No | https:// link applied to every code, max 500 characters | |
| expiration_date | No | YYYY-MM-DD, not in the past | |
| expiration_time | No | HH:mm, 24-hour clock | |
| sweepstakes_token | Yes | The sweepstakes token (UUID v4) of a sweepstakes of your account |