Sites & Organisation

Sms Fragments

An SmsFragment is a template for an SMS message.

get/shop/sms-fragments

List SMS Message Fragments

listSmsFragments

This endpoint retrieves a list of all the SMS Message Fragments for the given site.

Query parameters

  • site_iduuidrequired

    Identifier of the site whose SMS fragments should be returned. SMS fragments are scoped per site so each location can author its own SMS templates. The caller's API key must have access to this site.

  • offering_iduuidoptional

    When provided, restricts the returned SMS fragments to those that apply to the given offering (treatment, class, course etc.). Omit to list SMS fragments across all offerings at the 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.

  • pageintegeroptional

    The page to retrieve results from

  • per_pageintegeroptional

    The number of results to return per page

Responses

  • 200

    The SMS Message Fragments were successfully retrieved

  • 401

    The user is unauthenticated

post/shop/sms-fragments

Create an SMS Message Fragment

createSmsFragment

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

Request body

  • namestringrequired

    Internal label for the SMS fragment, shown in the admin UI when authoring SMS templates. Not visible to customers. 1-120 characters.

  • message_typestringrequired

    The type of message the SMS Fragment applies to.

    Possible values:basket_confirmedbasket_cancelled_with_chargebasket_cancelled_without_chargebasket_reminderbasket_follow_uppay_by_link_request
  • messagestringoptional

    The contents of the SMS Fragment.

  • priorityintegeroptional

    The priority of the SMS Fragment. Fragments will be added to messages in ascending order.

  • offeringsobject[]optional

    An array of offerings which the SMS Fragment applies to. If empty, the SMS Fragment applies to no offerings.

  • site_iduuidrequired

    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_iduuidrequired

    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.

Responses

  • 201

    The SMS Message Fragment 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/sms-fragments/{smsFragmentId}

Show an SMS Message Fragment

getSmsFragment

This endpoint retrieves an SMS Message Fragment by ID.

Path parameters

Responses

  • 200

    The SMS Message Fragment was successfully retrieved

  • 401

    The user is unauthenticated

  • 404

    The resource couldn't be found

put/shop/sms-fragments/{smsFragmentId}

Update an SMS Message Fragment

updateSmsFragment

This endpoint updates an SMS Message Fragment by ID.

Path parameters

Request body

  • namestringoptional

    Internal label for the SMS fragment, shown in the admin UI when authoring SMS templates. Not visible to customers. 1-120 characters.

  • message_typestringoptional

    The type of message the SMS Fragment applies to.

    Possible values:basket_confirmedbasket_cancelled_with_chargebasket_cancelled_without_chargebasket_reminderbasket_follow_uppay_by_link_request
  • messagestringoptional

    The contents of the SMS Fragment.

  • priorityintegeroptional

    The priority of the SMS Fragment. Fragments will be added to messages in ascending order.

  • offeringsobject[]optional

    An array of offerings which the SMS Fragment applies to. If empty, the SMS Fragment applies to no offerings.

  • site_iduuidoptional

    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_iduuidoptional

    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.

Responses

  • 200

    The SMS Message Fragment 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/sms-fragments/{smsFragmentId}

Archive an SMS Message Fragment

deleteSmsFragment

This endpoint soft deletes an SMS Message Fragment by ID.

Path parameters

Responses

  • 204

    The SMS Message Fragment 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/sms-fragments/{smsFragmentId}/copy

Duplicate an SMS fragment

copySmsFragment

Creates a copy of an existing SmsFragment with new fields applied from the request body. Useful when seeding similar messaging content (e.g. variants for A/B testing, or per-offering overrides of a shared template).

Requires the SETTINGS_MANAGE permission on the source fragment's site, plus the create permission on SmsFragment. The copy is created at the source's site.

Path parameters

Request body

  • namestringoptional

    Internal label for the new copy. Conventionally the source's name suffixed with "(Copy)" or a variant tag.

  • message_typestringoptional

    The type of message the SMS Fragment applies to. Defaults to the source's value.

    Possible values:basket_confirmedbasket_cancelled_with_chargebasket_cancelled_without_chargebasket_reminderbasket_follow_uppay_by_link_request
  • messagestringoptionalnullable

    Contents of the SMS Fragment.

  • priorityintegeroptionalnullable

    Priority of the SMS Fragment. Fragments are concatenated in ascending priority order to build the final message.

  • offeringsobject[]optional

    Offerings the SMS Fragment applies to. Empty/omitted means the fragment applies to no specific offerings (use the global fallback).

Responses

  • 201

    The SMS Message Fragment 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/sms-fragments/{smsFragmentId}/restore

Restore an SMS Message Fragment

restoreSmsFragment

This endpoint restores an archived (soft-deleted) SMS Message Fragment by ID.

Path parameters

Responses

  • 200

    The SMS Message Fragment was successfully retrieved

  • 401

    The user is unauthenticated

  • 403

    The authenticated user does not have permission.

  • 404

    The resource couldn't be found