Create new campaign
Create a new campaign using this method. Successfully created campaigns will be assigned a unique campaign ID.
URL: POST/api/v1/campaigns
Query Parameters
Parameter | Notes | Type | Required | Possible Values |
---|---|---|---|---|
name | The name of the campaign | string | Y | The campaign name should be unique. |
campaignType | The type of the campaign | string | Y | Values of campaignType:
Note: Define campaign type as “sba” for setting up Sponsored Brands campaigns
|
targetingType | The targeting type of the campaign is set of options to create campaigns with different bidding types. | string | Y | Possible values:
|
status | Specified status of campaign | string | Y | Possible values:
|
startDate | The date to start campaign | date | Y | Date should be in format: yyyy-mm-dd |
endDate | The date when campaign ends. | date | Y | To run campaign indefinitely, set value to: 9999-12-30 |
totalBudget | Total budget of campaign | double | Note: This field is only required if budgetType is set to total |
|
dailyBudget | Daily budget of campaign Note:
| double | Y Note: This field is required only if budgetType is set to daily |
|
budgetType | The type of budget allocation you want to choose for your campaign. | string | Y | Possible values:
|
rollover | The indicator to suggest if the unspent daily budget from the previous day should be carried forward to next day’s daily budget | boolean | Y | Currently rollover only accepts “true” as a value. However, in the future it may be updated to accept “false” as well. |
biddingStrategy | A json object to store the bidding strategy. This stores bidding strategy through the field: strategy | json | N | Possible values:
|
campaignOptions | List of campaign setting options while creating a campaign. Campaign setting options:
Notes:
| array | N | Values of campaign options:
|
advertiserId | ID of advertiser whose campaign is to be scheduled | integer | Y | Advertiser ID for which the campaign is to be created |
Note:
- It’s not mandatory to define both totalBudget and dailyBudget parameters together. However, one of these must be defined.
- To set daily budget, you must choose value of budgetType as “daily” and then define dailyBudget. Define rollover as true to get remainder of daily budget from previous day to be carried forward to next day
- Maximum budget spent on a given day will be limited to twice of the set dailyBudget amount
- Currently rollover only accepts “true” as a value. However, in future it may be updated to accept “false” as well.
- To set total budget, you must choose value of budgetType as “total” and then define totalBudget.
- There will be no control on pacing and the budget will be used as soon as possible
- To set both total and daily budget, you must choose value of budgetType as “both” and then define totalBudget and dailyBudget. Define rollover as “true”.
Headers
Header Name | Description | Required | Values |
---|---|---|---|
Authorization | The token will provide you the access to the API. It is same for all advertisers you access through the API. | Y | Please utilize the generated auth_token shared with you at the time of partner onboarding from the Getting Started Guide |
WM_CONSUMER.ID | We will provide you the consumer ID to access the API. It is same for all advertisers you access through the API. | Y | Please use the generated ConsumerId shared with you at the time of partner onboarding. Refer to the Getting Started Guide for more information |
WM_SEC.AUTH_SIGNATURE | Auth signature as an API key. | Y | Use the signature generator code from Getting Started Guide to generate this value |
WM_SEC.KEY_VERSION | We will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the API. | Y | 1 |
WM_CONSUMER.intimestamp | Timestamp for which the auth signature is generated. Use Unix epoch format for the timestamp. | Y | Use the signature generator code from Getting Started Guide to generate this value |
Sample Request 1 – Opt in to CPT and BTT (empty campaignOptions), T-ROAS biddingStrategy
curl -X POST \ 'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/campaign' \ --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' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --data ‘[ { "advertiserId": 16274575, "name": "Campaign3", "campaignType": "sponsoredProducts", "targetingType": "auto", "status": "enabled", "startDate": "2024-07-18", "endDate": "2024-08-03", "totalBudget": 4000, "dailyBudget": 500, "budgetType" : "both", "rollover" : true, "biddingStrategy": { "strategy": "TROAS", “troas”: 200.00 }, "campaignOptions": [] } ]’
Sample Request 2 – Opt in to CPT and BTT (no campaignOptions field), T-ROAS biddingStrategy
curl -X POST \ 'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/campaign' \ --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' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --data ‘[ { "advertiserId": 16274575, "name": "Campaign3", "campaignType": "sponsoredProducts", "targetingType": "auto", "status": "enabled", "startDate": "2024-07-18", "endDate": "2024-08-03", "totalBudget": 4000, "dailyBudget": 500, "budgetType" : "both", "rollover" : true, "biddingStrategy": { "strategy": "TROAS", “troas”: 200.00 }, } ]’
Sample Request 3 – Opt out of CPT and BTT with Dynamic biddingStrategy
curl -X POST \ 'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/campaign' \ --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' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --data ‘[ { "advertiserId": 16274575, "name": "Campaign3", "campaignType": "sponsoredProducts", "targetingType": "auto", "status": "enabled", "startDate": "2024-07-18", "endDate": "2024-08-03", "totalBudget": 4000, "dailyBudget": 500, "budgetType" : "both", "rollover" : true, "biddingStrategy": { “strategy”: “DYNAMIC” }, "campaignOptions": ["COMPLEMENTARY_OPT_OUT, BRAND_TERM_OPT_OUT"] } ]’
Sample Request 4 – Opt in CPT, Opt out BTT, T-ROAS biddingStrategy
curl -X POST \ 'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/campaign' \ --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' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --data ‘[ { "advertiserId": 16274575, "name": "Campaign3", "campaignType": "sponsoredProducts", "targetingType": "auto", "status": "enabled", "startDate": "2024-07-18", "endDate": "2024-08-03", "totalBudget": 4000, "dailyBudget": 500, "budgetType" : "both", "rollover" : true, "biddingStrategy": { "strategy": "TROAS", “troas”: 200.00 }, "campaignOptions": ["BRAND_TERM_OPT_OUT"] } ]’
Sample Request 5 – Opt out CPT, Opt in BTT, T-ROAS biddingStrategy
curl -X POST \ 'https://developer.api.stg.walmart.com/api-proxy/service/WPA/Api/v1/api/v1/campaign' \ --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' \ --header 'Content-Type: application/json' \ --header 'accept: application/json' \ --data ‘[ { "advertiserId": 16274575, "name": "Campaign3", "campaignType": "sponsoredProducts", "targetingType": "auto", "status": "enabled", "startDate": "2024-07-18", "endDate": "2024-08-03", "totalBudget": 4000, "dailyBudget": 500, "budgetType" : "both", "rollover" : true, "biddingStrategy": { "strategy": "TROAS", “troas”: 200.00 }, "campaignOptions": ["COMPLEMENTARY_OPT_OUT"] } ]’
Response
Element | Description | Type |
---|---|---|
code | The response code can have following values:
| string |
details | Details of the error if response code value is ‘failure’ | string |
campaignId | ID of the campaign | integer |
Sample Response 1
{ "code": "success", "details": "", "campaignId": 50001 "campaignOptions": [] }
Sample Response 2
{ "code": "success", "details": "", "campaignId": 50002 "campaignOptions": [] }
Sample Response 3
{ "code": "success", "details": "", "campaignId": 50003 "campaignOptions": ["COMPLEMENTARY_OPT_OUT, BRAND_TERM_OPT_OUT"] }
Sample Response 4
{ "code": "success", "details": "", "campaignId": 50004 "campaignOptions": ["COMPLEMENTARY_OPT_OUT"] }
Sample Response 5
{ "code": "failure", "details": "error message", "campaignId": 0 }
Campaign Status Flow Diagram
Note: SB stands for Sponsored Brands campaign
Updated 12 days ago