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

Note:

  • This API supports batch operations with a max batch size of 10. For bulk operation, the advertiser Id must be the same across all requests in the payload.
  • 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

Request Parameters

ParametersNotesTypeRequiredPossible Values
advertiserIdID of advertiser whose campaign is to be scheduledintegerYAdvertiser ID for which the campaign is to be created
nameThe name of the campaign
Note: Limit on length of campaign name is 240 characters
integerYThe campaign name should be unique
descriptionCampaign description
Note: Limit on length of campaign description is 240 characters
stringNProvide valid description corresponding to campaign type
objectiveCampaign objectivestringNValues:
• awareness
• engagement
• conversion
Note: Default value for objective will be awareness, unless specified
campaignTypeThe type of the campaignstringNValues of campaignType: ngd
startDateThe date to start campaign
Note: it must be set either at campaign or ad group level
dateThis field is required only if it is not set at ad group levelDate should be in format: yyyy-MM-dd'T'HH:mm:ss.SSSXXX

Note: date values are internally converted to EST timezone
The date when campaign ends
Note: it must be set either at campaign or ad group level
dateThis field is required only if it is not set at ad group levelDate 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: date values are internally converted to EST
budgetTypeThe type of budget allocation you want to choose for your campaign

Note: it must be set either at campaign or ad group level
stringThis field is required only if it is not set at ad group levelValues:

- daily
- total
dailyBudgetDaily budget of campaign
Note:
• Daily budget cannot exceed your total budget amount
• Up to 20% of the unspent budget will be rolled over to the next day
• it must be set either at campaign or ad group level
doubleThis field is required only if:
-It is not
set at ad group level

-budgetType is set to be daily
The value of daily budget should at least be $0.01
Note: This field is required only if budgetType is set to be dailyBudget
totalBudgetTotal budget of campaign
Note: it must be set either at campaign or ad group level
doubleThis field is required only if:
-It is not
set at ad group level

-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
deliverySpeedDetermines pacing of ad delivery
Note: it must be set either at campaign or ad group level
This field is required only if it is not set at ad group levelValues:
• frontloaded
• evenly
Note: frontloaded pacing is not supported if budgetType is daily

Note:
• 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.
• Budget, Schedule and Delivery speed must be set either at campaign or ad group level
• 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

Headers

Header NameDescriptionRequiredValues
AuthorizationThe token will provide you the access to the API. It is same for all advertisers you access through the APIYPlease utilize the generated auth_token shared with you at the time of partner onboarding from the Getting Started Guide. This key can be repurposed for SP API access as well.
WM_CONSUMER.IDWe will provide you the consumer ID to access the API. It is same for all advertisers you access through the API.YPlease use the generated ConsumerId shared with you at the time of partner onboarding. Refer to the Getting Started Guide for further explanation on this
WM_SEC.AUTH_SIGNATUREAuth signature as an API keyYUse the signature generator code from Getting Started Guide to generate this value
WM_CONSUMER.intimestampTimestamp for which the auth signature is generated. Use Unix epoch format for the timestampYUse the signature generator code (Getting Started Guide) to generate this value
WM_SEC.KEY_VERSIONWe will provide you with the KEY VERSION to access the API. It is same for all advertisers you access through the APIY1

Sample Request

curl -X POST \ '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 '[ { "advertiserId": 1, "name": "string", "description": "string", "objective": "string", "campaignType": "ngd", "startDate": "string", "endDate": "string", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" } ]' 

Sample Request (Batch Operation)

curl -X POST \ '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 ' [ { "advertiserId": 1, "name": "string", "description": "string", "objective": "string", "campaignType": "ngd", "startDate": "string", "endDate": "string", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" }, { "advertiserId": 1, "name": "string", "description": "string", "objective": "string", "campaignType": "ngd", "startDate": "string", "endDate": "string", "budgetType": "string", "dailyBudget": 0.0, "totalBudget": 0.0, "deliverySpeed": "string" }
]'

Response

ElementDescriptionType
codeThe response code can have following values:
• success
• failure
string
detailsDetails will populate success or error message depending upon value of codestring
campaignIdID of the campaign. This will be returned only when code=successinteger
nameName of the campaignstring

Sample Response

[ { "code": "success", "details": ["string"], "name": "string1", "campaignId": 1 } ] 

Sample Response (Batch Operation)

[ { "code": "success", "details": ["string"], "name": "string1", "campaignId": 1 }, { "code": "failure", "details": ["stringA", "stringB"], "name": "string1" } ]