1. Catalog REST API

1.1. General Jeeshop REST principles

1.1.1. Methods

Method Operations

GET

Get a single resource or get a collection of resources.

POST

Create a new resource.

PUT

Update properties of an existing resource.

DELETE

Delete an existing resource.

HEAD

Check authentication credentials. (Only available on User resource)

The media-type of HTTP requests should be set to application/json.
The media-type of HTTP responses is always application/json unless binary content is requested (eg. deployment resource data), the media-type of the content is used.

Items relationships are always lazy loaded and must be explicitly requested to get them. (they are not eagerly fetched)

1.1.2. Authentication and authorization

Jeeshop REST API operations are protected by role based access. Therefore, most of REST operations require authentication.
Jeeshop authentication and authorization are managed using JaaS. See this documentation for details about Jeeshop JaaS configuration on Wildfly application server.
Currently, only Basic HTTP access authentication is documented, so you should include a Authorization: Basic ...== HTTP-header when performing requests to API methods which are not public.

For security purpose we only allow Basic Authentication in combination with HTTPS. See this documentation for details about Jeeshop SSL configuration on Wildfly application server.

Each REST operation documentation declares one or many roles which are required for method use :

  • admin - Role dedicated to admin / back office operations. (Typically, it has to be set on Jeeshop administrators accounts for Jeeshop-Admin application use)

  • user - Default role bound to Jeeshop users. (Every online store registered users have this role)

  • ALL - Public. Methods which declare this role are public. Authentication is not required for their use.

1.2. Catalogs resource

Manages catalog items and their relationships.

1.2.1. Get all catalog items

URL

/rs/catalogs

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

start

No

results start offset

size

No

results size

orderBy

No

sort criteria. Defaults to id.
Possible values are : id | name | description | startDate | endDate | disabled

isDesc

No

sort direction. Defaults to false.
Possible values are : true | false

Response HTTP statuses

Code

Meaning

200

Success

Response Body

[
  {
    "id": 1,
    "name": "Hyperbike catalog",
    "description": "Catalog of Hyperbike store",
    "disabled": false,
    "startDate": null,
    "endDate": null,
    "visible": true,
    "localizedPresentation": null,
    "rootCategoriesIds": null
  }
  {
      "id": 2,
      "name": "Other catalog",
      "description": "Another catalog",
      "disabled": true,
      "startDate": null,
      "endDate": null,
      "visible": true,
      "localizedPresentation": null,
      "rootCategoriesIds": null
    }
]

1.2.2. Get catalog items count

URL

/rs/catalogs/count

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

Response HTTP statuses

Code

Meaning

200

Success

Response Body

Unresolved directive in <stdin> - include::snippets/catalog_count.json.adoc[]

1.2.3. Get a specific catalog

URL

/rs/catalogs/[id]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation item (localized content) in response

Response HTTP statuses

Code

Meaning

200

Success

403

When provided authenticated has user role (not admin) and item is not visible

404

When no item found matching given parameters

Response Body

{
  "id": 1,
  "name": "Hyperbike catalog",
  "description": "Catalog of Hyperbike store",
  "disabled": false,
  "startDate": null,
  "endDate":" null,
  "visible": true,
  "localizedPresentation": null,
  "rootCategoriesIds": null
}

1.2.4. Create a catalog

URL

/rs/catalogs

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item

Yes

The catalog item to create.
Mandatory properties are : name

Request Body

{
  "name": "Hyperbike catalog",
  "description": "Catalog of Hyperbike store",
  "disabled": false,
  "startDate":1403067172000,
  "endDate":1403067172000,
  "rootCategoriesIds":[1,2]
}

Response HTTP statuses

Code

Meaning

200

Success

Response Body

{
  "id": 1,
  "name": "Hyperbike catalog",
  "description": "Catalog of Hyperbike store",
  "disabled": false,
  "startDate": null,
  "endDate":" null,
  "visible": true,
  "localizedPresentation": null,
  "rootCategoriesIds": null
}

1.2.5. Modify a catalog

URL

/rs/catalogs

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item

Yes

The catalog item to modify.
Mandatory properties are : name

Request Body

{
  "id": 1,
  "name": "Hyperbike catalog",
  "description": "Catalog of Hyperbike store",
  "disabled": false,
  "startDate": null,
  "endDate":" null,
  "visible": true,
  "localizedPresentation": null,
  "rootCategoriesIds": null
}

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 1,
  "name": "Hyperbike catalog",
  "description": "Catalog of Hyperbike store",
  "disabled": false,
  "startDate": null,
  "endDate":" null,
  "visible": true,
  "localizedPresentation": null,
  "rootCategoriesIds": null
}

1.2.6. Delete a catalog

URL

/rs/catalogs/[id]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item to delete

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

URL

/rs/catalogs/[id]/presentationslocales

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

["fr_FR","en_GB"]

1.2.8. Get catalog localized content

URL

/rs/catalogs/[id]/presentations/[locale]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.2.9. Delete catalog localized content

URL

/rs/catalogs/[id]/presentations/[locale]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.2.10. Create catalog localized content

URL

/rs/catalogs/[id]/presentations/[locale]

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When there is an existing presentation configured for given locale

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.2.11. Modify catalog localized content

URL

/rs/catalogs/[id]/presentations/[locale]

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When not presentation found matching given parameters

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Catalogue des vélos",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "remi.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

URL

/rs/catalogs/[id]/categories

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

catalog item id

Yes

id of the catalog item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
    {
        "id": 1,
        "name": "Bikes",
        "description": "Bikes main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    },
    {
        "id": 2,
        "name": "Accessories",
        "description": "Accessories main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    }
]

1.3. Categories resource

Manages category items and their relationships.

1.3.1. Get all category items

URL

/rs/categories

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

start

No

results start offset

size

No

results size

orderBy

No

sort criteria. Defaults to id.
Possible values are : id | name | description | startDate | endDate | disabled

isDesc

No

sort direction. Defaults to false.
Possible values are : true | false

Response HTTP statuses

Code

Meaning

200

Success

Response Body

[
    {
        "id": 1,
        "name": "Bikes",
        "description": "Bikes main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    },
    {
        "id": 2,
        "name": "Accessories",
        "description": "Accessories main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    }
]

1.3.2. Get category items count

URL

/rs/categories/count

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

Response HTTP statuses

Code

Meaning

200

Success

Response Body

Unresolved directive in <stdin> - include::snippets/category_count.json.adoc[]

1.3.3. Get a specific category

URL

/rs/categories/[id]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

category item id

Yes

id of the category item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation item (localized content) in response

Response HTTP statuses

Code

Meaning

200

Success

403

When provided authenticated has user role (not admin) and item is not visible

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "name": "VTT",
  "description": "VTT rubric",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "childCategoriesIds": null,
  "childProductsIds": null
}

1.3.4. Create a category

URL

/rs/categories

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

category item

Yes

The category item to create.
Mandatory properties are : name

Request Body

{
  "id": 7,
  "name": "VTT",
  "description": "VTT rubric",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "childCategoriesIds": null,
  "childProductsIds": [1,2]
}

Response HTTP statuses

Code

Meaning

200

Success

Response Body

{
  "id": 7,
  "name": "VTT",
  "description": "VTT rubric",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "childCategoriesIds": null,
  "childProductsIds": null
}

1.3.5. Modify a category

URL

/rs/categories

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

category item

Yes

The category item to modify.
Mandatory properties are : name

Request Body

{
  "id": 7,
  "name": "VTT",
  "description": "VTT rubric",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "childCategoriesIds": null,
  "childProductsIds": null
}

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "name": "VTT",
  "description": "VTT rubric",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "childCategoriesIds": null,
  "childProductsIds": null
}

1.3.6. Delete a category

URL

/rs/categories/[id]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

category item id

Yes

id of the category item to delete

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

URL

/rs/categories/[id]/presentationslocales

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

category item id

Yes

id of the category item

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

["fr_FR","en_GB"]

1.3.8. Get category localized content

URL

/rs/categories/[id]/presentations/[locale]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

category item id

Yes

id of the category item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

1.3.9. Delete category localized content

URL

/rs/categories/[id]/presentations/[locale]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

category item id

Yes

id of the category item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

1.3.10. Create category localized content

URL

/rs/categories/[id]/presentations/[locale]

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

category item id

Yes

id of the category item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When there is an existing presentation configured for given locale

404

When no item found matching given parameters

Response Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

1.3.11. Modify category localized content

URL

/rs/categories/[id]/presentations/[locale]

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

category item id

Yes

id of the category item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When not presentation found matching given parameters

404

When no item found matching given parameters

Response Body

{
    "id": 10,
    "locale": "fr_FR",
    "displayName": "VTT",
    "promotion": null,
    "shortDescription": "Retrouvez nos meilleurs VTT",
    "mediumDescription": null,
    "longDescription": null,
    "thumbnail": null,
    "smallImage": {
        "id": 56,
        "uri": "vtt_category_small.jpg"
    },
    "largeImage": {
      "id": 56,
      "uri": "vtt_category_large.jpg"
    },
    "video": null,
    "features": {}
}

URL

/rs/categories/[id]/categories

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

category item id

Yes

id of the category item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
    {
        "id": 1,
        "name": "Bikes",
        "description": "Bikes main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    },
    {
        "id": 2,
        "name": "Accessories",
        "description": "Accessories main category",
        "disabled": false,
        "startDate": null,
        "endDate": null,
        "visible": true,
        "localizedPresentation": null,
        "childCategoriesIds": null,
        "childProductsIds": null
    }
]

URL

/rs/categories/[id]/products

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

category item id

Yes

id of the category item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
  {
    "id": 1,
    "name": "Energy X1",
    "description": "VTT energy X1",
    "disabled": false,
    "startDate": null,
    "endDate": null,
    "visible": true,
    "localizedPresentation": null,
    "childSKUsIds": null,
    "discountsIds": null
  },
  {
    "id": 2,
    "name": "Energy X2",
    "description": "VTT Energy X2",
    "disabled": false,
    "startDate": 1403067172000,
    "endDate": 1402980772000,
    "visible": false,
    "localizedPresentation": null,
    "childSKUsIds": null,
    "discountsIds": null
  }
]

1.4. Products resource

Manages product items and their relationships.

1.4.1. Get all product items

URL

/rs/products

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

start

No

results start offset

size

No

results size

orderBy

No

sort criteria. Defaults to id.
Possible values are : id | name | description | startDate | endDate | disabled

isDesc

No

sort direction. Defaults to false.
Possible values are : true | false

Response HTTP statuses

Code

Meaning

200

Success

Response Body

[
  {
    "id": 1,
    "name": "Energy X1",
    "description": "VTT energy X1",
    "disabled": false,
    "startDate": null,
    "endDate": null,
    "visible": true,
    "localizedPresentation": null,
    "childSKUsIds": null,
    "discountsIds": null
  },
  {
    "id": 2,
    "name": "Energy X2",
    "description": "VTT Energy X2",
    "disabled": false,
    "startDate": 1403067172000,
    "endDate": 1402980772000,
    "visible": false,
    "localizedPresentation": null,
    "childSKUsIds": null,
    "discountsIds": null
  }
]

1.4.2. Get product items count

URL

/rs/products/count

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

Response HTTP statuses

Code

Meaning

200

Success

Response Body

Unresolved directive in <stdin> - include::snippets/product_count.json.adoc[]

1.4.3. Get a specific product

URL

/rs/products/[id]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

product item id

Yes

id of the product item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation item (localized content) in response

Response HTTP statuses

Code

Meaning

200

Success

403

When provided authenticated has user role (not admin) and item is not visible

404

When no item found matching given parameters

Response Body

{
  "id": 2,
  "name": "Energy X2",
  "description": "VTT Energy X2",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1402980772000,
  "visible": false,
  "localizedPresentation": null,
  "childSKUsIds": null,
  "discountsIds": null
}

1.4.4. Create a product

URL

/rs/products

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

product item

Yes

The product item to create.
Mandatory properties are : name

Request Body

{
  "id": 2,
  "name": "Energy X2",
  "description": "VTT Energy X2",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1402980772000,
  "visible": false,
  "localizedPresentation": null,
  "childSKUsIds": [3],
  "discountsIds": null
}

Response HTTP statuses

Code

Meaning

200

Success

Response Body

{
  "id": 2,
  "name": "Energy X2",
  "description": "VTT Energy X2",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1402980772000,
  "visible": false,
  "localizedPresentation": null,
  "childSKUsIds": null,
  "discountsIds": null
}

1.4.5. Modify a product

URL

/rs/products

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

product item

Yes

The product item to modify.
Mandatory properties are : name

Request Body

{
  "id": 2,
  "name": "Energy X2",
  "description": "VTT Energy X2",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1402980772000,
  "visible": false,
  "localizedPresentation": null,
  "childSKUsIds": null,
  "discountsIds": null
}

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 2,
  "name": "Energy X2",
  "description": "VTT Energy X2",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1402980772000,
  "visible": false,
  "localizedPresentation": null,
  "childSKUsIds": null,
  "discountsIds": null
}

1.4.6. Delete a product

URL

/rs/products/[id]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

product item id

Yes

id of the product item to delete

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

URL

/rs/products/[id]/presentationslocales

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

product item id

Yes

id of the product item

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

["fr_FR","en_GB"]

1.4.8. Get product localized content

URL

/rs/products/[id]/presentations/[locale]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

product item id

Yes

id of the product item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

1.4.9. Delete product localized content

URL

/rs/products/[id]/presentations/[locale]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

product item id

Yes

id of the product item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

1.4.10. Create product localized content

URL

/rs/products/[id]/presentations/[locale]

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

product item id

Yes

id of the product item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When there is an existing presentation configured for given locale

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

1.4.11. Modify product localized content

URL

/rs/products/[id]/presentations/[locale]

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

product item id

Yes

id of the product item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When not presentation found matching given parameters

404

When no item found matching given parameters

Response Body

{
  "id": 7,
  "locale": "en_US",
  "displayName": "Energy 2 mountain bike",
  "promotion": null,
  "shortDescription": "The new Energy mountain bike produced by Bikester",
  "mediumDescription": null,
  "longDescription": "This new mountain bike gives you amazing sensations on city streets, or mountain trails.",
  "thumbnail": {
    "id": 24,
    "uri": "vtt_thumbnail.jpg"
  },
  "smallImage": {
    "id": 23,
    "uri": "vtt_small.jpg"
  },
  "largeImage": {
    "id": 22,
    "uri": "vtt_large.jpg"
  },
  "video": null,
  "features": {}
}

URL

/rs/products/[id]/skus

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

product item id

Yes

id of the product item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
  {
    "id": 1,
    "name": "Energy X1 batch of 10",
    "description": "Energy X1 batch of 10",
    "disabled": false,
    "startDate": 1403067172000,
    "endDate": 1412139172000,
    "visible": false,
    "localizedPresentation": null,
    "price": 10.0,
    "currency": "EUR",
    "reference": "X1213JJLB-1",
    "threshold": 3,
    "quantity": 100,
    "discountsIds": null,
    "available": true
  },
  {
    "id": 2,
    "name": "Energy X1 batch of 50",
    "description": "Energy X1 batch of 50",
    "disabled": true,
    "startDate": 1412225572000,
    "endDate": 1420091572000,
    "visible": false,
    "localizedPresentation": null,
    "price": 10.0,
    "currency": null,
    "reference": "X1213JJLB-2",
    "threshold": 3,
    "quantity": 100,
    "discountsIds": null,
    "available": true
  }
]

URL

/rs/products/[id]/discounts

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

product item id

Yes

id of the product item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
    {
      "id": 4,
      "name": "First order - 10 percent",
      "description": "10 percent off for user first order",
      "disabled": false,
      "startDate": null,
      "endDate": null,
      "visible": true,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "DISCOUNT_RATE",
      "triggerRule": "ORDER_NUMBER",
      "applicableTo": "ORDER",
      "triggerValue": 1.0,
      "discountValue": 20.0,
      "rateType": true,
      "uniqueUse": true
    },
    {
      "id": 5,
      "name": "Christmas 2015 - Free delivery fee",
      "description": "Free delivery fee for christmas",
      "disabled": false,
      "startDate": 1418598000000,
      "endDate": 1419980400000,
      "visible": false,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "SHIPPING_FEE_DISCOUNT_AMOUNT",
      "triggerRule": null,
      "applicableTo": "ORDER",
      "triggerValue": null,
      "discountValue": 12.0,
      "rateType": false,
      "uniqueUse": false
    }
]

1.5. Stock Keeping Units resource

Manages sku items and their relationships.

1.5.1. Get all sku items

URL

/rs/skus

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

start

No

results start offset

size

No

results size

orderBy

No

sort criteria. Defaults to id.
Possible values are : id | name | description | startDate | endDate | disabled

isDesc

No

sort direction. Defaults to false.
Possible values are : true | false

Response HTTP statuses

Code

Meaning

200

Success

Response Body

[
  {
    "id": 1,
    "name": "Energy X1 batch of 10",
    "description": "Energy X1 batch of 10",
    "disabled": false,
    "startDate": 1403067172000,
    "endDate": 1412139172000,
    "visible": false,
    "localizedPresentation": null,
    "price": 10.0,
    "currency": "EUR",
    "reference": "X1213JJLB-1",
    "threshold": 3,
    "quantity": 100,
    "discountsIds": null,
    "available": true
  },
  {
    "id": 2,
    "name": "Energy X1 batch of 50",
    "description": "Energy X1 batch of 50",
    "disabled": true,
    "startDate": 1412225572000,
    "endDate": 1420091572000,
    "visible": false,
    "localizedPresentation": null,
    "price": 10.0,
    "currency": null,
    "reference": "X1213JJLB-2",
    "threshold": 3,
    "quantity": 100,
    "discountsIds": null,
    "available": true
  }
]

1.5.2. Get sku items count

URL

/rs/skus/count

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

Response HTTP statuses

Code

Meaning

200

Success

Response Body

Unresolved directive in <stdin> - include::snippets/sku_count.json.adoc[]

1.5.3. Get a specific sku

URL

/rs/skus/[id]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation item (localized content) in response

Response HTTP statuses

Code

Meaning

200

Success

403

When provided authenticated has user role (not admin) and item is not visible

404

When no item found matching given parameters

Response Body

{
  "id": 1,
  "name": "Energy X1 batch of 10",
  "description": "Energy X1 batch of 10",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1412139172000,
  "visible": false,
  "localizedPresentation": null,
  "price": 10.0,
  "currency": "EUR",
  "reference": "X1213JJLB-1",
  "threshold": 3,
  "quantity": 100,
  "discountsIds": null,
  "available": true
}

1.5.4. Create a sku

URL

/rs/skus

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

sku item

Yes

The sku item to create.
Mandatory properties are : name

Request Body

{
  "id": 1,
  "name": "Energy X1 batch of 10",
  "description": "Energy X1 batch of 10",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1412139172000,
  "visible": false,
  "localizedPresentation": null,
  "price": 10.0,
  "currency": "EUR",
  "reference": "X1213JJLB-1",
  "threshold": 3,
  "quantity": 100,
  "discountsIds": null,
  "available": true
}

Response HTTP statuses

Code

Meaning

200

Success

Response Body

{
  "id": 1,
  "name": "Energy X1 batch of 10",
  "description": "Energy X1 batch of 10",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1412139172000,
  "visible": false,
  "localizedPresentation": null,
  "price": 10.0,
  "currency": "EUR",
  "reference": "X1213JJLB-1",
  "threshold": 3,
  "quantity": 100,
  "discountsIds": null,
  "available": true
}

1.5.5. Modify a sku

URL

/rs/skus

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

sku item

Yes

The sku item to modify.
Mandatory properties are : name

Request Body

{
  "id": 1,
  "name": "Energy X1 batch of 10",
  "description": "Energy X1 batch of 10",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1412139172000,
  "visible": false,
  "localizedPresentation": null,
  "price": 10.0,
  "currency": "EUR",
  "reference": "X1213JJLB-1",
  "threshold": 3,
  "quantity": 100,
  "discountsIds": null,
  "available": true
}

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 1,
  "name": "Energy X1 batch of 10",
  "description": "Energy X1 batch of 10",
  "disabled": false,
  "startDate": 1403067172000,
  "endDate": 1412139172000,
  "visible": false,
  "localizedPresentation": null,
  "price": 10.0,
  "currency": "EUR",
  "reference": "X1213JJLB-1",
  "threshold": 3,
  "quantity": 100,
  "discountsIds": null,
  "available": true
}

1.5.6. Delete a sku

URL

/rs/skus/[id]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item to delete

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

URL

/rs/skus/[id]/presentationslocales

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

["fr_FR","en_GB"]

1.5.8. Get sku localized content

URL

/rs/skus/[id]/presentations/[locale]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.5.9. Delete sku localized content

URL

/rs/skus/[id]/presentations/[locale]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.5.10. Create sku localized content

URL

/rs/skus/[id]/presentations/[locale]

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When there is an existing presentation configured for given locale

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.5.11. Modify sku localized content

URL

/rs/skus/[id]/presentations/[locale]

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When not presentation found matching given parameters

404

When no item found matching given parameters

Response Body

{
    "id": 9,
    "locale": "fr_FR",
    "displayName": "Unité de stock",
    "promotion": null,
    "shortDescription": "Description courte ...",
    "mediumDescription": "Description moyenne ...",
    "longDescription": "Description longue ...",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "hello.png"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

URL

/rs/skus/[id]/discounts

Method

GET

Roles allowed

All

Parameters

Name Mandatory Description

sku item id

Yes

id of the sku item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation items (localized content) matching given locale

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found with given parameters

Response Body

[
    {
      "id": 4,
      "name": "First order - 10 percent",
      "description": "10 percent off for user first order",
      "disabled": false,
      "startDate": null,
      "endDate": null,
      "visible": true,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "DISCOUNT_RATE",
      "triggerRule": "ORDER_NUMBER",
      "applicableTo": "ORDER",
      "triggerValue": 1.0,
      "discountValue": 20.0,
      "rateType": true,
      "uniqueUse": true
    },
    {
      "id": 5,
      "name": "Christmas 2015 - Free delivery fee",
      "description": "Free delivery fee for christmas",
      "disabled": false,
      "startDate": 1418598000000,
      "endDate": 1419980400000,
      "visible": false,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "SHIPPING_FEE_DISCOUNT_AMOUNT",
      "triggerRule": null,
      "applicableTo": "ORDER",
      "triggerValue": null,
      "discountValue": 12.0,
      "rateType": false,
      "uniqueUse": false
    }
]

1.6. Discounts resource

Manages discount items and their relationships.

1.6.1. Get all discount items

URL

/rs/discounts

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

start

No

results start offset

size

No

results size

orderBy

No

sort criteria. Defaults to id.
Possible values are : id | name | description | startDate | endDate | disabled

isDesc

No

sort direction. Defaults to false.
Possible values are : true | false

Response HTTP statuses

Code

Meaning

200

Success

Response Body

[
    {
      "id": 4,
      "name": "First order - 10 percent",
      "description": "10 percent off for user first order",
      "disabled": false,
      "startDate": null,
      "endDate": null,
      "visible": true,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "DISCOUNT_RATE",
      "triggerRule": "ORDER_NUMBER",
      "applicableTo": "ORDER",
      "triggerValue": 1.0,
      "discountValue": 20.0,
      "rateType": true,
      "uniqueUse": true
    },
    {
      "id": 5,
      "name": "Christmas 2015 - Free delivery fee",
      "description": "Free delivery fee for christmas",
      "disabled": false,
      "startDate": 1418598000000,
      "endDate": 1419980400000,
      "visible": false,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "SHIPPING_FEE_DISCOUNT_AMOUNT",
      "triggerRule": null,
      "applicableTo": "ORDER",
      "triggerValue": null,
      "discountValue": 12.0,
      "rateType": false,
      "uniqueUse": false
    }
]

1.6.2. Get discount items count

URL

/rs/discounts/count

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

search

No

Search criteria. Value should match item’s id, name or description

Response HTTP statuses

Code

Meaning

200

Success

Response Body

Unresolved directive in <stdin> - include::snippets/discount_count.json.adoc[]

1.6.3. Get a specific discount

URL

/rs/discounts/[id]

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item to retrieve

locale

No

For sample en_GB. Can be provided for user role to get localized related presentation item (localized content) in response

Response HTTP statuses

Code

Meaning

200

Success

403

When provided authenticated has user role (not admin) and item is not visible

404

When no item found matching given parameters

Response Body

{
  "id": 4,
  "name": "First order - 10 percent",
  "description": "10 percent off for user first order",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "voucherCode": null,
  "usesPerCustomer": 1,
  "type": "DISCOUNT_RATE",
  "triggerRule": "ORDER_NUMBER",
  "applicableTo": "ORDER",
  "triggerValue": 1.0,
  "discountValue": 20.0,
  "rateType": true,
  "uniqueUse": true
}

1.6.4. Create a discount

URL

/rs/discounts

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

discount item

Yes

The discount item to create.
Mandatory properties are : name

Request Body

{
  "id": 4,
  "name": "First order - 10 percent",
  "description": "10 percent off for user first order",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "voucherCode": null,
  "usesPerCustomer": 1,
  "type": "DISCOUNT_RATE",
  "triggerRule": "ORDER_NUMBER",
  "applicableTo": "ORDER",
  "triggerValue": 1.0,
  "discountValue": 20.0,
  "rateType": true,
  "uniqueUse": true
}

Response HTTP statuses

Code

Meaning

200

Success

Response Body

{
  "id": 4,
  "name": "First order - 10 percent",
  "description": "10 percent off for user first order",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "voucherCode": null,
  "usesPerCustomer": 1,
  "type": "DISCOUNT_RATE",
  "triggerRule": "ORDER_NUMBER",
  "applicableTo": "ORDER",
  "triggerValue": 1.0,
  "discountValue": 20.0,
  "rateType": true,
  "uniqueUse": true
}

1.6.5. Modify a discount

URL

/rs/discounts

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

discount item

Yes

The discount item to modify.
Mandatory properties are : name

Request Body

{
  "id": 4,
  "name": "First order - 10 percent",
  "description": "10 percent off for user first order",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "voucherCode": null,
  "usesPerCustomer": 1,
  "type": "DISCOUNT_RATE",
  "triggerRule": "ORDER_NUMBER",
  "applicableTo": "ORDER",
  "triggerValue": 1.0,
  "discountValue": 20.0,
  "rateType": true,
  "uniqueUse": true
}

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
  "id": 4,
  "name": "First order - 10 percent",
  "description": "10 percent off for user first order",
  "disabled": false,
  "startDate": null,
  "endDate": null,
  "visible": true,
  "localizedPresentation": null,
  "voucherCode": null,
  "usesPerCustomer": 1,
  "type": "DISCOUNT_RATE",
  "triggerRule": "ORDER_NUMBER",
  "applicableTo": "ORDER",
  "triggerValue": 1.0,
  "discountValue": 20.0,
  "rateType": true,
  "uniqueUse": true
}

1.6.6. Delete a discount

URL

/rs/discounts/[id]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item to delete

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

URL

/rs/discounts/[id]/presentationslocales

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

["fr_FR","en_GB"]

1.6.8. Get discount localized content

URL

/rs/discounts/[id]/presentations/[locale]

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.6.9. Delete discount localized content

URL

/rs/discounts/[id]/presentations/[locale]

Method

DELETE

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item

locale

Yes

For sample en_GB.

Response HTTP statuses

Code

Meaning

200

Success

404

When no item found matching given parameters

Response Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.6.10. Create discount localized content

URL

/rs/discounts/[id]/presentations/[locale]

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When there is an existing presentation configured for given locale

404

When no item found matching given parameters

Response Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

1.6.11. Modify discount localized content

URL

/rs/discounts/[id]/presentations/[locale]

Method

PUT

Roles allowed

admin

Parameters

Name Mandatory Description

discount item id

Yes

id of the discount item

locale

Yes

For sample en_GB.

Presentation object

Yes

a valid Presentation object

Request Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

Response HTTP statuses

Code

Meaning

200

Success

400

When not presentation found matching given parameters

404

When no item found matching given parameters

Response Body

{
    "id": 33,
    "locale": "en_US",
    "displayName": "Free delivery fee for christmas !",
    "promotion": null,
    "shortDescription": "Delivery fee is free for all orders for Christmas.",
    "mediumDescription": "",
    "longDescription": "",
    "thumbnail": null,
    "smallImage": {
        "id": 26,
        "uri": "free_delivery_fee.jpg"
    },
    "largeImage": null,
    "video": null,
    "features": {}
}

URL

/rs/discounts/visible

Method

GET

Roles allowed

ALL

Parameters

Name Mandatory Description

applicableTo

Yes

Possible values are : ORDER, ITEM

locale

No

For sample en_GB. Can be provided to get localized related presentation item (localized content) in response

Code

Meaning

200

Success

Response Body

[
    {
      "id": 4,
      "name": "First order - 10 percent",
      "description": "10 percent off for user first order",
      "disabled": false,
      "startDate": null,
      "endDate": null,
      "visible": true,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "DISCOUNT_RATE",
      "triggerRule": "ORDER_NUMBER",
      "applicableTo": "ORDER",
      "triggerValue": 1.0,
      "discountValue": 20.0,
      "rateType": true,
      "uniqueUse": true
    },
    {
      "id": 5,
      "name": "Christmas 2015 - Free delivery fee",
      "description": "Free delivery fee for christmas",
      "disabled": false,
      "startDate": 1418598000000,
      "endDate": 1419980400000,
      "visible": false,
      "localizedPresentation": null,
      "voucherCode": null,
      "usesPerCustomer": 1,
      "type": "SHIPPING_FEE_DISCOUNT_AMOUNT",
      "triggerRule": null,
      "applicableTo": "ORDER",
      "triggerValue": null,
      "discountValue": 12.0,
      "rateType": false,
      "uniqueUse": false
    }
]

1.7. Medias resource

1.7.1. Get a specific media file

URL

/rs/medias/[type]/[id]/[locale]/[filename]

Method

GET

Roles allowed

admin

Parameters

Name Mandatory Description

type

Yes

Media related item type such as "product" or "category"

id

Yes

Media related item id

locale

No

For sample en_GB

filename

No

media file name

Response HTTP statuses

Code

Meaning

200

Success

404

No result found matching given parameters

1.7.2. Upload a media file

URL

/rs/medias/[type]/[id]/[locale]/upload

Method

POST

Roles allowed

admin

Parameters

Name Mandatory Description

type

Yes

Media related item type such as "product" or "category"

id

Yes

Media related item id

locale

No

For sample en_GB

Request header

Content-Type = "multipart/form-data"

Response HTTP statuses

Code

Meaning

200

Success

500

In case of internal error during upload