Create or update
You can use the create or update products API to create the products.
Request parameters
| Name | Type | Required/Optional | Description | 
|---|---|---|---|
| products | BikProduct[] | Required | List of products | 
Request Information
| Category | Value | 
|---|---|
| Http request | POST | 
| URL | https://bikapi.bikayi.app/integrations/bikPlatformFunctions-products/createOrUpdate | 
BikProduct Type
| Name | Type | Required/Optional | Description | 
|---|---|---|---|
| id | string | Required | Product ID | 
| name | string | Required | Name of the catalog | 
| description | string | Required | Catalog description | 
| image | string | Required | Product image | 
| variantIds | string[] | Optional | List of variant ids belongs to current product | 
| currency | string | Optional | Currency of the country | 
| photos | BikPhoto[] | Required | List of photos | 
| minPrice | number | Optional | Minimum price of the product | 
| maxPrice | number | Optional | Maximum price of the product | 
| discount | number | Optional | Discount if any | 
| tags | string | Optional | Product tags | 
| catalogs | BikCatalog[] | Optional | List of catalogs this product belongs to | 
| catalogIds | string[] | Optional | List of catalog ids this product belongs to | 
| combinations | BikCombination[] | Required | List of product combinations | 
BikPhoto Type
| Name | Type | Required/Optional | Description | 
|---|---|---|---|
| photoUrl | string | Required | Product photo | 
BikCatalog Type
| Name | Type | Required/Optional | Description | 
|---|---|---|---|
| id | string | Required | Catalog id | 
| name | string | Required | Catalog name | 
BikCombination Type
| Name | Type | Required/Optional | Description | 
|---|---|---|---|
| id | string | Required | Combination id | 
| name | string | Required | Combination name | 
| productId | string | Required | Product id | 
| price | number | Required | Combination price | 
| discountedPrice | number | Required | Combination discount price | 
| quantity | number | Required | Combination quantity available | 
| image | string | Required | Combination image | 
| productUrl | string | Required | Combination product url | 
Sample request
curl --location 'https://bikapi.bikayi.app/integrations/bikPlatformFunctions-products/createOrUpdate' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic AUTH_TOKEN' \
--data '{
    "products": [
        {
            "image": "https://cdn.shopify.com/s/files/1/0672/6267/7292/products/young-man-in-bright-fashion_925x_1f25586d-6ce7-4ae7-9b61-a14d7da56d16.jpg?v=1689587429",
            "name": "Ocean Blue Shirt",
            "currency": "INR",
            "url": "https://test-product.com/product.json",
            "id": "8459368759512",
            "description": "Ocean blue cotton shirt with a narrow collar and buttons down the front and long sleeves. Comfortable fit and tiled kalidoscope patterns.",
            "combinations": [
                {
                    "quantity": 2,
                    "discountedPrice": 50,
                    "productUrl": "https://test-product.com/product.json",
                    "image": "https://test-product.com/product.png",
                    "price": 50,
                    "name": "Default Title",
                    "options": {
                        "Title": "Default Title"
                    },
                    "id": "45719281008940",
                    "productId": "8459368759512"
                }
            ],
            "photos": [
                {
                    "photoUrl": "https://cdn.shopify.com/s/files/1/0672/6267/7292/products/young-man-in-bright-fashion_925x_1f25586d-6ce7-4ae7-9b61-a14d7da56d16.jpg?v=1689587429"
                }
            ]
        }
    ]
}'
JSON response example:
{
  "status": 200,
  "success": true,
  "data": {
    "products": [
      {
        "image": "https://cdn.shopify.com/s/files/1/0672/6267/7292/products/young-man-in-bright-fashion_925x_1f25586d-6ce7-4ae7-9b61-a14d7da56d16.jpg?v=1689587429",
        "combinations": [
          {
            "quantity": 2,
            "discountedPrice": 50,
            "productUrl": "https://test-product.com/product.json",
            "image": "https://test-product.com/product.png",
            "price": 50,
            "name": "Default Title",
            "options": {
              "Title": "Default Title"
            },
            "id": "45719281008940"
          }
        ],
        "publishedAt": {
          "_seconds": 1732516184,
          "_nanoseconds": 333000000
        },
        "catalogs": [],
        "name": "Ocean Blue Shirt",
        "description": "Ocean blue cotton shirt with a narrow collar and buttons down the front and long sleeves. Comfortable fit and tiled kalidoscope patterns.",
        "currency": "INR",
        "skipSync": false,
        "id": "8459368759512",
        "url": "https://test-product.com/product.json"
      }
    ]
  }
}
Response parameters
| Name | Type | Description | 
|---|---|---|
| status | number | Response status | 
| success | boolean | Is successful response or not | 
| data | BikProducts | List of products | 
Errors
| Error Code | Meaning | 
|---|---|
| 400 | Invalid payload -- Your request is invalid. | 
| 401 | Unauthorized -- User is not authenticated. | 
| 404 | Not Found -- The specified API could not be found. | 
| 500 | Internal Server Error -- We had a problem with our server. Try again later. | 
Error response example:
{
  "status": 400,
  "errors": [
    {
      "message": "'products' is required."
    }
  ]
}