You can use the Create Catalog API to add a catalog to Blueshift. You can also use the Add items to a catalog API to add items to an existing catalog.
Prerequisites
You must include your catalog data in a CSV file before you can import it. For information about data types, catalog attributes, and data formats, see Import catalog data.
Create Catalog API
You can create a new catalog by using the create catalog API end-point.
Inputs | “name”: Catalog name (string) |
Output | On successful create, returns the catalog’s unique identifier. |
Sample call
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"catalog" : {"name" : "ACME Item Catalog"}}' -u <USER API KEY>: https://api.getblueshift.com/api/v1/catalogs
Sample Response
{"catalog_uuid":"<CATALOG UUID>"}
Add Items to a catalog
You can add multiple items to a catalog in batches of 100 items at a time, by using the add items to catalog API end-point.
Inputs |
|
Output | On success, returns “ok”. |
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -u <USER API KEY>: https://api.getblueshift.com/api/v1/catalogs/<CATALOG UUID>.json -d '
{
"catalog": {
"products": [
{
"brand": "Nike",
"category": [
"Home",
"Home > Shoes",
"Home > Shoes > Running"
],
"image": "http://server/path/image.jpg",
"msrp": "47",
"price": "37.99",
"product_id": "189909",
"availability": "in stock",
"tags": [
"running",
"athlete"
],
"title": "Nike Jordan Running Shoes in Blue",
"web_link": "http://server/path/product.html".
"latitude": "37.792805",
"longitude": "-122.401444",
"location_tag": "Points of Interest > USA > California > San Francisco > San Francisco Downtown"
},
{
"brand": "Reebok",
"category": [
"Home",
"Home > Shoes",
"Home > Shoes > Sports"
],
"image": "http://server/path/image2.jpg",
"msrp": "47",
"price": "37.99",
"product_id": "189910",
"availability": "in stock",
"tags": [
"basketball"
],
"title": "Reebok Basketball Shoes",
"web_link": "http://server/path/product2.html"
}
]
}
}'
Comments
0 comments