Skip to content

Discard ​

Throws away every staged edit of a theme and channel. The published content, statuses and order are left exactly as they are, so the storefront does not change.

Endpoint ​

MethodPathPurpose
POST/api/admin/appearance/themes/{code}/sections/discardDiscard staged section edits

Path parameters ​

ParameterDescription
codeTheme whose staged edits are discarded.

Query parameters ​

ParameterDescription
channelChannel being discarded. Falls back to the current channel.

Response fields ​

FieldTypeDescription
themeCodestringTheme that was discarded.
channelIdintegerChannel that was discarded.
sectionIdsarraySections whose staged edits were thrown away. Empty when nothing was staged.
messagestringConfirmation text.

Use cases ​

  • Abandon an edit session — one call resets every section a merchant touched back to what shoppers already see.

Best practices ​

  • Discarding cannot be undone, because a staged edit is the only copy of the unpublished work. There is no history to restore it from.
  • It does not restore deleted sections. Delete section is immediate and outside the staging cycle.
  • Like publishing, it works per theme and channel — every section in that pair is reset, not just the one being edited.

Errors ​

StatusWhen
404Unknown theme code.

Permissions ​

Requires appearance.sections.edit.

Released under the MIT License.