Discount

To allow certain users to get stuff cheaper. You must have the financials ConventionPrivilege to access this. Discounts are accessed via /api/discount.

Properties

See "Object Properties" in Introduction for basic shared properties.

Complete details in DiscountProperties. It also has these extra read-only properties:

code

Normally this is a private and editable field. However, if the discount's public field is set to 1 then code is displayed as a read-only field available to everybody.

Related Objects

See "Related Objects" in Introduction for how to use them.

convention

The Convention this discount belongs to.

Relationships

See "Relationships" in Introduction for how to use them.

badgetypediscounts

Manages the relationship between BadgeTypes and discounts.

badges

The list of Badges that are using this discount.

badgetypes

The list of BadgeTypes allowed to use this discount.

boothaddons

The list of BoothAddOns using this discount.

booths

The list of Booths using this discount.

boothtypediscounts

Manages the relationship between BoothType and discount.

boothtypes

The list of BoothTypes that are allowed to use this discount.

tickets

The list of Tickets using this discount.

Services

The services used to fetch and manipulate discounts.

Search Discounts

Searching all discounts across conventions is no longer supported. To search on a single convention see "Relationships" in Convention.

Create Discount

 POST /api/discount
Required Params
convention_id
name

Returns the same as a normal read.

Read Discount

 GET /api/discount/xxx

Returns:

 {
   "id" : "xxx",
   "name" : "Veterans",
   ...
 }

Update Discount

 PUT /api/discount/xxx

Returns the same as a normal read.

Delete Discount

 DELETE /api/discount/xxx

Returns:

 {
   "success" : 1
 }

Check Discount Can Be Used for Specific Sales Item

 GET /api/discount/xxx/can-apply
Required Params
salesitem_type

Can be BadgeType (for Badges), BoothOption (for BoothAddons), BoothType (for Booths), EventType (for Tickets), Product (for SoldProducts), or Sponsorship (for Sponsors).

salesitem_id

The ID for an item of the above salesitem_type.

Returns:

 {
   "can_apply" : 1 or 0
 }

Add Sales Item Type to Discount apply_to Field

 PUT /api/discount/xxx/add-apply-to

The apply_to field contains JSON; to update it directly you must pass it a JSON-formatted string that contains all the sales item types to which you want the discount to apply. However, you can also use this handy endpoint to edit the field one sales-item type at a time.

Required Params
salesitem_type

Can be BadgeType (for Badges), BoothOption (for BoothAddons), BoothType (for Booths), EventType (for Tickets), Product (for SoldProducts), or Sponsorship (for Sponsors). Note the salesitem type strings are stored in lowercase.

Returns the same as a normal read.

Remove Sales Item Type from Discount apply_to Field

 PUT /api/discount/xxx/remove-apply-to

The apply_to field contains JSON; to update it directly you must pass it a JSON-formatted string that contains all the sales item types to which you want the discount to apply. However, you can also use this handy endpoint to edit the field one sales-item type at a time.

Required Params
salesitem_type

Can be BadgeType (for Badges), BoothOption (for BoothAddons), BoothType (for Booths), EventType (for Tickets), Product (for SoldProducts), or Sponsorship (for Sponsors). The salesitem type strings are stored in lowercase, but the check for removal does not require you pass the type in lowercase.

Returns the same as a normal read.