Payments & Vouchers

Discount Types

Discount types

The DiscountType object

Attributes

  • iduuidrequired

    The ID of the discount type.

  • applicable_forstringrequired

    Where the discount type is able to be applied.

    Possible values:app_onlyapp_and_booking_engine
  • codestringrequired

    The code for the discount type. When the type is a promo code, this will be what the customer enters in on the booking engine to receive their discount, e.g. SUMMER23. Or, if the discount type is for app use, this is what is used for reporting.

  • descriptionstringrequirednullable

    This provides further details on what the discount type can be used for. It's up to the user to provide this.

  • amount_typestringrequired

    The type of discount. For a promo code, this will always be a percentage.

    Possible values:monetarypercentage
  • discount_amountintegerrequirednullable

    The value of the discount to be applied when a discount type is used. This can be used as a monetary amount or percentage for an in-app discount type and is set to percentage for a promo code.

  • currencystringrequired

    The currency of the monetary discount to be applied if amount_type is set to monetary for an in-app discount type. This is associated with the site.

  • is_custom_amountbooleanrequired

    Whether the amount provided is customisable. This can only be toggled for in-app discount types.

  • valid_fromdaterequirednullable

    The start date which the promo code is valid from, based on the date the order is submitted. This field is null if applicable_for is set to app_only. For a promo code to be valid for use on an order, this must be set.

  • valid_todaterequirednullable

    The end date which the promo code is valid until, based on the date the order is submitted. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_fromdaterequirednullable

    The start date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_todaterequirednullable

    The end date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_weekdaysstring[]required

    The days the purchased item takes place on. For example, the promo code could be valid for massages which only occur on Mondays. By default, this array contains all enum values and the occurrence of the purchased items is not restricted to any days.

  • item_time_fromstringrequirednullable

    The start time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_time_tostringrequirednullable

    The end time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • valid_offeringsobject[]required

    An array of offerings which the promo code is valid for. By default, this array is empty and the discount will not be applied to any items in the order. If this array includes offerings, the discount will be applied to only those selected items in the order.

  • max_usesintegerrequirednullable

    The maximum number of times the code can be used in total. By default, this value is null which means that this number is unlimited.

  • has_been_redeemedbooleanrequired

    Whether the promo code has been used by at least one customer. If this value is true, the code field is no longer editable.

  • site_iduuidrequired

    The ID of the site the discount type is associated with.

  • created_atdate-timerequired

    The date and time the discount type was created.

  • updated_atdate-timerequired

    The date and time the discount type was updated.

  • deleted_atdate-timerequired

    The date and time the discount type was deleted.

{
  "id": "00000000-0000-0000-0000-000000000000",
  "applicable_for": "app_and_booking_engine",
  "code": "SUMMER23",
  "description": "For 15% off any order placed from Jun-Aug 2023",
  "amount_type": "percentage",
  "discount_amount": 15,
  "currency": "gbp",
  "is_custom_amount": false,
  "valid_from": "2023-06-01",
  "valid_to": "2023-09-01",
  "item_date_from": "2023-09-01",
  "item_date_to": "2023-09-30",
  "item_date_weekdays": [
    "monday"
  ],
  "item_time_from": "10:00",
  "item_time_to": "14:00",
  "valid_offerings": [
    "string"
  ],
  "max_uses": 100000,
  "has_been_redeemed": false,
  "site_id": "00000000-0000-0000-0000-000000000000",
  "created_at": "2023-01-01T00:00:00Z",
  "updated_at": "2023-01-01T00:00:00Z",
  "deleted_at": "2023-01-01T00:00:00Z"
}
get/shop/discount-types

List DiscountTypes

listDiscountTypes

This endpoint lists all the DiscountTypes which are associated to the provided site.

Query parameters

  • site_iduuidrequired

    Filter the list of discount types by site.

  • archivedbooleanoptional

    Whether to include archived resources in the response. When true, archived resources are returned; when false or omitted, only non-archived resources are returned.

  • querystringoptional

    A search query to filter discount types by. This will search the discount type code.

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

  • applicable_forstringoptional

    Filter the list of discount types by where they are able to be applied.

    Possible values:app_onlyapp_and_booking_engine

Responses

  • 200

    The Discount Types were successfully retrieved

  • 401

    The user is unauthenticated

post/shop/discount-types

Create a DiscountType

createDiscountType

Use this endpoint to create a new DiscountType (or Promo Code). You can choose where a DiscountType can be applied, i.e. in the app only, on the booking engine only, or on both. When configured for in-app use only, the DiscountType has fewer customisable options and can only be applied to an order by the spa. When configured for use on the booking engine only, the DiscountType is a Promo Code which the customer enters for a discount on their order. When configured for use on both the app and the booking engine, the spa can enter a Promo Code on an order on the customer's behalf.

Request body

  • applicable_forstringrequired

    Where the discount type is able to be applied.

    Possible values:app_onlyapp_and_booking_engine
  • codestringrequired

    The code for the discount type. When the type is a promo code, this will be what the customer enters in on the booking engine to receive their discount, e.g. SUMMER23. Or, if the discount type is for app use, this is what is used for reporting.

  • descriptionstringoptionalnullable

    This provides further details on what the discount type can be used for. It's up to the user to provide this.

  • amount_typestringoptional

    The type of discount. For a promo code, this will always be a percentage.

    Possible values:monetarypercentage
  • discount_amountintegeroptionalnullable

    The value of the discount to be applied when a discount type is used. This can be used as a monetary amount or percentage for an in-app discount type and is set to percentage for a promo code.

  • is_custom_amountbooleanoptional

    Whether the amount provided is customisable. This can only be toggled for in-app discount types.

  • valid_fromdateoptionalnullable

    The start date which the promo code is valid from, based on the date the order is submitted. This field is null if applicable_for is set to app_only. For a promo code to be valid for use on an order, this must be set.

  • valid_todateoptionalnullable

    The end date which the promo code is valid until, based on the date the order is submitted. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_fromdateoptionalnullable

    The start date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_todateoptionalnullable

    The end date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_weekdaysstring[]optional

    The days the purchased item takes place on. For example, the promo code could be valid for massages which only occur on Mondays. By default, this array contains all enum values and the occurrence of the purchased items is not restricted to any days.

  • item_time_fromstringoptionalnullable

    The start time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_time_tostringoptionalnullable

    The end time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • valid_offeringsobject[]optional

    An array of offerings which the promo code is valid for. By default, this array is empty and the discount will not be applied to any items in the order. If this array includes offerings, the discount will be applied to only those selected items in the order.

  • max_usesintegeroptionalnullable

    The maximum number of times the code can be used in total. By default, this value is null which means that this number is unlimited.

  • site_iduuidrequired

    Identifier of the site this discount type belongs to. Discount types are scoped per site so each location can maintain its own promo codes, staff discounts, and loyalty offers. The caller's API key must have access to this site.

Responses

  • 201

    The Discount Type was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/shop/discount-types/order

Order DiscountTypes

listOrderedDiscountTypes

This endpoint returns an ordered list of all the DiscountTypes which are associated with the provided site.

Query parameters

  • site_iduuidrequired

    Filter the list of discount types by site.

Responses

  • 200

    The ordered Discount Types were successfully retrieved

  • 401

    The user is unauthenticated

put/shop/discount-types/order

Update the DiscountTypes order

updateDiscountTypeOrder

This endpoint updates the order of the DiscountTypes which are associated with the provided site.

Request body

  • discount_type_idsstring[]required
  • site_iduuidrequired

    Identifier of the site whose discount types are being reordered. All IDs in discount_type_ids must belong to this site; the caller's API key must have access to it.

Responses

  • 200

    The ordered Discount Types were successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 422

    The request didn't pass validation

get/shop/discount-types/{discountType}

Show a DiscountType

getDiscountType

Retrieves a DiscountType by ID.

Path parameters

Responses

  • 200

    The Discount Type was successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/shop/discount-types/{discountType}

Update a DiscountType

updateDiscountType

Updates a DiscountType by ID.

Path parameters

Request body

  • applicable_forstringoptional

    Where the discount type is able to be applied.

    Possible values:app_onlyapp_and_booking_engine
  • codestringoptional

    The code for the discount type. When the type is a promo code, this will be what the customer enters in on the booking engine to receive their discount, e.g. SUMMER23. Or, if the discount type is for app use, this is what is used for reporting. If has_been_redeemed is true, this field is removed from the request.

  • descriptionstringoptionalnullable

    This provides further details on what the discount type can be used for. It's up to the user to provide this.

  • amount_typestringoptional

    The type of discount. For a promo code, this will always be a percentage.

    Possible values:monetarypercentage
  • discount_amountintegeroptionalnullable

    The value of the discount to be applied when a discount type is used. This can be used as a monetary amount or percentage for an in-app discount type and is set to percentage for a promo code.

  • is_custom_amountbooleanoptional

    Whether the amount provided is customisable. This can only be toggled for in-app discount types.

  • valid_fromdateoptionalnullable

    The start date which the promo code is valid from, based on the date the order is submitted. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • valid_todateoptionalnullable

    The end date which the promo code is valid until, based on the date the order is submitted. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_fromdateoptionalnullable

    The start date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_todateoptionalnullable

    The end date for when the purchased item occurs, based on the date the item is booked for. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_date_weekdaysstring[]optional

    The days the purchased item takes place on. For example, the promo code could be valid for massages which only occur on Mondays. By default, this array contains all enum values and the occurrence of the purchased items is not restricted to any days.

  • item_time_fromstringoptionalnullable

    The start time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • item_time_tostringoptionalnullable

    The end time for when the purchased item takes place. For example, the promo code could be valid for off-peak massages taking place from 4-6pm. This field is null if applicable_for is set to app_only. This field is also null if it hasn't been set when applicable_for is set to app_and_booking_engine.

  • valid_offeringsobject[]optional

    An array of offerings which the promo code is valid for. By default, this array is empty and the discount will not be applied to any items in the order. If this array includes offerings, the discount will be applied to only those selected items in the order.

  • max_usesintegeroptionalnullable

    The maximum number of times the code can be used in total. By default, this value is null which means that this number is unlimited.

  • has_been_redeemedbooleanoptional

    Whether the promo code has been used by at least one customer. If this value is true, the code field is removed from the request.

  • site_iduuidoptional

    Identifier of the site this discount type belongs to. Discount types are scoped per site so each location can maintain its own promo codes, staff discounts, and loyalty offers. The caller's API key must have access to this site.

Responses

  • 200

    The Discount Type was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

delete/shop/discount-types/{discountType}

Archive a DiscountType

deleteDiscountType

Soft deletes a DiscountType by ID.

Path parameters

Responses

  • 204

    The discount type was successfully archived.

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

post/shop/discount-types/{discountType}/copy

Copy a DiscountType

actionDiscountType

Copies an existing DiscountType by ID.

Path parameters

Request body

  • codestringoptional

    The code for the discount type. When the type is a promo code, this will be what the customer enters in on the booking engine to receive their discount, e.g. SUMMER23. Or, if the discount type is for app use, this is what is used for reporting. If has_been_redeemed is true, this field is removed from the request.

  • descriptionstringoptionalnullable

    This provides further details on what the discount type can be used for. It's up to the user to provide this.

  • site_iduuidoptional

    Identifier of the site the copied discount type should belong to. Lets you duplicate a discount type from one site into another within the same organisation.

Responses

  • 200

    The Discount Type was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found

  • 422

    The request didn't pass validation

post/shop/discount-types/{discountType}/restore

Restore a DiscountType

restoreDiscountType

Restores an archived (soft-deleted) DiscountType by ID.

Path parameters

Responses

  • 200

    The Discount Type was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found