From b1f22d59330babfaa863dae96027af1705ed14b4 Mon Sep 17 00:00:00 2001 From: Kanchan Basnet Date: Thu, 18 Jun 2026 02:12:56 +0545 Subject: [PATCH 1/2] Add Cancel Fulfillment action for Shopify --- .../fulfillment-cancel/fulfillment-cancel.mjs | 45 +++++++++++++++++++ components/shopify/common/mutations.mjs | 17 +++++++ components/shopify/shopify.app.mjs | 4 ++ 3 files changed, 66 insertions(+) create mode 100644 components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs diff --git a/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs b/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs new file mode 100644 index 0000000000000..5716cfdfc9213 --- /dev/null +++ b/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs @@ -0,0 +1,45 @@ +import shopify from "../../shopify.app.mjs"; + +export default { + key: "shopify-cancel-fulfillment", + name: "Cancel Fulfillment", + description: "Cancels an existing fulfillment and reverses its effects on associated fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/fulfillmentCancel)", + version: "0.0.1", + annotations: { + destructiveHint: true, + openWorldHint: true, + readOnlyHint: false, + }, + type: "action", + props: { + shopify, + orderId: { + propDefinition: [ + shopify, + "orderId", + ], + optional: true, + }, + fulfillmentId: { + propDefinition: [ + shopify, + "fulfillmentId", + ({ orderId }) => ({ + orderId, + }), + ], + }, + }, + async run({ $ }) { + const { fulfillmentCancel } = await this.shopify.cancelFulfillment({ + id: this.fulfillmentId, + }); + + if (fulfillmentCancel.userErrors?.length) { + throw new Error(fulfillmentCancel.userErrors.map((e) => e.message).join(", ")); + } + + $.export("$summary", `Successfully cancelled fulfillment \`${fulfillmentCancel.fulfillment.id}\``); + return fulfillmentCancel.fulfillment; + }, +}; diff --git a/components/shopify/common/mutations.mjs b/components/shopify/common/mutations.mjs index 28f58b570b6d4..295f0a9907df6 100644 --- a/components/shopify/common/mutations.mjs +++ b/components/shopify/common/mutations.mjs @@ -433,6 +433,22 @@ const UPDATE_ORDER = ` } `; +const FULFILLMENT_CANCEL = ` +mutation fullfillmentCancel($id: ID!){ +fulfillmentCancel(id: $id) { + fulfillment { + id + status + } + userErrors { + field + message + } + } +} + +`; + export default { CREATE_WEBHOOK, DELETE_WEBHOOK, @@ -458,4 +474,5 @@ export default { DELETE_PAGE, DELETE_METAFIELD, UPDATE_ORDER, + FULFILLMENT_CANCEL, }; diff --git a/components/shopify/shopify.app.mjs b/components/shopify/shopify.app.mjs index 218b31567c203..82a467710abf8 100644 --- a/components/shopify/shopify.app.mjs +++ b/components/shopify/shopify.app.mjs @@ -563,6 +563,10 @@ export default { getFulfillment(variables) { return this._makeGraphQlRequest(queries.GET_FULFILLMENT, variables); }, + cancelFulfillment(variables) { + return this._makeGraphQlRequest(mutations.FULFILLMENT_CANCEL, variables); + + }, getFulfillmentOrder(variables) { return this._makeGraphQlRequest(queries.GET_FULFILLMENT_ORDER, variables); }, From 50fdf6b705a2fef3c45150435868561d99faf430 Mon Sep 17 00:00:00 2001 From: Kanchan Basnet Date: Thu, 18 Jun 2026 02:36:55 +0545 Subject: [PATCH 2/2] Bump shopify package version and fix component key naming --- .../shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs | 2 +- components/shopify/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs b/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs index 5716cfdfc9213..9e70395a3abd1 100644 --- a/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs +++ b/components/shopify/actions/fulfillment-cancel/fulfillment-cancel.mjs @@ -1,7 +1,7 @@ import shopify from "../../shopify.app.mjs"; export default { - key: "shopify-cancel-fulfillment", + key: "shopify-fulfillment-cancel", name: "Cancel Fulfillment", description: "Cancels an existing fulfillment and reverses its effects on associated fulfillment orders. [See the documentation](https://shopify.dev/docs/api/admin-graphql/latest/mutations/fulfillmentCancel)", version: "0.0.1", diff --git a/components/shopify/package.json b/components/shopify/package.json index 71a2d1fd2df70..7d5640bed01f8 100644 --- a/components/shopify/package.json +++ b/components/shopify/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/shopify", - "version": "0.9.0", + "version": "0.10.0", "description": "Pipedream Shopify Components", "main": "shopify.app.mjs", "keywords": [