Update an existing Campaign
Use the Update Campaign API to update the details of an existing SEM campaign with the specified Campaign ID. The unique Campaign ID is required to make the updates. You can update details such as the campaign name, start and end dates, total budget, and target return on ad spend (RoAS) in the request. For campaigns scheduled in future dates, the start date can be updated; for running campaigns, the API will throw an exception.
Additionally, you can add new SKUs and remove existing SKUs.from the campaign. The specified updates will be applied while preserving the unique Campaign ID.
Throttling
Request limits: 5 calls per minute per seller. You may receive an HTTP 429 error if you exceed this limit.
Endpoint
PUT /v3/advertising/sem/campaigns/{campaignId}
Sample request
Use this example as a starting point, then modify it with your actual values and any additional parameters described in the API reference.
curl --location --request PUT 'https://marketplace.walmartapis.com/v3/advertising/sem/campaigns/123456789' \
--header 'WM_SVC.NAME: Search Engine Marketing' \
--header 'WM_QOS.CORRELATION_ID: ca86e7aa-3166-4f8b-8148-83d38564e9b9' \
--header 'WM_SEC.ACCESS_TOKEN: **********' \
--header 'Content-Type: application/json' \
--data '{ "metadata": { "name": "Valentines Day Campaign", "startDate": "2025-02-01", "endDate": "2025-02-28", "totalBudget": 2000.0, "targetRoas": 3.5 }, "itemsOperations": [ { "operationType": "ADD", "skus": [ "sku_07148487515983_test" ] }, { "operationType": "REMOVE", "skus": [ "sku_00993001888299_test" ] } ]
}'
import requests url = "https://marketplace.walmartapis.com/v3/advertising/sem/campaigns/123456789" headers = { "WM_SVC.NAME": "Search Engine Marketing", "WM_QOS.CORRELATION_ID": "ca86e7aa-3166-4f8b-8148-83d38564e9b9", "WM_SEC.ACCESS_TOKEN": "**********", # Replace with your actual access token "Content-Type": "application/json"
} data = { "metadata": { "name": "Valentines Day Campaign", "startDate": "2025-02-01", "endDate": "2025-02-28", "totalBudget": 2000.0, "targetRoas": 3.5 }, "itemsOperations": [ { "operationType": "ADD", "skus": ["sku_07148487515983_test"] }, { "operationType": "REMOVE", "skus": ["sku_00993001888299_test"] } ]
} response = requests.put(url, headers=headers, json=data) print(response.status_code)
print(response.json())
Modify your code
-
Replace
123456789
in the URL with the actual campaign ID you want to modify. -
Use your unique
WM_QOS.CORRELATION_ID
for each request. -
Use your unique
WM_SEC.ACCESS_TOKEN
obtained from the Token API. -
Optionally, you can update these parameters:
name
- Set this to a campaign name of your choice.startDate
- Enter your campaign start date in yyyy-MM-dd format.endDate
- Enter your campaign end date in yyyy-MM-dd format. If left blank, the endDate defaults to 9999-12-31 .totalBudget
- Specify the total amount allocated for the campaign.targetRoas
- Specify the specific Return on Ad Spend you aim to achieve.biddingStrategyType
: Change from TARGET_ROAS to MAXIMIZE_TRAFFIC and vice versaskus
:
ADD
operation: Add the SKUs you want to include in the campaign.
REMOVE
operation: Remove the SKUs you want to exclude from the campaign.
Sample response
{
"campaignId": "123456789"
}
Result
The specified campaign will be updated based on the details provided.
Next steps
Stop a campaign that is currently active.
Updated about 10 hours ago