MyKubo Distributor API

Stock management of MyKubo platform.

Base URI

https://api.mykubo.com
Parameters
API_TOKEN
string required

The authentication token for a specific IP.

Documentation
Product

The Product object.

Attributes:

  • pid (Product ID)
  • Name
  • Brand
  • Serial
  • Views
  • Active (1/0)
  • A list of subproducts as an array of SubProduct object.
Brand

The Brand object

Attributes:

  • bid (Brand ID)
  • Name
  • Country
  • Phone
  • Logo
SubProduct

The SubProduct object.

A SubProduct consits on a color/size combination of a PID (Product ID). They are childs and they belong to a Product, a SubProduct only has 1 Product but a Product can have many SubProducts.

  • pcid (SubProduct ID)
  • pid (Product ID)
  • Color
  • Size
  • Initial Stock
  • Current Stock
API Methods
Products Management
GET /products
POST /products
POST /product/add
DELETE /products
POST /products/image
DELETE /products/sub
DELETE /product/image
PUT /product/sub/stock
PUT /products
Product List
GET /products

Get the list of products managed by the Distributor

Responses

200 OK
Body
Array
Object
Product
Object

Returns a collection of objects Product

Add Product
POST /products

Add a product (Only main product description). A product will have several sub products (Size/Color), the stock is related to the sub product.

Request parameters

name
string required

Name of the product without Brand name

Example:
DRI-FIT KNIT SHORT-SLEEVE
brand
number required

Brand ID (You can get from GET /brands/allowed) of the Brand of this product

Example:
1
description
string optional

Description of this product

Example:
New adapted short-sleeves for sports.
category
number required

Category ID (You can get from GET /products/categories).

Example:
1
price
number optional

Price of the product

Example:
19.99

Responses

200 OK
Body
Object
pid
number

ID of the generated Product Used for insertion of Sub Products

Example:
11
Add SubProduct
POST /product/add

Add a SubProduct to a related Product

Request parameters

pid
number required

ID of parent Product

Example:
11
color
string required

HEX code of the Color example FFFFFF for White 000000 for Black

Example:
FFFFFF
size
string required

Size of the product

Example:
XL
stock
number required

Number of available stock

Example:
1000
image
string required

URL of an image of the respective product

Example:
http://mybrand.com/images/sleeve.png

Request body

Object
spid
number

SubProduct ID of the inserted SubProduct

Example:
10

Responses

200 OK
Remove Product
DELETE /products

Remove an entire Product and it’s SubProducts

Request parameters

pid
number optional

Product ID

Example:
11

Responses

200 OK
Add Product Image
POST /products/image

Add an image for a respective Product/Color.

Request parameters

pid
number optional

Product ID

Example:
1
color
string required

HEX code of the Color

Example:
FFFFFF
image
string required

URL of the image to add

Example:
http://mybrand.com/images/sleeve-2.png

Responses

200 OK
Remove SubProduct
DELETE /products/sub

Remove a SubProduct

Request parameters

spid
number required

ID of the SubProduct

Example:
12

Responses

200 OK
Remove Product Image
DELETE /product/image

Remove the image of the respective product NOTE At least 1 image is necessary, if it’s the last image an error will be thrown

Request parameters

pid
number required

ID of the Product

Example:
11
color
string required

HEX code of the color

Example:
FFFFFF

Responses

200 OK
Update stock
PUT /product/sub/stock

Update the stock of a respective SubProduct

Request parameters

spid
number required

ID of the SubProduct

Example:
1
stock
number required

New Stock value

Example:
990

Responses

200 OK
Edit Product
PUT /products

Change the name or description of the product.

Request parameters

pid
number required

ID of the Product

Example:
11
name
string optional

New name of the Product

Example:
SHORT-SLEEVES 2014
description
string optional

New description of the Product

Responses

200 OK
Permissions
GET /brands/allowed
GET /products/categories
Brands Allowed
GET /brands/allowed

Query which Brands the current session is allowed to create products from.

Responses

200 OK
Body
Object
id
number

Brand ID

Example:
1
name
string

Name of the Brand

Example:
MyKubo Clothing
country
string

Country name in English

Example:
Portugal
phone
number

Contact: International phone number

Note Without the +

Example:
1
logo
string

The URL of the current logo settled up by the brand

Note The link is a permanent link, if Brand changes the logo, the image returned on this URL will also change

Example:
http://static.mykubo.com/brands/452fd2982dbd855d140af2c98asf701faad7db1.png
Category List
GET /products/categories

Return the entire tree of allowed categories

Responses

200 OK