---
title: "Detach an offering from a message fragment"
method: DELETE
path: "/shop/message-fragments/{messageFragmentId}/offerings/{offeringId}"
tags: ["MessageFragments"]
---

# Detach an offering from a message fragment

`DELETE /shop/message-fragments/{messageFragmentId}/offerings/{offeringId}`

Removes an offering from the fragment's `offerings` list. After
removal the fragment will no longer be selected for emails whose
booking only contains the detached offering. If the resulting
`offerings` list is empty the fragment reverts to applying to
every offering at the site (the global fallback behaviour).

Removing an offering that is not attached is a no-op. Requires
the `update` ability on the target fragment.

## Response `200`

The message fragment was successfully retrieved.

- object
  - `data` MessageFragment, required — A `MessageFragment` is a reusable block of HTML/Markdown content that is concatenated into transactional emails (booking confirmations, reminders, follow-ups, etc.). Fragments are scoped to a site, can be filtered by `message_type`, and can be limited to specific offerings or membership types so that copy is tailored to the customer's context. At send time, the messaging pipeline pulls every fragment whose `message_type` matches the message being sent and whose `offerings` and `permitted_membership_type_ids` filters are satisfied, sorts them by ascending `priority`, and renders them inline into the email body.
    - `id` string, mongo-id, required — Unique identifier of the message fragment.
    - `name` string, required — Internal label for the fragment, shown in the admin UI when authoring email templates. Not visible to customers.
    - `message_type` 'basket_cancelled' | 'basket_confirmed' | 'basket_follow_up' | 'basket_item_cancelled' | 'basket_reminder' | 'order_summary' | 'pay_by_link_request' | 'appointment_enquiry_confirmed' | 'visit_prompt' | 'membership_welcome' | 'membership_cancelled' | 'voucher_recipient' | 'membership_enquiry_confirmed' | 'new_order' | 'new_enquiry', required — Which transactional email this fragment is included in. Fragments are only rendered into the matching message type.
    - `message` string, nullable, required — The body of the fragment. Accepts a restricted subset of HTML (basic block and inline tags) which is sanitised on save. Liquid-style placeholders such as `{{ customer.first_name }}` and `{{ booking.starts_at }}` are interpolated when the email is rendered.
    - `priority` integer, nullable, required — Render order within a message. Fragments are concatenated in ascending `priority` order, so lower numbers appear earlier in the email body. Use to control which paragraph leads.
    - `offerings` OfferingIdentifier[], required — Offerings this fragment applies to. When empty, the fragment applies to every offering at the site (a global fallback). When non-empty, the fragment is only included if the message's booking contains at least one matching offering.
      - `offering_id` string, mongo-id, required — The ID of the offering.
      - `offering_name` string, required — The name of the offering.
      - `offering_type` 'appointment' | 'appointment_enquiry' | 'area_booking' | 'course' | 'hotel_room_reservation' | 'membership' | 'package' | 'product' | 'session' | 'table_reservation' | 'voucher', required — Discriminator describing what kind of sellable item an `Offering` represents. The value determines which downstream schema (`Appointment`, `Session`, `Package`, etc.) the offering's `offering_id` resolves against, and which checkout/booking flow applies.
    - `permitted_membership_type_ids` string[], nullable, required — Optional list of `MembershipType` IDs. When set, the fragment is only rendered for customers who hold an active membership of one of these types - useful for member-only welcome copy, loyalty perks, or upgrade prompts. Empty/null means no membership filter applies.
    - `site_id` string, uuid, required — Site the fragment belongs to. Fragments are authored per-site so each location can tailor its email copy.
    - `organisation_id` string, uuid, required — Organisation that owns the site.

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found

---

[API](https://skmtc.dev/try/apis/trybe-api.md) · [All operations](https://skmtc.dev/try/apis/trybe-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/try/trybe-api/revisions/f37f92702da5/schema)
