Orders

Apply a discount to an order

Use this endpoint to apply the discount from a DiscountType to an order.

post/shop/orders/{orderId}/discounts

Request body

discount_type_codestring required

The code for the DiscountType. If the code exists, the discount will be applied. If not, an error will be returned.

discount_amountinteger required

The value of the discount to be applied when a DiscountType is applied. If this is for a customisable in-app discount type, this will be able to be changed before being applied.

amount_type'monetary' | 'percentage'

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

reason_code'coupon' | 'general' | 'predefined' | 'voucher_difference'

The code for the reason the discount was applied.

Example request

{
  "discount_type_code": "SUMMER23",
  "discount_amount": 15,
  "amount_type": "percentage",
  "reason_code": "coupon"
}

Response

The OrderDiscount was successfully applied.

Example response

{
  "data": [
    {
      "discount_type_code": "SUMMER23",
      "applicable_for": "app_and_booking_engine",
      "amount_type": "percentage",
      "discount_amount": 15,
      "calculated_amount": 150,
      "currency": "gbp",
      "reason_code": "coupon",
      "coupon": {
        "code": "FIVEOFF",
        "name": "April special",
        "description": "Get 10% off all treatments booked in April."
      },
      "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"
      }
    }
  ]
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.