---
title: "Idempotent on (advertiser, item): a second call replaces the live goal"
method: PUT
path: "/walmart/advertisers/{public_id}/goals/{item_id}"
tags: ["walmart"]
---

# Idempotent on (advertiser, item): a second call replaces the live goal

`PUT /walmart/advertisers/{public_id}/goals/{item_id}`

## Request

- Base URL: `https://api.autron.ai`
- URL: `https://api.autron.ai/walmart/advertisers/{public_id}/goals/{item_id}`
- Auth: API key in header `Authorization`

Every PUT that leaves the goal disabled pauses the item's managed campaigns, so sending it again retries a pause that failed. Switching a goal on enables nothing.

## Request body

- WalmartGoalRequest
  - `objective` string, required: maximize_sales (maximize_profit needs costs)
  - `strategy` string, required: maximum_acos or maximum_daily_budget (minimum_net_profit needs costs)
  - `strategy_value` number, required: greater than zero; a daily budget (maximum_daily_budget) at least 0.01 while the goal is enabled
  - `state` string: enabled (default) | disabled

## Response `200`

Goal saved. Left disabled, the item's managed campaigns are paused: `campaigns` says how each went and `spend_stopped` whether all are paused. The goal change stands whatever Walmart does.

- WalmartGoalWrite
  - `public_id` string: unique goal public id
  - `platform` string: always 'walmart' here
  - `walmart_advertiser_public_id` string: the advertiser this goal governs
  - `walmart_item_id` string: the Walmart item ID the goal is set on
  - `objective` string: maximize_sales
  - `strategy` string: maximum_acos or maximum_daily_budget
  - `strategy_value` number: the ACoS ceiling (as a percentage) or the daily budget
  - `state` string: enabled | disabled
  - `turbo_mode` string: disabled — no Walmart implementation yet
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `campaigns` WalmartGoalCampaignOutcome[]: when the goal is left disabled, one entry per campaign Autron manages for the item; empty otherwise
    - `campaign_id` integer: Walmart campaign id
    - `outcome` string: paused | busy (another change held it) | failed (Walmart refused, or the record failed) | unconfirmed (Walmart may have paused it; the registry is unchanged)
    - `message` string: why it is not paused; null when it is
  - `spend_stopped` boolean: true when every listed campaign is paused (also when there is none); false when one may still spend; null while the goal is enabled

## Other responses

- `201`: Goal created.
- `400`: Objective or strategy not available on Walmart.

---

[API](https://skmtc.dev/autron/apis/autron-api.md) · [All operations](https://skmtc.dev/autron/apis/autron-api/llms.txt) · [OpenAPI document](https://skmtc.dev/autron/apis/autron-api/revisions/f696bfa7295f?raw)
