> ## Documentation Index
> Fetch the complete documentation index at: https://developers.redo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createCommerceAgentStrategy

> Create a Commerce Agent strategy. Set its id as `strategyId` when inserting a Start Agent Conversation step.

**Required scopes:** [`marketing_automations_write`](/docs/api-reference/v3/reference/scopes#scope-marketing_automations_write)

## Arguments

<ResponseField name="input" type={<a href="/docs/api-reference/v3/reference/marketing/create-commerce-agent-strategy-input">CreateCommerceAgentStrategyInput!</a>} required>
  The strategy to create.

  <Expandable title="fields" lazyRender>
    <ResponseField name="discountCodeId" type="ID">
      A DiscountCode `id`, or its `legacyId` from an earlier version of the Redo API, for the Commerce Agent to offer.
    </ResponseField>

    <ResponseField name="goalGuidance" type="String">
      What the Commerce Agent should accomplish in the conversation.
    </ResponseField>

    <ResponseField name="name" type="String">
      Merchant-facing name. Defaults to `Agent step`.
    </ResponseField>

    <ResponseField name="outreachGuidance" type="String">
      How the Commerce Agent should write its first message and replies.
    </ResponseField>
  </Expandable>
</ResponseField>

## Returns

<ResponseField name="createCommerceAgentStrategy" type={<a href="/docs/api-reference/v3/reference/marketing/commerce-agent-strategy">CommerceAgentStrategy!</a>} required>
  Guidance for a Commerce Agent conversation started by a Start Agent Conversation automation step: the goal, how to write the outreach, and an optional discount code the agent may offer.

  <Expandable title="fields" lazyRender>
    <ResponseField name="createdAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the strategy was created.
    </ResponseField>

    <ResponseField name="discountCodeId" type="ID">
      The DiscountCode the Commerce Agent may offer. Null when there is none, or when the discount code was deleted.
    </ResponseField>

    <ResponseField name="goalGuidance" type="String">
      What the Commerce Agent should accomplish in the conversation.
    </ResponseField>

    <ResponseField name="id" type="ID!" required>
      The id of this strategy. Set it as `strategyId` on a Start Agent Conversation step.
    </ResponseField>

    <ResponseField name="name" type="String!" required>
      Merchant-facing name.
    </ResponseField>

    <ResponseField name="outreachGuidance" type="String">
      How the Commerce Agent should write its first message and replies.
    </ResponseField>

    <ResponseField name="updatedAt" type={<a href="/docs/api-reference/v3/reference/common/date-time">DateTime!</a>} required>
      When the strategy was last changed.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

```graphql theme={null}
mutation {
  createCommerceAgentStrategy(input: { ... }) {
    createdAt
    discountCodeId
    goalGuidance
    id
    name
    outreachGuidance
    updatedAt
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.