API reference
Catalog API
Read and manage the products, variants, images and collections in your Shopflo catalog.
Available Brands and agencies
Use the Catalog API to read your catalog and, for stores on platforms other than Shopify, to keep it up to date. A product has variants and images. Collections group products.
Calls are made from your server with a channel API key. The key identifies your store, so no merchant id appears in the paths.
Lists use page, which starts at 1, and limit, which is at most 50. Bulk requests take at most 50 ids or items. Partners searching across brands use the Commerce Partner API.
Base URL: https://api.shopflo.co
Authentication: Merchant API key
A channel API key from your Shopflo dashboard, sent as the whole value of the Authorization header.
Shopify stores
If your store runs on Shopify, Shopflo keeps its catalog in sync with Shopify, so product, variant and collection changes made here are overwritten by the next sync. Use these write endpoints for stores on other platforms.
Endpoints
Products
Look up a product
/ce/api/v1/external/product
Returns one product from your catalog, with its variants and images. Find it by handle, variant id or product id.
Query parameters
- product_handlestringOptional
The product handle. Shopflo stores the handle in
description, so this matches thedescriptionof the product. - variant_idstringOptional
The id of any variant of the product.
- product_idstringOptional
The product id.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Send at least one of the three query parameters. If you send more than one, product_id is used first, then variant_id, then product_handle.
Deleted products are not returned. Responses can be cached, so a recent change in your store may not show immediately.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | None of product_handle, variant_id and product_id was sent. The message is At least one of product_handle, variant_id, or product_id must be provided. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product matches. The message is Product not found, or Product not found with productId followed by the ids when you sent product_id and it does not exist. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/product?product_handle=linen-shirt");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product retrieved successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}List products
/ce/api/v1/external/catalog/products
Returns a page of your products.
Query parameters
- pageintegerOptional
Page number, starting at 1 and at most 1000000. Defaults to 1.
- limitintegerOptional
Page size, 1 to 50. Defaults to 10.
- name_likestringOptional
Only products whose name contains this text.
- sku_likestringOptional
Only products with a variant whose SKU contains this text.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an array of products. Bundle products are never included. Beside data, the response carries current_page (the page you asked for), page_size, max_pages and total_count.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | page is below 1 or above 1000000, or limit is outside 1 to 50. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products?page=1&limit=10&name_like=shirt");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Products fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000
}
],
"current_page": 1,
"page_size": 10,
"max_pages": 1,
"total_count": 1
}Get products in bulk
/ce/api/v1/external/catalog/products/bulk-get
Returns several products in one call, each with its variants and images. Send 1 to 50 product ids.
Request body
- product_idsarray of stringRequired
The products to fetch. 1 to 50 ids, none blank.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
data is an array of the products that exist, each with variants and images. Ids that do not exist are left out. Collections are not included.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | product_ids is empty, has more than 50 ids, or has a blank id. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_ids": ["prod_123", "prod_124"]
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_ids: ["prod_123", "prod_124"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_ids": ["prod_123", "prod_124"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_ids": ["prod_123", "prod_124"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_ids": ["prod_123", "prod_124"]
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/bulk-get");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_ids' => ['prod_123', 'prod_124']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Products fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
]
}Get a product
/ce/api/v1/external/catalog/products/{product_id}
Returns one product by its id.
Path parameters
- product_idstringRequired
The product.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product fetched successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000
}
}Create a product
/ce/api/v1/external/catalog/products
Creates a product in your catalog. Add its variants and images with the endpoints below.
Request body
- product_idstringRequired
An id you choose. It must not be blank and must be unique in your catalog.
- namestringOptional
Product name.
- descriptionstringOptional
Product description. For Shopify stores this field holds the handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. Defaults toACTIVEwhen you leave it out. - tagsarray of stringOptional
Labels.
- vendorstringOptional
Vendor.
- collection_idsarray of stringOptional
Collections to put the product in. Each must already exist.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Without a status the product is created as ACTIVE. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | product_id is missing or blank. The message is product_id is required. |
400 | CEE_001 | An item with this id already exists in your catalog. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_id": "prod_123",
"name": "Linen Shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_id: "prod_123",
name: "Linen Shirt",
product_type: "Shirts",
status: "ACTIVE",
tags: ["linen", "summer"],
vendor: "Example Brand"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_id": "prod_123",
"name": "Linen Shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_id": "prod_123",
"name": "Linen Shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_id": "prod_123",
"name": "Linen Shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand"
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_id' => 'prod_123',
'name' => 'Linen Shirt',
'product_type' => 'Shirts',
'status' => 'ACTIVE',
'tags' => ['linen', 'summer'],
'vendor' => 'Example Brand'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product created successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000
}
}Update a product
/ce/api/v1/external/catalog/products/{product_id}
Changes a product. Fields you leave out keep their stored value. To clear all tags, send tags as an empty array.
Path parameters
- product_idstringRequired
The product.
Request body
- namestringOptional
Product name. Ignored when empty.
- descriptionstringOptional
Product description. Ignored when empty.
- product_typestringOptional
Product type. Keeps its value when you leave it out.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringOptional
Labels. Keeps its value when you leave it out. An empty array clears all tags.
- vendorstringOptional
Vendor. Ignored when empty.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
The response includes the product's variants and images. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The body has no fields. The message is Product update request is empty. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Linen Shirt",
"product_type": "Shirts",
"tags": ["linen", "summer"],
"status": "ACTIVE"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Linen Shirt",
product_type: "Shirts",
tags: ["linen", "summer"],
status: "ACTIVE"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "Linen Shirt",
"product_type": "Shirts",
"tags": ["linen", "summer"],
"status": "ACTIVE"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "Linen Shirt",
"product_type": "Shirts",
"tags": ["linen", "summer"],
"status": "ACTIVE"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "Linen Shirt",
"product_type": "Shirts",
"tags": ["linen", "summer"],
"status": "ACTIVE"
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Linen Shirt',
'product_type' => 'Shirts',
'tags' => ['linen', 'summer'],
'status' => 'ACTIVE'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000
}
}Delete a product
/ce/api/v1/external/catalog/products/{product_id}
Deletes a product and returns it as it was. This cannot be undone.
Path parameters
- product_idstringRequired
The product.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product removed successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000
}
}Variants
List variants of a product
/ce/api/v1/external/catalog/products/{product_id}/variants
Returns a page of a product's variants, oldest first. A product that is not yours answers 404.
Path parameters
- product_idstringRequired
The product.
Query parameters
- pageintegerOptional
Page number, starting at 1 and at most 1000000. Defaults to 1.
- limitintegerOptional
Page size, 1 to 50. Defaults to 10.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
data is an array of variants. Prices in responses are in whole currency units with decimals. Beside data, the response carries current_page (the page you asked for), page_size, max_pages and total_count.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | page is below 1 or above 1000000, or limit is outside 1 to 50. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants?page=1&limit=10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variants fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"current_page": 1,
"page_size": 10,
"max_pages": 1,
"total_count": 1
}Get a variant
/ce/api/v1/external/catalog/products/{product_id}/variants/{variant_id}
Returns one variant of a product.
Path parameters
- product_idstringRequired
The product.
- variant_idstringRequired
The variant.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The variant is not yours, or has no product. The message is Variant with id followed by the variant id, then does not exist for product and the product id. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant fetched successfully",
"data": {
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
}Create a variant
/ce/api/v1/external/catalog/products/{product_id}/variants
Adds a variant to a product. Send prices in the smallest currency unit. Responses show them in whole currency units.
Path parameters
- product_idstringRequired
The product.
Request body
- variant_idstringRequired
An id you choose. It must not be blank and must be unique in your catalog.
- namestringOptional
Variant name, for example a size.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_priceintegerOptional
Original price in the smallest currency unit, for example paise. 199900 is 1999.00.
- current_priceintegerOptional
Current price in the smallest currency unit.
- currencystringRequired
INRorUSD. - inventory_quantityintegerOptional
Units in stock.
- positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ. - inventory_policystringOptional
DENYorCONTINUE. - inventory_managementstringOptional
Who tracks inventory. Leave it out when nobody does.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
A product that is not yours, or does not exist, answers 404 before anything is written. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | variant_id is missing or blank. The message is variant_id is required. |
400 | CEE_001 | An item with this id already exists in your catalog. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
variant_id: "var_456",
name: "S",
sku: "LS-S",
original_price: 199900,
current_price: 149900,
currency: "INR",
inventory_quantity: 12,
position: 1,
requires_shipping: true,
taxable: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": True,
"taxable": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'variant_id' => 'var_456',
'name' => 'S',
'sku' => 'LS-S',
'original_price' => 199900,
'current_price' => 149900,
'currency' => 'INR',
'inventory_quantity' => 12,
'position' => 1,
'requires_shipping' => true,
'taxable' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant created successfully",
"data": {
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
}Create variants in bulk
/ce/api/v1/external/catalog/products/{product_id}/variants/bulk
Adds several variants to a product. Send 1 to 50 items. A variant whose variant_id already exists is skipped.
Path parameters
- product_idstringRequired
The product.
Request body
- (array)arrayRequired
One object per variant. 1 to 50 items, each with a
variant_id.- variant_idstringRequired
An id you choose. It must not be blank and must be unique in your catalog.
- namestringOptional
Variant name, for example a size.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_priceintegerOptional
Original price in the smallest currency unit, for example paise. 199900 is 1999.00.
- current_priceintegerOptional
Current price in the smallest currency unit.
- currencystringRequired
INRorUSD. - inventory_quantityintegerOptional
Units in stock.
- positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ. - inventory_policystringOptional
DENYorCONTINUE. - inventory_managementstringOptional
Who tracks inventory. Leave it out when nobody does.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
The request body is a bare JSON array. data lists the variants that were created. Variants that already existed are not in the list.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The list is empty or has more than 50 items, or an item is not valid. |
400 | GE_001 | variant_id is missing or blank. The message is variant_id is required. |
400 | GE_001 | Two items have the same variant_id. The message is variant_id must not contain duplicates. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '[
{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
},
{
"variant_id": "var_457",
"name": "M",
"sku": "LS-M",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 2,
"requires_shipping": true,
"taxable": true
}
]'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify([
{
variant_id: "var_456",
name: "S",
sku: "LS-S",
original_price: 199900,
current_price: 149900,
currency: "INR",
inventory_quantity: 12,
position: 1,
requires_shipping: true,
taxable: true
},
{
variant_id: "var_457",
name: "M",
sku: "LS-M",
original_price: 199900,
current_price: 149900,
currency: "INR",
inventory_quantity: 12,
position: 2,
requires_shipping: true,
taxable: true
}
]),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json=[
{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": True,
"taxable": True
},
{
"variant_id": "var_457",
"name": "M",
"sku": "LS-M",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 2,
"requires_shipping": True,
"taxable": True
}
],
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
[
{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
},
{
"variant_id": "var_457",
"name": "M",
"sku": "LS-M",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 2,
"requires_shipping": true,
"taxable": true
}
]
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`[
{
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true
},
{
"variant_id": "var_457",
"name": "M",
"sku": "LS-M",
"original_price": 199900,
"current_price": 149900,
"currency": "INR",
"inventory_quantity": 12,
"position": 2,
"requires_shipping": true,
"taxable": true
}
]`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/bulk");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
[
'variant_id' => 'var_456',
'name' => 'S',
'sku' => 'LS-S',
'original_price' => 199900,
'current_price' => 149900,
'currency' => 'INR',
'inventory_quantity' => 12,
'position' => 1,
'requires_shipping' => true,
'taxable' => true
],
[
'variant_id' => 'var_457',
'name' => 'M',
'sku' => 'LS-M',
'original_price' => 199900,
'current_price' => 149900,
'currency' => 'INR',
'inventory_quantity' => 12,
'position' => 2,
'requires_shipping' => true,
'taxable' => true
]
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variants created successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
]
}Update a variant
/ce/api/v1/external/catalog/products/{product_id}/variants/{variant_id}
Changes a variant. Fields you leave out keep their stored value.
Path parameters
- product_idstringRequired
The product.
- variant_idstringRequired
The variant.
Request body
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_priceintegerOptional
Original price in the smallest currency unit. Keeps its value when you leave it out.
- current_priceintegerOptional
Current price in the smallest currency unit.
- currencystringOptional
INRorUSD. - inventory_quantityintegerOptional
Units in stock.
- positionintegerOptional
Position among the product's variants.
- taxablebooleanOptional
Whether the variant is taxable.
- inventory_policystringOptional
DENYorCONTINUE.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
A variant or product that is not yours, or does not exist, answers 404 before anything is written. Weight, shipping and inventory tracking fields are not changed by this call. Use Update variant inventory for stock changes keyed by inventory item. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The body has no fields. The message is No updates requested, Invalid Variant Update Request. |
409 | GE_001 | The variant was changed more recently by a sync, so this update was not applied. The message is Older Update Request Received. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The variant is not yours, or has no product. The message is Variant with id followed by the variant id, then does not exist for product and the product id. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"original_price": 199900,
"current_price": 129900,
"inventory_quantity": 8
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
original_price: 199900,
current_price: 129900,
inventory_quantity: 8
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"original_price": 199900,
"current_price": 129900,
"inventory_quantity": 8
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"original_price": 199900,
"current_price": 129900,
"inventory_quantity": 8
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"original_price": 199900,
"current_price": 129900,
"inventory_quantity": 8
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'original_price' => 199900,
'current_price' => 129900,
'inventory_quantity' => 8
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
}Delete a variant
/ce/api/v1/external/catalog/products/{product_id}/variants/{variant_id}
Deletes a variant and returns it as it was.
Path parameters
- product_idstringRequired
The product.
- variant_idstringRequired
The variant.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The variant is not yours, or has no product. The message is Variant with id followed by the variant id, then does not exist for product and the product id. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant removed successfully",
"data": {
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
}Link a variant to an image
/ce/api/v1/external/catalog/products/{product_id}/variants/{variant_id}/image
Shows an image for a variant. Returns the product.
Path parameters
- product_idstringRequired
The product.
- variant_idstringRequired
The variant.
Request body
- image_idstringRequired
The image to link.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
A variant that is not yours, or does not exist, answers 404.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | image_id is missing or blank. The message is image_id is required. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The variant is not yours, or has no product. The message is Variant with id followed by the variant id, then does not exist for product and the product id. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"image_id": "img_1"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
image_id: "img_1"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"image_id": "img_1"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"image_id": "img_1"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"image_id": "img_1"
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'image_id' => 'img_1'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant linked to image successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Unlink a variant from an image
/ce/api/v1/external/catalog/products/{product_id}/variants/{variant_id}/image
Stops showing an image for a variant. Returns the product. This call takes a JSON body.
Path parameters
- product_idstringRequired
The product.
- variant_idstringRequired
The variant.
Request body
- image_idstringRequired
The image to unlink.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
A variant that is not yours, or does not exist, answers 404.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | image_id is missing or blank. The message is image_id is required. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The variant is not yours, or has no product. The message is Variant with id followed by the variant id, then does not exist for product and the product id. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"image_id": "img_1"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
image_id: "img_1"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"image_id": "img_1"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"image_id": "img_1"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("DELETE", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"image_id": "img_1"
}`)
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/variants/var_456/image");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'image_id' => 'img_1'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant unlinked from image successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Get variants in bulk
/ce/api/v1/external/catalog/variants/bulk-get
Returns several variants in one call, from any of your products. Send 1 to 50 variant ids.
Request body
- variant_idsarray of stringRequired
The variants to fetch. 1 to 50 ids, none blank.
Response fields in data
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
data is an array of the variants that exist. Ids that do not exist are left out.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | variant_ids is empty, has more than 50 ids, or has a blank id. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"variant_ids": ["var_456", "var_457"]
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
variant_ids: ["var_456", "var_457"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"variant_ids": ["var_456", "var_457"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"variant_ids": ["var_456", "var_457"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"variant_ids": ["var_456", "var_457"]
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/variants/bulk-get");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'variant_ids' => ['var_456', 'var_457']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variants fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
]
}Update variant inventory
/ce/api/v1/external/catalog/variants/inventory
Changes stock for the variant that has the given inventory item id. A field you leave out keeps its value.
Request body
- inventory_item_idintegerRequired
The inventory item id set on the variant when it was created.
- inventory_quantityintegerOptional
Units in stock.
- skustringOptional
SKU.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- trackedbooleanOptional
truemarks inventory as tracked.falseclears tracking. Leave it out to keep the current setting.
The response has a message and no data. Only the variant that matches inventory_item_id on your store changes. Shopflo supports more fields for specific integrations. Contact [email protected] if you need one.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | inventory_item_id is missing or blank. The message is inventory_item_id is required. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"inventory_item_id": 56789,
"inventory_quantity": 25
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
inventory_item_id: 56789,
inventory_quantity: 25
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"inventory_item_id": 56789,
"inventory_quantity": 25
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"inventory_item_id": 56789,
"inventory_quantity": 25
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"inventory_item_id": 56789,
"inventory_quantity": 25
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/variants/inventory");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'inventory_item_id' => 56789,
'inventory_quantity' => 25
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Variant inventory updated successfully"
}Images
Add an image
/ce/api/v1/external/catalog/products/{product_id}/images
Adds an image to a product. Shopflo generates the image id, and an image_id in the body is ignored. Returns the product with its images.
Path parameters
- product_idstringRequired
The product.
Request body
- image_sourcestringRequired
Image URL.
- alt_textstringRequired
Alt text.
- widthintegerRequired
Width in pixels, 1 or more.
- heightintegerRequired
Height in pixels, 1 or more.
- is_primarybooleanOptional
Whether this is the main image.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | A required field is missing. The messages are Image Source is Required, Alt Text is Required, Image Width is required and Image height is required. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
image_source: "https://example.com/linen-shirt.jpg",
alt_text: "Linen shirt",
width: 1200,
height: 1600,
is_primary: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'image_source' => 'https://example.com/linen-shirt.jpg',
'alt_text' => 'Linen shirt',
'width' => 1200,
'height' => 1600,
'is_primary' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product image created successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Add images in bulk
/ce/api/v1/external/catalog/products/{product_id}/images/bulk
Adds several images to a product. Send 1 to 50 items. Shopflo generates each image id. Returns the product with its images.
Path parameters
- product_idstringRequired
The product.
Request body
- (array)arrayRequired
One object per image. 1 to 50 items.
- image_sourcestringRequired
Image URL.
- alt_textstringRequired
Alt text.
- widthintegerRequired
Width in pixels, 1 or more.
- heightintegerRequired
Height in pixels, 1 or more.
- is_primarybooleanOptional
Whether this is the main image.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
The request body is a bare JSON array. An image_id in an item is ignored.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The list is empty or has more than 50 items, or an item is not valid. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '[
{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
},
{
"image_source": "https://example.com/linen-shirt-back.jpg",
"alt_text": "Back view",
"width": 1200,
"height": 1600
}
]'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify([
{
image_source: "https://example.com/linen-shirt.jpg",
alt_text: "Linen shirt",
width: 1200,
height: 1600,
is_primary: true
},
{
image_source: "https://example.com/linen-shirt-back.jpg",
alt_text: "Back view",
width: 1200,
height: 1600
}
]),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json=[
{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": True
},
{
"image_source": "https://example.com/linen-shirt-back.jpg",
"alt_text": "Back view",
"width": 1200,
"height": 1600
}
],
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
[
{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
},
{
"image_source": "https://example.com/linen-shirt-back.jpg",
"alt_text": "Back view",
"width": 1200,
"height": 1600
}
]
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`[
{
"image_source": "https://example.com/linen-shirt.jpg",
"alt_text": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true
},
{
"image_source": "https://example.com/linen-shirt-back.jpg",
"alt_text": "Back view",
"width": 1200,
"height": 1600
}
]`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/bulk");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
[
'image_source' => 'https://example.com/linen-shirt.jpg',
'alt_text' => 'Linen shirt',
'width' => 1200,
'height' => 1600,
'is_primary' => true
],
[
'image_source' => 'https://example.com/linen-shirt-back.jpg',
'alt_text' => 'Back view',
'width' => 1200,
'height' => 1600
]
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product images created successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Update an image
/ce/api/v1/external/catalog/products/{product_id}/images/{image_id}
Changes an image. Fields you leave out keep their value. Returns the product.
Path parameters
- product_idstringRequired
The product.
- image_idstringRequired
The image id, as returned when the image was added.
Request body
- image_sourcestringOptional
Image URL.
- alt_textstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The body has no fields. The message is No Update requested. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No image with this id exists on this product. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"alt_text": "Linen shirt, front",
"is_primary": true
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
alt_text: "Linen shirt, front",
is_primary: true
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"alt_text": "Linen shirt, front",
"is_primary": True
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"alt_text": "Linen shirt, front",
"is_primary": true
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"alt_text": "Linen shirt, front",
"is_primary": true
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'alt_text' => 'Linen shirt, front',
'is_primary' => true
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product image updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Delete an image
/ce/api/v1/external/catalog/products/{product_id}/images/{image_id}
Deletes an image from a product. Returns the product.
Path parameters
- product_idstringRequired
The product.
- image_idstringRequired
The image id, as returned when the image was added.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/img_1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product image removed successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Link variants to images
/ce/api/v1/external/catalog/products/{product_id}/images/variants
Links variants to images of a product in one call. Returns the product with its images.
Path parameters
- product_idstringRequired
The product.
Request body
- product_image_id_variant_id_mapobjectRequired
An object whose keys are image ids and whose values are arrays of variant ids to link to that image. It must not be empty. At most 50 images, and at most 50 variants per image.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | The map is empty, or an image id is blank, or a list has more than 50 variants. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The product is not yours, or an image id or variant id is not part of this product. For an unknown image or variant the message is Some of the images or variants do not belong to this product. |
curl -sS -X PUT "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_image_id_variant_id_map": {
"img_1": ["var_456", "var_457"]
}
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants", {
method: "PUT",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_image_id_variant_id_map: {
img_1: ["var_456", "var_457"]
}
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.put(
"https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_image_id_variant_id_map": {
"img_1": ["var_456", "var_457"]
}
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_image_id_variant_id_map": {
"img_1": ["var_456", "var_457"]
}
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_image_id_variant_id_map": {
"img_1": ["var_456", "var_457"]
}
}`)
req, err := http.NewRequest("PUT", "https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/products/prod_123/images/variants");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_image_id_variant_id_map' => [
'img_1' => ['var_456', 'var_457']
]
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product image variants updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
}Collections
List collections
/ce/api/v1/external/catalog/collections
Returns a page of your collections.
Query parameters
- pageintegerOptional
Page number, starting at 1 and at most 1000000. Defaults to 1.
- limitintegerOptional
Page size, 1 to 50. Defaults to 10.
- name_likestringOptional
Only collections whose name contains this text.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
data is an array of collections. Beside data, the response carries current_page (the page you asked for), page_size, max_pages and total_count.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | page is below 1 or above 1000000, or limit is outside 1 to 50. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections?page=1&limit=10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collections fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
],
"current_page": 1,
"page_size": 10,
"max_pages": 1,
"total_count": 1
}Get a collection
/ce/api/v1/external/catalog/collections/{collection_id}
Returns one collection.
Path parameters
- collection_idstringRequired
The collection.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection fetched successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Create a collection
/ce/api/v1/external/catalog/collections
Creates a collection.
Request body
- collection_idstringRequired
An id you choose. It must be unique in your catalog.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - image_sourcestringOptional
Image URL.
- image_alt_textstringOptional
Image alt text.
- image_widthintegerOptional
Image width in pixels.
- image_heightintegerOptional
Image height in pixels.
- metadataobjectOptional
Free-form data to store with the collection.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | collection_id or name is missing. The messages are Collection Id is required and Collection Name is required. |
400 | CEE_001 | An item with this id already exists in your catalog. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/collections" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
collection_id: "col_1",
name: "Summer",
description: "Light fabrics for summer",
collection_type: "CUSTOM"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM"
}`)
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/collections", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'collection_id' => 'col_1',
'name' => 'Summer',
'description' => 'Light fabrics for summer',
'collection_type' => 'CUSTOM'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection created successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Update a collection
/ce/api/v1/external/catalog/collections/{collection_id}
Changes a collection. Fields you leave out keep their value. The image changes only when you send an image field.
Path parameters
- collection_idstringRequired
The collection.
Request body
- namestringOptional
Collection name. Ignored when empty.
- descriptionstringOptional
Description. Ignored when empty.
- collection_typestringOptional
CUSTOMorSMART. - image_sourcestringOptional
Image URL.
- image_alt_textstringOptional
Image alt text.
- image_widthintegerOptional
Image width in pixels.
- image_heightintegerOptional
Image height in pixels.
- metadataobjectOptional
Free-form data.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Summer 2026",
"description": "Light fabrics for summer"
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Summer 2026",
description: "Light fabrics for summer"
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"name": "Summer 2026",
"description": "Light fabrics for summer"
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"name": "Summer 2026",
"description": "Light fabrics for summer"
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"name": "Summer 2026",
"description": "Light fabrics for summer"
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Summer 2026',
'description' => 'Light fabrics for summer'
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Delete a collection
/ce/api/v1/external/catalog/collections/{collection_id}
Deletes a collection and returns it as it was. Its products are not deleted.
Path parameters
- collection_idstringRequired
The collection.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection removed successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}List the products of a collection
/ce/api/v1/external/catalog/collections/{collection_id}/products
Returns a page of the products in a collection, newest first, each with its variants and images. A collection that is not yours answers 404.
Path parameters
- collection_idstringRequired
The collection.
Query parameters
- pageintegerOptional
Page number, starting at 1 and at most 1000000. Defaults to 1.
- limitintegerOptional
Page size, 1 to 50. Defaults to 10.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- product_idstringRequired
The product id.
- namestringRequired
Product name.
- descriptionstringOptional
For Shopify stores, the product handle.
- product_typestringOptional
Product type.
- statusstringOptional
ACTIVE,ARCHIVED,DRAFT,SUSPENDEDorUNLISTED. - tagsarray of stringRequired
Empty when the product has none.
- vendorstringOptional
Vendor.
- created_atintegerOptional
Creation time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
- variantsarrayOptional
Present on some calls. Each item has the fields of a variant.
- variant_idstringRequired
The variant id.
- namestringOptional
Variant name.
- descriptionstringOptional
Variant description.
- skustringOptional
SKU.
- original_pricenumberOptional
Original price in whole currency units with decimals.
- current_pricenumberOptional
Current price in whole currency units with decimals.
- currencystringOptional
Currency code.
- inventory_quantityintegerOptional
Units in stock.
- inventory_managementstringOptional
Who tracks inventory. Empty when nobody does.
- inventory_policystringOptional
DENYorCONTINUE.CONTINUEmeans the variant can be sold when out of stock. - positionintegerOptional
Position among the product's variants.
- requires_shippingbooleanOptional
Whether the variant is shipped.
- taxablebooleanOptional
Whether the variant is taxable.
- weightstringOptional
Weight, as text.
- weight_unitstringOptional
KG,G,LBorOZ.
- imagesarrayOptional
Present on some calls. Each item has the fields of an image.
- image_idstringRequired
The image id.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- is_primarybooleanOptional
Whether this is the main image.
- linked_variant_idsarray of stringOptional
The variants this image shows. Empty when it applies to the whole product.
data is an array of products. Beside data, the response carries current_page (the page you asked for), page_size, max_pages and total_count.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | page is below 1 or above 1000000, or limit is outside 1 to 50. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products?page=1&limit=10");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection products fetched successfully",
"data": [
{
"merchant_id": "your_merchant_id",
"product_id": "prod_123",
"name": "Linen Shirt",
"description": "linen-shirt",
"product_type": "Shirts",
"status": "ACTIVE",
"tags": ["linen", "summer"],
"vendor": "Example Brand",
"created_at": 1766000000000,
"updated_at": 1766100000000,
"variants": [
{
"merchant_id": "your_merchant_id",
"variant_id": "var_456",
"name": "S",
"sku": "LS-S",
"original_price": 1999.0,
"current_price": 1499.0,
"currency": "INR",
"inventory_quantity": 12,
"position": 1,
"requires_shipping": true,
"taxable": true,
"weight": "250",
"weight_unit": "G",
"inventory_policy": "DENY",
"inventory_management": "shopify"
}
],
"images": [
{
"image_id": "img_1",
"src": "https://example.com/linen-shirt.jpg",
"alt": "Linen shirt",
"width": 1200,
"height": 1600,
"is_primary": true,
"linked_variant_ids": []
}
]
}
],
"current_page": 1,
"page_size": 10,
"max_pages": 1,
"total_count": 1
}Get the product ids of a collection
/ce/api/v1/external/catalog/collections/{collection_id}/products/mapping
Returns only the ids of the products in a collection.
Path parameters
- collection_idstringRequired
The collection.
Response fields in data
- product_idsarray of stringRequired
The ids of the products in the collection.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
curl -sS "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping", {
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.get(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.GET()
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("GET", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/mapping");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection product mapping fetched successfully",
"data": {
"product_ids": ["prod_123", "prod_124"]
}
}Set the products of a collection
/ce/api/v1/external/catalog/collections/{collection_id}/products
Makes the collection hold exactly the products you send. Products already in the collection that are not in your list are removed. Every product id must exist in your catalog. Send at most 50 ids.
Path parameters
- collection_idstringRequired
The collection.
Request body
- product_idsarray of stringRequired
The complete list of products the collection should hold. At most 50 ids, none blank. Send an empty array to empty the collection.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
This call replaces the whole member list, so a collection that holds more than 50 products cannot be replaced in one call. To change some products without touching the rest, use Add and remove collection products.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | product_ids is missing, has more than 50 ids, or has a blank id. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The collection is not yours, or a product id is not in your catalog. For a missing product the message is Some of the requested products do not exist in this catalog. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_ids": ["prod_123", "prod_124"]
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_ids: ["prod_123", "prod_124"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_ids": ["prod_123", "prod_124"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_ids": ["prod_123", "prod_124"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_ids": ["prod_123", "prod_124"]
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_ids' => ['prod_123', 'prod_124']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection products updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Add and remove collection products
/ce/api/v1/external/catalog/collections/{collection_id}/products/modify
Adds some products to a collection and removes others, in one call. Other products in the collection are not touched. Send at most 50 ids in each list.
Path parameters
- collection_idstringRequired
The collection.
Request body
- product_ids_to_addarray of stringOptional
Products to add. At most 50, none blank. Every id must exist in your catalog. Leave it out to add nothing.
- product_ids_to_removearray of stringOptional
Products to remove. At most 50, none blank. Leave it out to remove nothing.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
400 | GE_001 | A list has more than 50 ids, or an id is blank. |
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | The collection is not yours, or an id to add is not in your catalog. For a missing product the message is Some of the requested products do not exist in this catalog. |
curl -sS -X PATCH "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify" \
-H "Authorization: sfat-your_key" \
-H "Content-Type: application/json" \
-d '{
"product_ids_to_add": ["prod_125"],
"product_ids_to_remove": ["prod_124"]
}'const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify", {
method: "PATCH",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
product_ids_to_add: ["prod_125"],
product_ids_to_remove: ["prod_124"]
}),
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.patch(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
json={
"product_ids_to_add": ["prod_125"],
"product_ids_to_remove": ["prod_124"]
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var body = """
{
"product_ids_to_add": ["prod_125"],
"product_ids_to_remove": ["prod_124"]
}
""";
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.header("Content-Type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString(body))
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
body := bytes.NewBufferString(`{
"product_ids_to_add": ["prod_125"],
"product_ids_to_remove": ["prod_124"]
}`)
req, err := http.NewRequest("PATCH", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify", body)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/modify");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
'product_ids_to_add' => ['prod_125'],
'product_ids_to_remove' => ['prod_124']
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Collection products updated successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Add a product to a collection
/ce/api/v1/external/catalog/collections/{collection_id}/products/{product_id}
Adds one product to a collection.
Path parameters
- collection_idstringRequired
The collection.
- product_idstringRequired
The product.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X POST "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123", {
method: "POST",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.post(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("POST", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product added to collection successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}Remove a product from a collection
/ce/api/v1/external/catalog/collections/{collection_id}/products/{product_id}
Removes one product from a collection. The product is not deleted.
Path parameters
- collection_idstringRequired
The collection.
- product_idstringRequired
The product.
Response fields in data
- merchant_idstringRequired
Your merchant id.
- collection_idstringRequired
The collection id.
- namestringRequired
Collection name.
- descriptionstringOptional
Description.
- collection_typestringOptional
CUSTOMorSMART. - collection_imageobjectOptional
The collection image, if any.
- srcstringRequired
Image URL.
- altstringOptional
Alt text.
- widthintegerOptional
Width in pixels.
- heightintegerOptional
Height in pixels.
- metadataobjectOptional
Free-form data stored with the collection.
- published_atintegerOptional
Publish time in epoch milliseconds.
- updated_atintegerOptional
Last update time in epoch milliseconds.
Errors
| Status | Code | When |
|---|---|---|
401 | GE_003 | The Authorization header is missing or the key is not recognised. |
404 | GE_004 | No collection with this id exists in your catalog. |
404 | GE_004 | No product with this id exists in your catalog. |
curl -sS -X DELETE "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123" \ -H "Authorization: sfat-your_key"
const res = await fetch("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123", {
method: "DELETE",
headers: {
Authorization: process.env.SHOPFLO_API_KEY,
},
});
const body = await res.json();
console.log(body.data);import os
import requests
response = requests.delete(
"https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123",
headers={
"Authorization": os.environ["SHOPFLO_API_KEY"],
},
)
print(response.json()["data"])import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Example {
public static void main(String[] args) throws Exception {
var request = HttpRequest.newBuilder()
.uri(URI.create("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123"))
.header("Authorization", System.getenv("SHOPFLO_API_KEY"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
req, err := http.NewRequest("DELETE", "https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", os.Getenv("SHOPFLO_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(string(data))
}<?php
$ch = curl_init("https://api.shopflo.co/ce/api/v1/external/catalog/collections/col_1/products/prod_123");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: " . getenv("SHOPFLO_API_KEY"),
],
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;{
"success": true,
"message": "Product removed from collection successfully",
"data": {
"merchant_id": "your_merchant_id",
"collection_id": "col_1",
"name": "Summer",
"description": "Light fabrics for summer",
"collection_type": "CUSTOM",
"published_at": 1766000000000,
"updated_at": 1766100000000
}
}