DiscountUsage

Promo code usage breakdown

This endpoint provides a breakdown of discount usage by promo code for individual orders matching the given parameters.

get/shop/reports/promo-code-usage/breakdown

Query parameters

site_idstring uuid required

Filter the breakdown list of used promo codes by site.

revenue_date_fromstring date
Example:2023-10-01

Filter the breakdown list of used promo codes by revenue date of the order. The promo code must have been used on orders with bookings on or after this date.

revenue_date_tostring date
Example:2023-10-31

Filter the breakdown list of used promo codes by revenue date of the order. The promo code must have been used on orders with bookings on or before this date.

submitted_at_fromstring date
Example:2023-31-01

Filter the breakdown list of used promo codes by submitted date of the order. The promo code must have been used on orders submitted on or after this date.

submitted_at_tostring date
Example:2023-31-10

Filter the breakdown list of used promo codes by submitted date of the order. The promo code must have been used on orders submitted on or before this date.

pageinteger

The page to retrieve results from

per_pageinteger

The number of results to return per page

sortstring

The field to order results by.

sort_order'asc' | 'desc'

The direction to order results by.

applied_bystring uuid

Filter the breakdown list of used promo codes by the user who applied the promo code. This can be either 'Customer' or a member of staff.

Response

The breakdown of UsedPromoCodes was successfully retrieved

Example response

{
  "data": [
    {
      "discount_type_code": "SUMMER23",
      "order_ref": "TRY00",
      "order_total": 1000,
      "total_discount_on_order": 1000,
      "currency": "gbp",
      "applied_by": {
        "avatar": {
          "file_name": "super-cool-photo.jpg",
          "mime_type": "image/jpeg",
          "original_url": "https://example.com/media/super-cool-photo.jpg",
          "size": 84256,
          "url": "https://example.com/media/super-cool-photo-thumbnail@2x.jpg"
        },
        "first_name": "Jane",
        "full_name": "Jane Smith",
        "last_name": "Smith"
      }
    }
  ],
  "meta": {
    "from": 1,
    "to": 2,
    "total": 2,
    "current_page": 1,
    "last_page": 2,
    "per_page": 15,
    "path": "http://example.com/api"
  },
  "links": {
    "first": "http://example.com?page=1",
    "next": "https://example.com?page=3",
    "prev": "https://example.com?page=1",
    "last": "https://example.com?page=4"
  }
}

Changes