This endpoint is available in the Experimental version of the Retail Media API only.
Experimental endpoints may change without prior notice. See the versioning policy for details.
Overview
A campaign groups line items that share attribution settings, flight dates and budget.campaignType is a required discriminator. The fields are the same for both types. Some accept type-specific values.
An objective the campaign type does not accept returns
invalid-objective-campaign-type.
Prerequisites
Before calling these endpoints, ensure the following are in place:- Authentication: a valid access token. See Authentication.
- App permissions: the
RetailMedia_Campaign_Managescope to create and update, andRetailMedia_Campaign_Readto fetch and search. See App Scopes.
Endpoints
Create a Campaign
Path Parameters
Request Attributes
All attributes below are nested underdata.attributes. The resource type is CampaignCreateModel.
An unknown or inaccessible balance in
drawableBalanceIds fails the request and no campaign is kept.
Sample Request
Response Attributes
The response is aCampaignResponseModel. See Get a Campaign for the attributes.
The budget is the stored one: spent is 0 and remaining equals amount.
Sample Response - 201 Created
Get a Campaign
Path Parameters
Response Attributes
All attributes below are nested underdata.attributes.
Sample Request
200 OK
Update a Campaign
PATCH is partial: include only the fields you want to change. Omitted fields are left unchanged. A request without fields succeeds and returns the campaign as stored.Path Parameters
Request Attributes
All attributes below are nested underdata.attributes. The resource type is CampaignUpdateModel.
campaignType, buyType, objective, regulatedCategory, billByRetailerId and drawableBalanceIds are set only on creation and are ignored here.
budgetDetails and scheduleDetails sent as null leave the stored values unchanged.
An archived campaign cannot be updated.
Sample Request
Response Attributes
The response is aCampaignModel. It has the attributes of Get a Campaign, without drawableBalanceIds.
Sample Response - 200 OK
Search Campaigns
All filters are optional. Values within a filter are ORed. Distinct filters are ANDed.Path Parameters
Request Attributes
All attributes below are nested underdata.attributes. The resource type is CampaignSearchModel.
Sample Request
Response Attributes
data is an array of CampaignResponseModel. See Get a Campaign for the attributes.
Sample Response -
200 OK
Known Limitations
- Search
budgetDetailscomes from a search index and lag a campaign that has just changed. Fetch the campaign for current figures. drawableBalanceIdsis always empty in search results.- The update response does not include
drawableBalanceIds.