Vouchers

Manage ticket vouchers.

Voucher

A voucher can be used on a ticket to receive additional discount.

code
string [ 4 .. 8 ] characters [A-Z0-9]

Voucher code.

created_at
string <date-time>

Date and time of creation.

customer_id
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

enabled
boolean

The voucher can only be used if enabled.

label
string [ 0 .. 255 ] characters

Voucher label.

product_id
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

updated_at
string or null <date-time>

Date and time of last update.

used_at
string or null <date-time>

Date and time on which the voucher was used on a ticket or null if not used.

valid_until
string <date>

Voucher can be used on a ticket up to and including this date.

{
  • "code": "WQ4MM3",
  • "created_at": "2019-08-24T14:15:22Z",
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "used_at": "2019-08-24T14:15:22Z",
  • "valid_until": "2019-08-24"
}

Retrieve vouchers

Retrieve a list of vouchers.

SecurityOAuth2
Request
query Parameters
customer_id
string <uuid>

Filter vouchers by customer identifier.

limit
integer <int32> [ 0 .. 1000 ]
Default: 25

Limits the amount of resources in result.

offset
integer <int64> >= 0
Default: 0

Offset of resources in result.

used
boolean

Only return vouchers that are or are not used in a ticket.

valid
boolean

Only return vouchers that are or are no longer valid.

Responses
200

Successful response.

Response Schema: application/json
object >= 0 properties

Applied query parameters, including defaults.

limit
integer <int32> [ 0 .. 1000 ]
Default: 25

The applied value of the limit query parameter on the resources in result.

offset
integer <int64> >= 0
Default: 0

The applied value of the offset query parameter on the resources in result.

property name*
additional property
any
Array of objects (Voucher) >= 0 items

List of vouchers.

Array (>= 0 items)
code
string [ 4 .. 8 ] characters [A-Z0-9]

Voucher code.

created_at
string <date-time>

Date and time of creation.

customer_id
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

object

The discount received when voucher is used on ticket.

enabled
boolean

The voucher can only be used if enabled.

label
string [ 0 .. 255 ] characters

Voucher label.

product_id
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

updated_at
string or null <date-time>

Date and time of last update.

used_at
string or null <date-time>

Date and time on which the voucher was used on a ticket or null if not used.

valid_until
string <date>

Voucher can be used on a ticket up to and including this date.

total
integer <int64>

Total number of resources matching provided query parameters.

default

An error occurred - see status code and problem response for more information.

get/v2/tickets/vouchers
Response samples
application/json
{
  • "query": {
    },
  • "result": [
    ],
  • "total": 3255
}

Add a voucher.

Add a new voucher.

SecurityOAuth2
Request
Request Body schema: application/json

The voucher you wish to add.

customer_id
required
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

required
object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

label
required
string [ 0 .. 255 ] characters

Voucher label.

product_id
required
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

valid_until
required
string <date>

Voucher can be used on a ticket up to and including this date.

Responses
201

Created.

Response Schema: application/json
code
string [ 4 .. 8 ] characters [A-Z0-9]

Voucher code.

created_at
string <date-time>

Date and time of creation.

customer_id
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

enabled
boolean

The voucher can only be used if enabled.

label
string [ 0 .. 255 ] characters

Voucher label.

product_id
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

updated_at
string or null <date-time>

Date and time of last update.

used_at
string or null <date-time>

Date and time on which the voucher was used on a ticket or null if not used.

valid_until
string <date>

Voucher can be used on a ticket up to and including this date.

default

An error occurred - see status code and problem response for more information.

post/v2/tickets/vouchers
Request samples
application/json
{
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "valid_until": "2019-08-24"
}
Response samples
application/json
{
  • "code": "WQ4MM3",
  • "created_at": "2019-08-24T14:15:22Z",
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "used_at": "2019-08-24T14:15:22Z",
  • "valid_until": "2019-08-24"
}

Retrieve a voucher

Retrieves a voucher by its identifier.

SecurityOAuth2
Request
path Parameters
voucher-code
required
string

The unique code of the voucher.

Responses
200

Successful response.

Response Schema: application/json
code
string [ 4 .. 8 ] characters [A-Z0-9]

Voucher code.

created_at
string <date-time>

Date and time of creation.

customer_id
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

enabled
boolean

The voucher can only be used if enabled.

label
string [ 0 .. 255 ] characters

Voucher label.

product_id
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

updated_at
string or null <date-time>

Date and time of last update.

used_at
string or null <date-time>

Date and time on which the voucher was used on a ticket or null if not used.

valid_until
string <date>

Voucher can be used on a ticket up to and including this date.

default

An error occurred - see status code and problem response for more information.

get/v2/tickets/vouchers/{voucher-code}
Response samples
application/json
{
  • "code": "WQ4MM3",
  • "created_at": "2019-08-24T14:15:22Z",
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "used_at": "2019-08-24T14:15:22Z",
  • "valid_until": "2019-08-24"
}

Update a voucher

Update a voucher by its identifier.

SecurityOAuth2
Request
path Parameters
voucher-code
required
string

The unique code of the voucher.

Request Body schema: application/json
required

The updated voucher.

customer_id
required
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

required
object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

enabled
required
boolean

The voucher can only be used if enabled.

label
required
string [ 0 .. 255 ] characters

Voucher label.

product_id
required
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

valid_until
required
string <date>

Voucher can be used on a ticket up to and including this date.

Responses
200

Successful response.

Response Schema: application/json
code
string [ 4 .. 8 ] characters [A-Z0-9]

Voucher code.

created_at
string <date-time>

Date and time of creation.

customer_id
string or null <uuid>

If set, the voucher can only be used on a ticket for this customer.

object

The discount received when voucher is used on ticket.

type
required
string
Enum Value Description
percentage

The discount value is a percentage of the price.

money

The discount value is an amount of money that will be subtracted from the price.

value
required
number <float> >= 0

The discounted value of this voucher. The upper limit for discount type percentage is 100.

enabled
boolean

The voucher can only be used if enabled.

label
string [ 0 .. 255 ] characters

Voucher label.

product_id
string or null <uuid>

If set, the voucher can only be used on a ticket that has this product.

updated_at
string or null <date-time>

Date and time of last update.

used_at
string or null <date-time>

Date and time on which the voucher was used on a ticket or null if not used.

valid_until
string <date>

Voucher can be used on a ticket up to and including this date.

403

Forbidden.

default

An error occurred - see status code and problem response for more information.

put/v2/tickets/vouchers/{voucher-code}
Request samples
application/json
{
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "valid_until": "2019-08-24"
}
Response samples
application/json
{
  • "code": "WQ4MM3",
  • "created_at": "2019-08-24T14:15:22Z",
  • "customer_id": "160c0c4b-9966-4dc1-a916-8407eb10d74e",
  • "discount": {
    },
  • "enabled": true,
  • "label": "Winter discount voucher",
  • "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "used_at": "2019-08-24T14:15:22Z",
  • "valid_until": "2019-08-24"
}

Remove a voucher

Remove a voucher by its identifier.

SecurityOAuth2
Request
path Parameters
voucher-code
required
string

The unique code of the voucher.

Responses
204

Successfully removed.

403

Forbidden.

default

An error occurred - see status code and problem response for more information.

delete/v2/tickets/vouchers/{voucher-code}
Response samples
application/problem+json
{
  • "status": 403,
  • "type": "about:blank",
  • "title": "Forbidden",
  • "detail": "You are not authorized to access this resource."
}