Products

POST /products

Create a new product. The json with the product should be valid with the following json-schema

Request content format

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "A representation of a product",
    "type": "object",
    "required": ["sku", "name"],
    "properties": {
        "sku": {"type":"string"},
        "base_sku": {"type":"string"},
        "name": {"type":"string", "minLength": 1},
        "base_name": {"type": "string"},
        "brand": {"type":"string"},
        "description": {"type":"string"},
        "url": {"type":"string"},
        "image_url": {"type":"string"},
        "thumbnail_url": {"type":"string"},
        "price": {"type":"number"},
        "offer_price": {"type":"number"},        
        "stock": {"type":"number"},
        "available": {"type":"boolean"},
        "release_date": {"type":"string"},
        "category": {
            "type": "array",
            "items": {
                "oneOf": [
                    {
                        "type": "string",
                        "minLength" : 1,
                        "maxLength" : 100
                    },
                    {
                        "type": "object",
                        "required": ["id", "name" ],
                        "properties": {
                            "id": {
                                "type" : "string",
                                "minLength" : 1,
                                "maxLength" : 64
                            },
                            "name": {
                                "type" : "string",
                                "minLength" : 1,
                                "maxLength" : 100
                            },
                            "url": { "type": "string" },
                            "image_url": { "type": "string" }
                        }
                    }
                ]
            }
        },
        "specifications": {
            "type": "array",
            "items": {
                "type": "object",
                "required": ["name", "value"],
                "properties": {
                    "name": { "type": "string" },
                    "value": { "type": "string" }
                }
            }
        },
        "metadata": {
            "type": "object"
        },
        "with_extension_warranty": { "type": "boolean" },
        "custom_attributes": { "type": "object" }
    }
}

Example

This is a valid purchase according to the previous json-schema:

This is a curl example:

Errors

HttpCode

HttpCode Name

Code

Description

201

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters, view message for more details

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

internal_error

Unexpected error

POST /products/bulk

Create multiple products in one request. This endpoint is equal to /products but accept an array of products.

This is an example with 2 products in one request:

Errors

HttpCode

HttpCode Name

Code

Description

201

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters, view message for more details

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

internal_error

Unexpected error

PUT /products/{id}

Update product's information. The {id} parameter is required and can be: the product's code encoded or the product's id.

This is an example to update the stock and the availability of the product according to the json schema on the POST section:

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

400

bad request

bad_request

Invalid parameters, view message for more details

404

not found

not_found

Product not found

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

internal_error

Unexpected error

GET /products/{id}/exist

Test if a product exist by id/sku. The {id} parameter is required and can be: the product's code encoded or the product's id.

Parameter

Type

Required

Description

id

uri

Yes

Product ID or encoded sku

Example

Response

Errors

HttpCode

HttpCode Name

Code

Description

200

ok

ok

Request successful

429

too many requests

too_many_requests

API's requests-per-second limit exceeded

500

internal error

internal_error

Unexpected error

Last updated

Was this helpful?