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
Name | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer ACCESS_TOKEN |
Request Parameters
Parameter | Type | Description |
---|---|---|
collectionId | string | Get the collection ID from the Campaign AdSets API |
Request Query Parameters
Parameter | Type | Description |
---|---|---|
page | integer | The page number of the user list. Defaults to 1 if not specified. |
limit | integer | The 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
Parameter | Type | Description |
---|---|---|
products | Array of Object | Array of products in a collections. |
totalItems | integer | Total number of users available for the given organisation. |
totalPages | integer | Total number of pages available for the given organisation. |
currentPage | integer | Current page number for the list of users. |
pageSize | integer | Number of users returned per page. |
hasPreviousPage | boolean | Indicates if previous page is available. |
hasNextPage | boolean | Indicates if next page is available. |
product Object
Parameter | Type | Description |
---|---|---|
refId | string | Reference identifier used internally. |
name | string | Name of the product. |
sku | string | Stock keeping unit for the product. |
brand | string | TBrand of the product. |
imageURL | Array of String | URLs of product images. |
price | Object | Contains amount and currency . |
category | string | Category 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));