marketingActivityCreate mutation

Create new marketing activity.

Required access

write_marketing_events access scope.


On this page


Interactive example

This is an example mutation query. Use the embedded interactive tool below to edit the query.

Hint: use Ctrl + Space for autocompleting fields.

mutation marketingActivityCreate($input: MarketingActivityCreateInput!) { marketingActivityCreate(input: $input) {
  1. <font style="color:#1F61A0;">marketingActivity</font> <font style="color:#555555;">{</font>
  2. <font style="color:#1F61A0;">id</font>
  3. <font style="color:#555555;">}</font>
  4. <font style="color:#1F61A0;">redirectPath</font>
  5. <font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
  6. <font style="color:#1F61A0;">field</font>
  7. <font style="color:#1F61A0;">message</font>
  8. <font style="color:#555555;">}</font>
} } { “input”: {
  1. <font style="color:#8B2BB9;">"marketingActivityExtensionId"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="</font><font style="color:#555555;">,</font>
  2. <font style="color:#8B2BB9;">"status"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font>
} }


Arguments

Argument Description
input
(
[MarketingActivityCreateInput!](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitycreateinput)

) REQUIRED
The Input of marketing activity create.


MarketingActivityCreateInput fields

  • budget ([MarketingActivityBudgetInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitybudgetinput))
    The budget for this marketing activity.
  • context ([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    Encoded context containing marketing campaign id.
  • formData ([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    The form data in JSON serialized as a string.
  • marketingActivityExtensionId ([ID!](https://shopify.dev/docs/admin-api/graphql/reference/scalar#id-2021-01)) REQUIRED
    The ID of the marketing activity extension.
  • marketingActivityTitle ([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    The title of the marketing activity.
  • status ([MarketingActivityStatus!](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivitystatus)) REQUIRED
    The current state of the marketing activity.
  • utm ([UTMInput](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/utminput))
    Specifies the Urchin Traffic Module (UTM) parameters that are associated with a related marketing campaign. UTMInput is required for all Marketing tactics except Storefront App.


Return fields

  • marketingActivity ([MarketingActivity](https://shopify.dev/docs/admin-api/graphql/reference/discounts-and-marketing/marketingactivity))
    The created marketing activity.
  • redirectPath ([String](https://shopify.dev/docs/admin-api/graphql/reference/scalar#string-2021-01))
    The path to return back to shopify admin from embedded editor.
  • userErrors ([[UserError!]!](https://shopify.dev/docs/admin-api/graphql/reference/usererror))
    List of errors that occurred executing the mutation.