Create a new Product Collection for a specific account
http
POST https://services.leadconnectorhq.com/products/collectionsAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
altId | string | Yes | 6578278e879ad2646715ba9c | Account Id |
altType | string | Yes | LOCATION | The type of alt. For now it is only LOCATION Possible values: 'account' |
collectionId | string | No | 66057f9d28536eae584ec047 | Unique Identifier of the Product Collection, Mongo Id |
name | string | Yes | Best Sellers | Name of the Product Collection |
slug | string | Yes | best-sellers | Slug of the Product Collection which helps in navigation |
image | string | No | http://example.com/watermark.png | The URL of the image that is going to be displayed as the collection Thumbnail |
seo | object | No | The metadata information which will be displayed in SEO previews |
Responses
201 - Successful response
data(object, required): created Collection
json
{}400 - Bad Request
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/products/collections' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"altId": "6578278e879ad2646715ba9c",
"altType": "LOCATION",
"collectionId": "66057f9d28536eae584ec047",
"name": "Best Sellers",
"slug": "best-sellers",
"image": "http://example.com/watermark.png"
}'const response = await fetch('https://services.leadconnectorhq.com/products/collections', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"altId": "6578278e879ad2646715ba9c", "altType": "LOCATION", "collectionId": "66057f9d28536eae584ec047", "name": "Best Sellers", "slug": "best-sellers", "image": "http://example.com/watermark.png"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/products/collections',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"altId": "6578278e879ad2646715ba9c", "altType": "LOCATION", "collectionId": "66057f9d28536eae584ec047", "name": "Best Sellers", "slug": "best-sellers", "image": "http://example.com/watermark.png"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/products/collections');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'altId': '6578278e879ad2646715ba9c', 'altType': 'LOCATION', 'collectionId': '66057f9d28536eae584ec047', 'name': 'Best Sellers', 'slug': 'best-sellers', 'image': 'http://example.com/watermark.png'}),
]);
$data = json_decode(curl_exec($ch), true);