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) {} } { “input”: {
<font style="color:#1F61A0;">marketingActivity</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">id</font>
<font style="color:#555555;">}</font>
<font style="color:#1F61A0;">redirectPath</font>
<font style="color:#1F61A0;">userErrors</font> <font style="color:#555555;">{</font>
<font style="color:#1F61A0;">field</font>
<font style="color:#1F61A0;">message</font>
<font style="color:#555555;">}</font>
} }
<font style="color:#8B2BB9;">"marketingActivityExtensionId"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="</font><font style="color:#555555;">,</font>
<font style="color:#8B2BB9;">"status"</font><font style="color:#555555;">:</font> <font style="color:#D64292;">"placeholder"</font>
Arguments
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.