Skip to main content
PUT
/
discounts
/
update
/
{discount_id}
Update Discount Code
curl --request PUT \
  --url https://api.swoogo.com/api/v1/discounts/update/{discount_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "SPRINGSALE2024",
  "type": "percentage",
  "percentage_discount": 15,
  "absolute_discount": 25.5,
  "apply_to_all": true,
  "capacity": 10,
  "min_group_size": 5,
  "registrants_per_use": 2,
  "all_registrants_in_group": true,
  "applicable_line_items": [
    "session",
    "package"
  ],
  "custom_fees_update": {
    "session": {
      "4147126": "315"
    }
  },
  "autopopulate_attributes": [
    {
      "attribute": "gender",
      "value": "<unknown>"
    }
  ],
  "notes": "Discount for early bird registrants.",
  "sold_out_message": "SPRINGSALE2024 has been used too many times."
}
'
{
  "id": 6095869,
  "parent_id": null,
  "event_id": 261977,
  "code": "SPRINGSALE2024",
  "type": "percentage",
  "capacity": 10,
  "min_group_size": 0,
  "registrants_per_use": 0,
  "sold_out_message": null,
  "percentage_discount": 15,
  "absolute_discount": 0,
  "applicable_line_items": [
    "session",
    "package"
  ],
  "apply_to_all": 1,
  "custom_fees": {
    "session": {
      "4147126": "315",
      "4147127": "337.5"
    }
  },
  "notes": "Discount for early bird registrants.",
  "created_at": "2026-04-28 21:00:15",
  "updated_at": "2026-04-28 21:00:15"
}

Authorizations

Authorization
string
header
required

OAuth 2.0 bearer token obtained from POST /oauth2/token. Tokens expire after 30 minutes. Include in the Authorization header as Bearer {access_token}.

Path Parameters

discount_id
integer
required

integer - required - The ID of the Discount Code you want to update

Example:

1

Body

All fields are optional on update. event_id cannot be changed — discounts are bound to their original event. To create alternate codes for an existing discount, use the clone endpoint.

code
string

Unique code for the discount within the event. May not contain <, >, \, or ".

Maximum string length: 255
Example:

"SPRINGSALE2024"

type
enum<string>

The type of discount being applied.

Available options:
percentage,
absolute,
specific
Example:

"percentage"

percentage_discount
number<float>
Required range: 0 <= x <= 100
Example:

15

absolute_discount
number<float>
Example:

25.5

apply_to_all
boolean
Example:

true

capacity
integer
Example:

10

min_group_size
integer
Required range: x >= 2
Example:

5

registrants_per_use
integer
Required range: x >= 2
Example:

2

all_registrants_in_group
boolean
Example:

true

applicable_line_items
string[]
Example:
["session", "package"]
custom_fees_update
object

New entries to merge into the stored custom_fees. See discountCreateRequest for shape.

Example:
{ "session": { "4147126": "315" } }
autopopulate_attributes
object[]
notes
string
Example:

"Discount for early bird registrants."

sold_out_message
string
Maximum string length: 255
Example:

"SPRINGSALE2024 has been used too many times."

Response

Updated

The discount payload returned by every read endpoint. Reflects Discount::fields() exactly — every property is always present in the response (values may be null).

id
integer
Example:

6095869

parent_id
integer | null

ID of the primary discount when this row is an alternate code; null (or 0) for primary codes.

Example:

null

event_id
integer
Example:

261977

code
string
Example:

"SPRINGSALE2024"

type
enum<string>
Available options:
percentage,
absolute,
specific
Example:

"percentage"

capacity
integer

Maximum number of times this discount can be used. 0 means unlimited.

Example:

10

min_group_size
integer
Example:

0

registrants_per_use
integer
Example:

0

sold_out_message
string | null
Example:

null

percentage_discount
number<float>
Example:

15

absolute_discount
number<float>
Example:

0

applicable_line_items
string[] | null
Example:
["session", "package"]
apply_to_all
enum<integer>

Returned as 0 or 1 (not a JSON boolean), even though the request accepts a boolean.

Available options:
0,
1
Example:

1

custom_fees
object

Merged set of line-item-specific fees for specific discounts. Outer key is the line-item type (reg_type, package, session), inner key is the line-item ID (numeric string), value is the fee as a string. Populated by custom_fees_update on write.

Example:
{
"session": { "4147126": "315", "4147127": "337.5" }
}
notes
string | null
Example:

"Discount for early bird registrants."

created_at
string

Timestamp when the discount was created. Formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2026-04-28 21:00:15"

updated_at
string

Timestamp when the discount was last updated. Formatted as YYYY-MM-DD HH:MM:SS.

Example:

"2026-04-28 21:00:15"