Skip to main content

Create or update

Use the Create or Update Products API to create new products or update existing ones.

Catalogs must exist before they are referenced

If you include catalogIds on a product, every referenced catalog must already exist for the store. Create catalogs first by calling catalogs/createOrUpdate, then reference the returned catalog IDs here. Passing a nonexistent catalog ID will cause the request to fail (see the catalog-not-found example in the Errors section).

Request parameters

NameTypeRequired/OptionalDescription
productsBikProduct[]RequiredArray of product objects

Request Information

CategoryValue
Http requestPOST
URLhttps://bikapi.bikayi.app/integrations/bikPlatformFunctions-products/createOrUpdate

BikProduct Type

NameTypeRequired/OptionalDescription
idstringRequiredProduct ID
namestringRequiredProduct name
urlstringRequiredStorefront URL for the product
descriptionstringOptionalProduct description
imagestringOptionalProduct image URL
currencystringOptionalCurrency code
photosBikPhoto[]RequiredArray of product photos
tagsstringOptionalComma-separated product tags
catalogIdsstring[]OptionalIDs of catalogs this product belongs to
combinationsBikCombination[]RequiredArray of product variant combinations
metafieldsMetafield[]OptionalMetafields associated with the product
addToCartDisabledbooleanOptionalIf true, the Add to Cart button should be hidden for this product. Defaults to false

BikPhoto Type

NameTypeRequired/OptionalDescription
photoUrlstringRequiredPhoto URL

Metafield Type

NameTypeRequired/OptionalDescription
idstringRequiredMetafield ID
namespacestringRequiredMetafield namespace
keystringRequiredMetafield key
valuestringRequiredMetafield value

BikCombination Type

NameTypeRequired/OptionalDescription
idstringRequiredCombination ID
namestringRequiredCombination name
productIdstringRequiredParent product ID
pricenumberRequiredCombination price
discountedPricenumberRequiredDiscounted price
quantitynumberRequiredAvailable quantity
imagestringRequiredCombination image URL
productUrlstringRequiredCombination product URL
currencystringOptionalCurrency code
optionsobjectOptionalMap of variant option values, e.g. { "Size": "XL", "Color": "Red" }

Sample request — product with variants

An electronics store selling a smartphone available in two colors and two storage sizes (4 variant combinations):

curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-products/createOrUpdate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic AUTH_TOKEN' \
--data '{
"products": [
{
"id": "prod_nova_x1",
"name": "Nova X1 Smartphone",
"url": "https://electronics-store.com/products/nova-x1",
"description": "6.7-inch AMOLED display, 108MP camera, 5000mAh battery.",
"image": "https://cdn.electronics-store.com/nova-x1/hero.jpg",
"currency": "INR",
"tags": "smartphone,5g,android",
"catalogIds": ["cat_smartphones"],
"photos": [
{ "photoUrl": "https://cdn.electronics-store.com/nova-x1/front.jpg" },
{ "photoUrl": "https://cdn.electronics-store.com/nova-x1/back.jpg" }
],
"combinations": [
{
"id": "var_nova_x1_black_128",
"productId": "prod_nova_x1",
"name": "Midnight Black / 128GB",
"price": 49999,
"discountedPrice": 44999,
"currency": "INR",
"quantity": 25,
"image": "https://cdn.electronics-store.com/nova-x1/black.jpg",
"productUrl": "https://electronics-store.com/products/nova-x1?variant=black-128",
"options": { "Color": "Midnight Black", "Storage": "128GB" }
},
{
"id": "var_nova_x1_black_256",
"productId": "prod_nova_x1",
"name": "Midnight Black / 256GB",
"price": 54999,
"discountedPrice": 49999,
"currency": "INR",
"quantity": 12,
"image": "https://cdn.electronics-store.com/nova-x1/black.jpg",
"productUrl": "https://electronics-store.com/products/nova-x1?variant=black-256",
"options": { "Color": "Midnight Black", "Storage": "256GB" }
},
{
"id": "var_nova_x1_silver_128",
"productId": "prod_nova_x1",
"name": "Glacier Silver / 128GB",
"price": 49999,
"discountedPrice": 44999,
"currency": "INR",
"quantity": 18,
"image": "https://cdn.electronics-store.com/nova-x1/silver.jpg",
"productUrl": "https://electronics-store.com/products/nova-x1?variant=silver-128",
"options": { "Color": "Glacier Silver", "Storage": "128GB" }
},
{
"id": "var_nova_x1_silver_256",
"productId": "prod_nova_x1",
"name": "Glacier Silver / 256GB",
"price": 54999,
"discountedPrice": 49999,
"currency": "INR",
"quantity": 9,
"image": "https://cdn.electronics-store.com/nova-x1/silver.jpg",
"productUrl": "https://electronics-store.com/products/nova-x1?variant=silver-256",
"options": { "Color": "Glacier Silver", "Storage": "256GB" }
}
],
"metafields": [
{
"id": "mf_nova_x1_warranty",
"namespace": "specs",
"key": "warranty_months",
"value": "12"
}
]
}
]
}'

Sample request — product without variants

combinations is required and must contain at least one entry. For products sold as a single SKU (no color/size/storage options), include one combination representing the product itself — use "Default" (or the product name) as the combination name and omit options:

curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-products/createOrUpdate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic AUTH_TOKEN' \
--data '{
"products": [
{
"id": "prod_usb_c_cable",
"name": "Braided USB-C Cable — 1m",
"url": "https://electronics-store.com/products/usb-c-cable-1m",
"description": "Durable braided USB-C to USB-C cable, 100W PD, 1 meter.",
"image": "https://cdn.electronics-store.com/usb-c-cable/hero.jpg",
"currency": "INR",
"tags": "accessory,cable,usb-c",
"photos": [
{ "photoUrl": "https://cdn.electronics-store.com/usb-c-cable/hero.jpg" }
],
"combinations": [
{
"id": "var_usb_c_cable_default",
"productId": "prod_usb_c_cable",
"name": "Default",
"price": 799,
"discountedPrice": 599,
"currency": "INR",
"quantity": 200,
"image": "https://cdn.electronics-store.com/usb-c-cable/hero.jpg",
"productUrl": "https://electronics-store.com/products/usb-c-cable-1m"
}
]
}
]
}'

JSON response example:

{
"status": 200,
"success": true,
"data": {
"products": [
{
"id": "prod_nova_x1",
"name": "Nova X1 Smartphone",
"url": "https://electronics-store.com/products/nova-x1",
"description": "6.7-inch AMOLED display, 108MP camera, 5000mAh battery.",
"image": "https://cdn.electronics-store.com/nova-x1/hero.jpg",
"currency": "INR",
"tags": "smartphone,5g,android",
"catalogIds": ["cat_smartphones"],
"photos": [
{ "photoUrl": "https://cdn.electronics-store.com/nova-x1/front.jpg" },
{ "photoUrl": "https://cdn.electronics-store.com/nova-x1/back.jpg" }
],
"combinations": [
{
"id": "var_nova_x1_black_128",
"productId": "prod_nova_x1",
"name": "Midnight Black / 128GB",
"price": 49999,
"discountedPrice": 44999,
"currency": "INR",
"quantity": 25,
"image": "https://cdn.electronics-store.com/nova-x1/black.jpg",
"productUrl": "https://electronics-store.com/products/nova-x1?variant=black-128",
"options": { "Color": "Midnight Black", "Storage": "128GB" }
}
]
}
]
}
}

Response parameters

NameTypeDescription
statusnumberHTTP status code
successbooleanIndicates whether the request succeeded
dataBikProductsArray of created or updated products

Errors

Error CodeMeaning
400Invalid payload -- Your request is invalid.
401Unauthorized -- User is not authenticated.
404Not Found -- The specified API could not be found.
500Internal Server Error -- We had a problem with our server. Try again later.

Error response example:

{
"status": 400,
"errors": [
{
"message": "'products' is required."
}
]
}

Catalog-not-found error example — one of the catalogIds on a product does not exist for this store:

{
"status": 400,
"errors": [
{
"message": "Catalog with id 'cat_smartphones' does not exist. Create it via catalogs/createOrUpdate before associating products with it."
}
]
}