API to connect Kubidi to the world
Merchants and companies can use our API to integrate ecommerce and social media platforms content and synchronize products and shop data

Authentication

Authentication to initialize the API communication with kubidi server
In order to use Kubidi API you need to sign up as a merchant and you will see your auto-generate API Key in the settings section.
Header
KUBIDI_API_KEY : String ( required )
userid : Integer ( required )
curl https://www.kubidi.com/app.php/api/v1/gettoken
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $KUBIDI_API_KEY" 
    -H "userid: 283999" 


JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "token": "86c5ceb27e1bf441130299c0209e5f35b88089f62c06b2b09d65772274f12057"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Invalid Api Key"
    }
                                                

Get Products

Get products loaded in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
curl https://www.kubidi.com/app.php/api/v1/products
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 


JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "products": [
            { 
                "productid": 232223,
                "productname": "Lemon tree",
                "productcategory": "Garden-Center",
                "productsubcategory": "Rutaceae prunes",
                "productmedia": "lemontree-64e4e11fb5d43.jpeg",
                "productprice": 350,
                "productdiscountedprice": 329,
                "productdescription": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
                "producttags": "plants fruits lemon",
                "outofstock": 0,
                "created_at": "2023-08-22 16:23:59",
                "updated_at": "2023-08-22 16:23:59"
            }
      ]
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }


JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Create Product

Create a new product in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Payload
productname : String ( required )
productcategory : String ( required )
productsubcategory : String
productmedia : String ( required )
productprice : Integer ( required )
productdiscountedprice : Integer
productdescription : String ( required )
producttags : String ( required )
outofstock : Integer ( [0,1] )
curl -X POST https://www.kubidi.com/app.php/api/v1/product/create
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 
    -d '{  ... payload ...  }'

JSON Payload:
   {
       "productname": "Lemon tree",
       "productcategory": "Garden-Center",
       "productsubcategory": "Rutaceae prunes",
       "productmedia": "lemontree-64e4e11fb5d43.jpeg",
       "productprice": 350,
       "productdiscountedprice": 329,
       "productdescription": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
       "producttags": "plants fruits lemon",
       "outofstock": 0
    }


JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Update Product

Update a product in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
id : Integer ( required )
Payload
productname : String ( required )
productcategory : String ( required )
productsubcategory : String
productmedia : String ( required )
productprice : Integer ( required )
productdiscountedprice : Integer ( required )
productdescription : String ( required )
producttags : String ( required )
outofstock : Integer ( [0,1] )
curl -X PUT https://www.kubidi.com/app.php/api/v1/product/update/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 
    -d '{  ... payload ...  }'

JSON Payload:
   {
       "productname": "Lemon tree",
       "productcategory": "Garden-Center",
       "productsubcategory": "Rutaceae prunes",
       "productmedia": "lemontree-64e4e11fb5d43.jpeg",
       "productprice": 350,
       "productdiscountedprice": 329,
       "productdescription": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
       "producttags": "plants fruits lemon",
       "outofstock": 0
    }

JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Delete Product

Delete a product in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
id : Integer ( required )
curl -X DELETE https://www.kubidi.com/app.php/api/v1/product/delete/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Get Product By ID

Get a product by providing the ID
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Payload
id : String ( required )
curl https://www.kubidi.com/app.php/api/v1/product/get/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 


JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "product": 
            { 
                "productname": "Lemon tree",
                "productcategory": "Garden-Center",
                "productsubcategory": "Rutaceae prunes",
                "productmedia": "lemontree-64e4e11fb5d43.jpeg",
                "productprice": 350,
                "productdiscountedprice": 329,
                "productdescription": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
                "producttags": "plants fruits lemon",
                "outofstock": 0,
                "created_at": "2023-08-22 16:23:59",
                "updated_at": "2023-08-22 16:23:59"
            }
     }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Get Posts

Get the posts loaded on Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
curl https://www.kubidi.com/app.php/api/v1/posts
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "posts": [
            { 
                "hash": "86c5ceb27e1bf441130299c0209e5f35b88089f62c06b2b09d65772274f12057",
                "message": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
                "media": "lemontree-64e4e11fb5d43.jpeg",
                "created_at": "2023-08-22 16:23:59"
            }
      ]
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Create Post

Create a new post in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Payload
post_content : String ( required )
post_media : String ( required )
curl -X POST https://www.kubidi.com/app.php/api/v1/post/create
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 
    -d '{  ... payload ...  }'


JSON Payload:
    {   
       "message": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
       "media": "lemontree-64e4e11fb5d43.jpeg",
       "created_at": "2023-08-22 16:23:59"
    }


JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Delete Post

Delete a post in Kubidi
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
id : Integer ( required )
curl -X DELETE https://www.kubidi.com/app.php/api/v1/post/delete/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Get Post By Hash

Get a post by providing the Hash
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
hash : String ( required )
curl https://www.kubidi.com/app.php/api/v1/post/get/{hash}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "post": 
            { 
               "message": "Lemon tree in a Decorated Pot, made from artisans in the North of Thailand. High quality and good design",
               "media": "lemontree-64e4e11fb5d43.jpeg",
               "created_at": "2023-08-22 16:23:59"
            }
     }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Get Inventory

Get the full Inventory
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
curl https://www.kubidi.com/app.php/api/v1/inventory
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "items": [
            { 
                "productid": 232223,                
                "productcategory": "Garden-Center",
                "productsubcategory": "Rutaceae prunes",
                "productmedia": "lemontree-64e4e11fb5d43.jpeg",
                "productprice": 350,
                "productdiscountedprice": 350,
                "location": "( R024 ) second row near the lift",
                "pieces": 10,
                "created_at": "2023-08-22 16:23:59"
            }
       ]
     }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Get Inventory By Product ID

Get the Inventory by product
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
id : Integer ( required )
curl https://www.kubidi.com/app.php/api/v1/inventory/get/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 

JSON Response:
   {
    "httpcode": 200, 
    "message": "success", 
    "item": 
            {                
                "productcategory": "Garden-Center",
                "productsubcategory": "Rutaceae prunes",
                "productmedia": "lemontree-64e4e11fb5d43.jpeg",
                "productprice": 350,
                "productdiscountedprice": 350,
                "location": "( R024 ) second row near the lift",
                "pieces": 10,
                "created_at": "2023-08-22 16:23:59"
            }
       
     }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                

Update Inventory

Remove a number of pieces from a item in Inventory
In order to use Kubidi API you need to provide the TOKEN you got in initialization. The TOKEN expires in 10 minutes. You have to check if the token is still valid before calling the API.
Header
TOKEN : String ( required )
userid : Integer ( required )
Parameter
id : Integer ( required )
Payload
pieces : Integer ( required )
location : String
curl -X PUT https://www.kubidi.com/app.php/api/v1/inventory/update/{id}
    -H "Content-Type: application/json"
    -H "Authorization: Bearer $TOKEN" 
    -H "userid: 283999" 
    -d '{  ... payload ...  }'}'

JSON Payload:
   {
      "pieces":  2,
      "location": "( R024 ) second row near the lift",
    }

JSON Response:
   {
    "httpcode": 200, 
    "message": "success"
    }

JSON Response:
   {
    "httpcode": 400, 
    "message": "Header or payload error"
    }

JSON Response:
   {
    "httpcode": 401, 
    "message": "Unauthorized - Token expired"
    }
                                                
Sit, Relax, Shop
hello@kubidi.com
Kubidi, the good way to use AI.
Security in payment systems is a primary factor for us. Kubidi implements additional systems such as 2-factor authentication and geolocation checking to prevent anyone from using Kubidi to commit fraud. We prefer an extra step to make the shopping experience safer than other platforms.