---
title: "Create an SMS Message Fragment"
method: POST
path: "/shop/sms-fragments"
tags: ["SmsFragments"]
---

# Create an SMS Message Fragment

`POST /shop/sms-fragments`

This endpoint creates an SMS Message Fragment for the given site.

## Request body

- object
  - `name` string, required — Internal label for the SMS fragment, shown in the admin UI when authoring SMS templates. Not visible to customers. 1-120 characters.
  - `message_type` 'basket_confirmed' | 'basket_cancelled_with_charge' | 'basket_cancelled_without_charge' | 'basket_reminder' | 'basket_follow_up' | 'pay_by_link_request', required — The type of message the SMS Fragment applies to.
  - `message` string — The contents of the SMS Fragment.
  - `priority` integer — The priority of the SMS Fragment. Fragments will be added to messages in ascending order.
  - `offerings` OfferingIdentifier[] — An array of offerings which the SMS Fragment applies to. If empty, the SMS Fragment applies to no offerings.
    - `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.
  - `site_id` string, uuid, required — Identifier of the site this SMS fragment is sent on behalf of. Fragments are scoped per site so each location can compose its own SMS copy and sender name.
  - `organisation_id` string, uuid, required — Identifier of the organisation that owns the site. Used for cross-site reporting and to enforce that the supplied `site_id` belongs to this organisation.

## Response `201`

The SMS Message Fragment was successfully retrieved

- object
  - `data` SmsFragment, required
    - `id` string, uuid, required — The ID of the SMS Fragment.
    - `name` string, required — The name of the SMS Fragment.
    - `message_type` 'basket_confirmed' | 'basket_cancelled_with_charge' | 'basket_cancelled_without_charge' | 'basket_reminder' | 'basket_follow_up' | 'pay_by_link_request' | 'billing_details_request', required — The type of message the SMS Fragment applies to.
    - `message` string, required — The contents of the SMS Fragment.
    - `priority` integer, required — The priority of the SMS Fragment. Fragments will be added to messages in ascending order.
    - `offerings` OfferingIdentifier[], required — An array of offerings which the SMS Fragment applies to. If empty, the SMS Fragment applies to no offerings.
      - `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.
    - `site_id` string, uuid, required — The ID of the site the SMS Fragment is associated with.
    - `organisation_id` string, uuid, required — The ID of the organisation the SMS Fragment is associated with.

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `422` — The request didn't pass validation

---

[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)
