Products

Add

Adds a new product into the inventory.

https://app.intrakr.com/api/products/add


POST Content

{
"name": [Required] The name of the product to add.,
"account": [Required] The account to add the product to.,
"desc": Description of the product,
"cat": List of categories to assign the product to,
"images": Array of product images. See below for details.,
"vars": List of possible variations for the product,
"quantities": List of quantity information for each variation
}

Response

Upon a successful insertion, a 200 status code will be returned with the following response content:

{ "id": "Product ID",
"added": true,
"totalItems": # of products in account after addition }


Example POST Content

{
"name": "Premium Widget",
"account": "51093df84623aef5ae25dd14",
"desc": "Premium Widget - best buy around!",
"cat": ["widgets","premium items"],
"images": ["http://widgets.com/premium.jpg"],
"vars": [
{"n":"Size","v":["small","medium"]},
{"n":"Color","v":["black"]}
],
"quantities": [
{ "variation": {"Size":"small", "Color":"black"},
"quantity": 28,
"lowQuantity": 10,
"unitPrice": 1.23,
"salePrice: 2.00
},
{ "variation": {"Size":"medium", "Color":"black"},
"quantity": 0,
"lowQuantity": 10,
"unitPrice": 1.50,
"salePrice: 2.25
}
]
}

Modify

Modifies an existing product.

https://app.intrakr.com/api/products/modify


POST Content

{
"id": [Required] The ID of the product to modify.
"name": The name of the product to add.,
"desc": Description of the product,
"cat": List of categories to assign the product to,
"images": Array of product images,
"vars": List of possible variations for the product,
"quantities": List of quantity information for each variation
}


Response

Upon a successful insertion, a 200 status code will be returned with the following response content:

{ "id": "Product ID", "updated": true, "low": Boolean }

The low property will only be present if quantity values were passed to the API. Its value will be true if the product is now low on some variation or false otherwise.

Get

Gets data for the specified product.

https://app.intrakr.com/api/products/get


POST Content

{
"id": [Required] The ID of the product to get data for.
"fields": The fields to return. If null, will return all fields.
}


Response

Upon a successful insertion, a 200 status code will be returned with a JSON object representing the product data.

Remove

Removes a list of specified products.

https://app.intrakr.com/api/products/remove


POST Content

{
"ids": [Required] List of product IDs to remove.
"account": [Required] The account ID all products belong to.
}


Response

Upon a successful insertion, a 200 status code will be returned with a JSON object representing the product data:

{ "ids": Product IDs that were removed,
"removed": true,
"totalItems": # of products in account after addition }

Alter

Alters the quantities of existing products' variations. Will increment/decrement by the value provided. Same functionality as Quick Change in the UI.

https://app.intrakr.com/api/products/alter


POST Content

{
"items": [Required] List of products and variations to alter.
"account": [Required] The account ID all products belong to.
}


Response

Upon a successful insertion, a 200 status code will be returned with a JSON object representing the product data:

{ "account": "Account ID", "altered": true }


Example POST Content

Increments the quantity product and variation specified by 2.

{
"account": "51093df84623aef5ae25dd14",
"items": [{
"id": "51494d564b99860000000001",
"quantities": [
{ "variation": {"Size":"small", "Color":"black"},
"quantity": 2
}
]
}]
}

Search

Searches for all products in the account which match the specified criteria.

https://app.intrakr.com/api/products/search


POST Content

{
"account": [Required] Account ID,
"search": The search phrase as a string,
"skip": The number of results to skip when returning,
"limit": The number of results to return,
"fields": Array of fields to return. If null, returns all.
}


Response

Upon success, a 200 status code with the following content body:

{
"total": Total number of results, regardless of skip/limit,
"items": Array of matching products and associated information.
}

 

Images

When saving images to a product, there are three data types that may be used:

Remote URL

Any remote url beginning with http:// or https://

Existing Image Key

The key of an existing image already stored. A 32-byte hexadecimal string.

Base64 Encoded Image Data

The contents of an image, encoded as a base64 string. Must start with data:image/TYPE;base64,CONTENT. For example:

data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAB/wAAAVcCAIAAAC+...

Example

{ "name": "Widget",
"images": [
"data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAB/wAAAVcCAIAAAC+...",
"http://images.widgets.com/widget.jpg",
"f4210882890451e4d5da96f4a3730cb3"
]
}

Image URLs

Use the below URLs to get images for products.

Main Product Image

https://app.intrakr.com/products/image/SIZE/PRODUCT_ID

Image by Key

https://app.intrakr.com/image/SIZE/PRODUCT_ID/IMAGE_KEY


SIZE: The size of the image to return - thumb or full.

 

 

 

 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk