Skip to main content

Campaign Budget Update

The Campaign Budget Update API enables users to modify a campaign's budget as needed, ensuring greater flexibility in financial planning and campaign management.

warning

It is important to handle campaign data securely and ensure that access is restricted to authorized users only.

API Endpoint

Method: POST

URL: https://<PA_RM_END_POINT>/retail-media/campaigns/{campaignId}/update-budget

info

Please refer to the Supplier API documentation for detailed instructions on how to retrieve the supplierId.

Request Header

NameValue
Content-Typeapplication/json
AuthorizationBearer ACCESS_TOKEN

Request Parameters

ParameterTypeDescription
supplierIdstringGet the supplier ID from the supplier API
campaignIdGUIDId of the campaign

Example Request Payload

{
"totalBudget": 1536,
"dailyCap": 10
}
ParameterTypeRequiredDescription
totalBudgetdecimalTotal budget for this campaign.
dailyCapdecimalDaily Usage Limit:
If a daily cap is not set or is set to zero (0), the system will treat it as unlimited usage for the day.
IMPORTANT:

If daily cap provide than it should be greater than zero(0) and less than total budget.

Response Payload

Success Response

  • Status Code: 200 OK
  • Payload: Returns the created campaign information in JSON format
{
"status": "success",
"message": "Campaign budget updated successfully",
"campaignId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Error Response

If an error occurs, the API will return an appropriate status code along with an error message.

  • Sample Error Response (400 Bad Request):
{
"errors": [
"Error message 1",
"Error message 2"
],
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
"title": "One or more validation errors occurred.",
"status": 400,
"traceId": "xxxxxxxxxxxxxxxxxxx"
}

Example Usage (JavaScript)

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "BEARER YOUR_ACCESS_TOKEN");

const body = JSON.stringify(
{
"totalBudget": 1536,
"dailyCap": 10
}
)

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: body
};

fetch("https://<PA_RM_END_POINT>/retail-media/campaigns/{campaignId}/update-budget", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));