Update Existing Campaigns
URL: PUT /api/v1/campaigns
Note:
- This API supports batch operations with a max batch size of 10. For bulk operation, the advertiserId must be the same across all requests in the payload.
- PUT API requests will overwrite all current values and are not intended to be used as incremental updates like PATCH operations
- You must set all of
budgetType,dailyBudget,totalBudget,startDate,endDate, anddeliverySpeedparameters at same level, i.e. either at campaign level or ad group level. mediaTypefield cannot be modified after creating a campaign.mediaTypeis ignored when included in the request payload.
Request Parameters
| Parameters | Notes | Type | Required | Possible Values |
|---|---|---|---|---|
| campaignId | ID of the campaign | integer | Y | Valid campaign ID |
| advertiserId | ID of advertiser | integer | Y | Valid advertiser ID |
| name | The name of the campaign Note: Limit on length of campaign name is 240 characters_ | string | Y | The campaign name should be unique |
| description | Campaign description Note: Limit on length of campaign description is 240 characters_ | string | N | Provide valid description corresponding to campaign type |
| objective | Specifies the campaign objective. Note: You can update objective only if the campaign has never gone live | string | N | Values: If the objective is not specified in the request payload, the existing value of the objective will be retained. |
| campaignType | The type of the campaign Note:
| string | N | Values of campaignType: ngd |
| startDate | The date to start campaign it must be set either at campaign or ad group level. | date | Conditional. This field is required only if it is not set at ad group level. Cannot be changed to ad group level later | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX Note:
Kindly take these behaviors into consideration when assigning a value to startDate in your request. |
| endDate | The date when campaign ends Note: it must be set either at campaign or ad group level_ | date | Conditional. This field is required only if it is not set at ad group level. Cannot be changed to ad group level later | Date should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX To run campaign indefinitely, set its value as ‘9999-12-30T00:00:00Z’ Note:
Kindly take these behaviors into consideration when assigning a value to startDate in your request. |
| budgetType | The type of budget allocation you want to choose for your campaign Note:
| string | Conditional. This field is required only if it is not set at ad group level. Cannot be changed to ad group level later | Values:
|
| dailyBudget | Daily budget of campaign Note:
| double | Conditional. This field is required only if:
| The value of daily budget should at least be $0.01 Note:This field is required only if budgetType is set to be dailyBudget |
| totalBudget | Total budget of campaign Note: it must be set either at campaign or ad group level | double | Conditional. This field is required only if: -budgetType is set to be total | The value of total budget should at least be $0.01 Note: This field is required only if budgetType is set to be totalBudget |
| deliverySpeed | Determines pacing of ad delivery it must be set either at campaign or ad group level | string | Conditional. This field is required only if it is not set at ad group level. Cannot be changed to ad group level later | Values:
|
Rules
- You must set all of budgetType, dailyBudget, totalBudget, startDate, endDate, and deliverySpeed parameters at same level i.e. either at campaign level or ad group level, not both
- You cannot change the level at which budgetType, dailyBudget, totalBudget, startDate, endDate, and deliverySpeed are set i.e. if these are set at campaign level while creating the campaign, it cannot be changed to ad group later and vice versa.
- You can only set either dailyBudget or totalBudget
- To set daily budget, you must choose value of budgetType as “daily” and then define dailyBudget.
- To set total budget, you must choose value of budgetType as “total” and then define totalBudget.
- mediaType field cannot be modified after a campaign is created. mediaType, if included in the request payload, is ignored and will not be modified.
- Campaigns created to run definitely can be updated later to include an end date
Updatable Fields for Campaign Metadata
You can use PUT /api/v1/campaigns to update the fields in the following table:
| API Field Name | Display Label in Matrix | Draft | Scheduled | Live | Paused | Complete | Archived | Notes |
|---|---|---|---|---|---|---|---|---|
| name | Campaign Name | ✅ | ✅ | ✅ | ✅ | ⚠️ | ❌ | |
| description | Campaign Description | ✅ | ✅ | ✅ | ✅ | ⚠️ | ❌ | ⚠️ Extend endDate to edit if Complete |
| objective | Campaign Objectiv | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | |
| startDate | Campaign Start Date | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | — |
| endDate | Campaign End Date | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | |
| budgetType | Campaign Budget Type | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | — |
| deliverySpeed | Delivery Speed | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | frontloaded pacing not supported if budgetType is daily |
| dailyBudget, totalBudget | Campaign Budget (Daily & Total) | ✅ | ✅ | ✅ | ✅ | ⚠️ | ❌ |
|
| creationDate, lastUpdatedDate | — | — | — | — | — | — | — | Metadata only. Immutable |
| campaignType | Campaign Type | — | — | — | — | — | — | Immutable |
| status | status | — | — | — | — | — | — | Used to determine allowed operations |
| attributesSetOnAdGroupLevel | — | — | — | — | — | — | — | — |
Sample Request
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <auth_token>' \ --header 'WM_SEC.AUTH_SIGNATURE: **************' \ --header 'WM_SEC.KEY_VERSION: 1' \ --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \ --header 'WM_CONSUMER.INTIMESTAMP: 1565309779' \ --data '[ { "campaignId": 1, "advertiserId": 1, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z", "endDate": "2023-12-25T12:00:00Z", "budgetType": "daily", "dailyBudget": 1.0, "deliverySpeed": "evenly" } ]'
Sample Request (Batch Operation)
curl -X PUT \ 'https://developer.api.us.stg.walmart.com/api-proxy/service/display/api/v1/api/v1/campaigns' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <auth_token>' \ --header 'WM_SEC.AUTH_SIGNATURE: **************' \ --header 'WM_SEC.KEY_VERSION: 1' \ --header 'WM_CONSUMER.ID: adfwe-v23-faasd2r-afs-asdfqeff' \ --header 'WM_CONSUMER.INTIMESTAMP: 1565309779' \ --data '[ { "campaignId": 12345, "advertiserId": 10000, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z", "endDate": "2023-12-25T12:00:00Z", "budgetType": "total", "totalBudget": 10.0, "deliverySpeed": "evenly" }, { "campaignId": 23456, "advertiserId": 10000, "name": "string", "description": "string", "objective": "awareness", "campaignType": "ngd", "startDate": "2023-12-05T12:00:00Z", "endDate": "2023-12-25T12:00:00Z", "budgetType": "total", "totalBudget": 10.0, "deliverySpeed": "frontloaded" } ]'
Response
| Element | Description | Type |
|---|---|---|
| code | The response code can have following values:
Click here for more information about Status Codes and Errors | string |
| details | Details will populate success or error message depending upon value of code | string |
| campaignId | ID of the campaign | integer |
Sample Response
[ { "code": "success", "details": ["string"], "campaignId": 1 } ]
Sample Response (Batch Operation)
[
{ "code": "success", "details": ["string"], "campaignId": 1
}, { "code": "failure", "details": ["stringA", "stringB"], "campaignId": 2 }
]
Updated 1 day ago
