marketing Activity Delete Externalmutation
mutation
2024-10latest
Requires write
access scope.
Deletes an external marketing activity.
Arguments
Anchor to marketingActivityIdmarketingActivityIdThe ID of the marketing activity. A marketing activity ID or remote ID must be provided.
Anchor to remoteIdremoteIdThe ID of an activity that's hosted outside of Shopify. A marketing activity ID or remote ID must be provided.
Was this section helpful?
MarketingActivityDeleteExternalPayload returns
Anchor to MarketingActivityDeleteExternalPayload.deletedMarketingActivityIddeletedMarketing Activity Id The ID of the marketing activity that was deleted, if one was deleted.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Code examples for MUTATION: marketingActivityDeleteExternal
Query Reference for MUTATION: marketingActivityDeleteExternal
"mutation marketingActivityDeleteExternal {\n marketingActivityDeleteExternal {\n deletedMarketingActivityId\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: marketingActivityDeleteExternal
"{\n \"marketingActivityId\": \"gid://shopify/<objectName>/10079785100\",\n \"remoteId\": \"<your-remoteId>\"\n}"
Schema Reference for MUTATION: marketingActivityDeleteExternal
""
Display Examples for MUTATION: marketingActivityDeleteExternal
[ { "example": { "type_name": "marketingactivitydeleteexternal", "title": "Delete an external marketing activity using the marketing activity ID", "query_string": "mutation marketingActivityDeleteExternal($marketingActivityId: ID!) {\n marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) {\n deletedMarketingActivityId\n }\n}", "variables": { "marketingActivityId": "gid://shopify/MarketingActivity/36187062" }, "response": { "data": { "marketingActivityDeleteExternal": { "deletedMarketingActivityId": "gid://shopify/MarketingActivity/36187062" } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/merchant_marketing/test/unit/graph_api/admin/mutations/marketing_activity_delete_external_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityDeleteExternal($marketingActivityId: ID!) { marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) { deletedMarketingActivityId } }\",\n \"variables\": {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\"\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityDeleteExternal($marketingActivityId: ID!) {\n marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) {\n deletedMarketingActivityId\n }\n }`,\n {\n variables: {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\"\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityDeleteExternal($marketingActivityId: ID!) {\n marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) {\n deletedMarketingActivityId\n }\n }\nQUERY\n\nvariables = {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\"\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityDeleteExternal($marketingActivityId: ID!) {\n marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) {\n deletedMarketingActivityId\n }\n }`,\n \"variables\": {\n \"marketingActivityId\": \"gid://shopify/MarketingActivity/36187062\"\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityDeleteExternal($marketingActivityId: ID!) {\n marketingActivityDeleteExternal(marketingActivityId: $marketingActivityId) {\n deletedMarketingActivityId\n }\n }\nQUERY;\n\n$variables = [\n \"marketingActivityId\" => \"gid://shopify/MarketingActivity/36187062\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "marketingActivityId", "description": "The ID of the marketing activity. A marketing activity ID or remote ID must be provided.", "type": { "kind": "SCALAR", "name": "ID", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "ID", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "marketingActivityId", "argValue": " \"gid://shopify/MarketingActivity/36187062\"", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "marketingactivitydeleteexternal", "title": "Delete an external marketing activity using the remote ID", "query_string": "mutation marketingActivityUpdateExternal($remoteId: String!) {\n marketingActivityDeleteExternal(remoteId: $remoteId) {\n deletedMarketingActivityId\n }\n}", "variables": { "remoteId": "abcdefg" }, "response": { "data": { "marketingActivityDeleteExternal": { "deletedMarketingActivityId": "gid://shopify/MarketingActivity/36187062" } } }, "api_name": "admin", "minimum_api_version": "2024-01", "maximum_api_version": "unstable", "location": "/components/merchant_marketing/test/unit/graph_api/admin/mutations/marketing_activity_delete_external_test.rb", "curl_example": "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation marketingActivityUpdateExternal($remoteId: String!) { marketingActivityDeleteExternal(remoteId: $remoteId) { deletedMarketingActivityId } }\",\n \"variables\": {\n \"remoteId\": \"abcdefg\"\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation marketingActivityUpdateExternal($remoteId: String!) {\n marketingActivityDeleteExternal(remoteId: $remoteId) {\n deletedMarketingActivityId\n }\n }`,\n {\n variables: {\n \"remoteId\": \"abcdefg\"\n },\n },\n);\n\nconst data = await response.json();\n", "ruby_example": "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!) {\n marketingActivityDeleteExternal(remoteId: $remoteId) {\n deletedMarketingActivityId\n }\n }\nQUERY\n\nvariables = {\n \"remoteId\": \"abcdefg\"\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation marketingActivityUpdateExternal($remoteId: String!) {\n marketingActivityDeleteExternal(remoteId: $remoteId) {\n deletedMarketingActivityId\n }\n }`,\n \"variables\": {\n \"remoteId\": \"abcdefg\"\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation marketingActivityUpdateExternal($remoteId: String!) {\n marketingActivityDeleteExternal(remoteId: $remoteId) {\n deletedMarketingActivityId\n }\n }\nQUERY;\n\n$variables = [\n \"remoteId\" => \"abcdefg\",\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "remoteId", "description": "The ID of an activity that's hosted outside of Shopify. A marketing activity ID or remote ID must be provided.", "type": { "kind": "SCALAR", "name": "String", "list": false, "non_null": false }, "defaultValue": null, "typeSignature": "String", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "remoteId", "argValue": " \"abcdefg\"", "typeKind": "MUTATION" } ] } ]