Add discountCodePublish mutation & status enum for segments

4/15/2026, 12:01:14 AM

The new discountCodePublish mutation lets you publish an existing discount code to the channels that the requesting sales app owns. It requires an input with code and reason strings and returns a DiscountCodePublishPayload containing the codeDiscountNode and a list of userErrors. Errors are wrapped in DiscountCodePublishUserError objects with a code enum (DISCOUNT_CODE_NOT_FOUND, INVALID_CHANNEL, INVALID_DISCOUNT), a list of affected field paths and a descriptive message. A new CustomerSegmentMembersQueryStatus enum appears, and the CustomerSegmentMembersQuery type now exposes a non‑null status field to indicate whether a query is initialized, completed, failed, or deleted. The ShopPlan.publicDisplayName field was re‑listed but unchanged, so no action is needed. Overall, developers should add the mutation to their client, handle the nested error structs, and optionally poll the query status field for segment member queries.

Mutation Changes

➕ Added Mutations (1)

discountCodePublish

Publish a discount code to channels of the sales app making this request.

Type Changes

➕ Added Types (5)

📋CustomerSegmentMembersQueryStatus➕ AddedENUM

The status of a customer segment members query.

Values: INITIALIZED, COMPLETED, FAILED, DELETED
📥DiscountCodePublishInput➕ AddedINPUT_OBJECT

The input fields for publishing a discount code.

🏗️DiscountCodePublishPayload➕ AddedOBJECT

Return type for discountCodePublish mutation.

Fields: codeDiscountNode, userErrors
🏗️DiscountCodePublishUserError➕ AddedOBJECT

An error that occurs during the execution of DiscountCodePublish.

Fields: code, field, message
📋DiscountCodePublishUserErrorCode➕ AddedENUM

Possible error codes that can be returned by DiscountCodePublishUserError.

Values: DISCOUNT_CODE_NOT_FOUND, INVALID_CHANNEL, INVALID_DISCOUNT

🔄 Modified Types (2)

🏗️CustomerSegmentMembersQuery🔄 Modified
Field added: status

The status of the customer segment members query.

🏗️ShopPlan🔄 Modified
🔄 Field modified: publicDisplayName