Skip to main content

Collection Products

The Collection Products API is designed to retrieve a list of products belongs to a particular adset collection.

API Endpoint

Method: GET

URL: https://<PA_RM_END_POINT>/retail-media/addSetCollections/{collectionId}/collection-products

info

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

Request Header

NameValue
Content-Typeapplication/json
AuthorizationBearer ACCESS_TOKEN

Request Parameters

ParameterTypeDescription
collectionIdstringGet the collection ID from the Campaign AdSets API

Request Query Parameters

ParameterTypeDescription
pageintegerThe page number of the user list. Defaults to 1 if not specified.
limitintegerThe number of users to return per page. Defaults to 10 but can be set as needed up to a maximum of 100.

Response Payload

Success Response

  • Status Code: 200 OK
  • Payload: Returns list of products that belongs to a particular collection in JSON format
{
"products": [
{
"isBlacklisted": false,
"isBlocklisted": false,
"refId": "xxxxxxxxxxxxxxxxxxxxxxx",
"sku": "xxxxxxxxxxxxxxxxxxxxxxx",
"name": "Product Name",
"brand": "Brand Name",
"imageURL": [
"https://example.com/image.jpg"
],
"price": {
"amount": 22.99,
"currency": 36
},
"category": "Category > Subcategory"
},
// Additional products
],

"totalItems": 12,
"totalPages": 1,
"currentPage": 1,
"pageSize": 20,
"hasPreviousPage": false,
"hasNextPage": false
}

Response Parameters

ParameterTypeDescription
productsArray of ObjectArray of products in a collections.
totalItemsintegerTotal number of users available for the given organisation.
totalPagesintegerTotal number of pages available for the given organisation.
currentPageintegerCurrent page number for the list of users.
pageSizeintegerNumber of users returned per page.
hasPreviousPagebooleanIndicates if previous page is available.
hasNextPagebooleanIndicates if next page is available.

product Object

ParameterTypeDescription
refIdstringReference identifier used internally.
namestringName of the product.
skustringStock keeping unit for the product.
brandstringTBrand of the product.
imageURLArray of StringURLs of product images.
priceObjectContains amount and currency.
categorystringCategory hierarchy of the product.
  • isBlacklisted (boolean): Indicates whether the product is set to be NOT used for Ad by the Supplier.
info

This field indicates that the Supplier do not want to use this product for Ad. This is a Supplier level restriction.

  • isBlocklisted (boolean): Indicates whether the product is set to be NOT used for Ad by the Retailer.
info

This field indicates that the Retailer do not want to use this product for Ad. This is a Retailer level restriction.

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");

var urlencoded = new URLSearchParams();

var requestOptions = {
method: 'GET',
headers: myHeaders,
body: urlencoded,
redirect:'follow'
};

fetch("https://<PA_RM_END_POINT>/retail-media/addSetCollections/{collectionId}/collection-products?page=1&limit=100", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));