latestOpenAPI 3.1.12026-08-108026304.2 KB

7b222e8ec91c

Discount codes

Create a discount code

Creates a discount code that can be used on checkout.

post/v1/discounts

Response

Successfully created a new discount

objectstring
idstring

A unique identifier for the discount

booking_feeinteger nullable

Booking fee amount in cents. Could be null.

booking_fee_percentinteger nullable

Percent of the booking fee. Could be null.

codestring

Discount code

max_redemptionsinteger nullable

The maximum number of times this discount can be used.

namestring

A descriptive name given to the discount

priceinteger nullable

Price in cents. Could be null.

price_percentinteger nullable

Percent of the price. Could be null.

ticket_typesstring[]

An array of associated ticket types.

productsstring[]

An array of associated products.

times_redeemedinteger nullable

The number of times that the discount was used

type'fixed_amount' | 'percentage'

Type of discount. Either a fixed amount or a percentage

Example response

{
  "object": "discount",
  "id": "di_123",
  "code": "discount_test123",
  "expires": {
    "date": "2020-05-01",
    "formatted": "Fri 1 May 2020 10:30 PM",
    "iso": "2020-05-01T22:30:00+01:00",
    "time": "22:30",
    "timezone": "+01:00",
    "unix": 1588368600
  },
  "max_redemptions": 5,
  "name": "Test discount",
  "price": 540,
  "ticket_types": [
    "tt_78",
    "tt_123",
    "tt_456"
  ],
  "products": [
    "pr_78",
    "pr_123",
    "pr_456"
  ],
  "times_redeemed": 3,
  "type": "fixed_amount"
}