# E-Commerce APIs

# Product-Model

# Create Product-Model

Method: POST Path: /shop/api/projects/{projId}/product-models
Description: Create product model

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
brand The brand of product Object N
name The name of data source in a map of the language short key and name value. Object N
shops The list of shops of product List N
categories The list of categories List N
tags The list of tags List N
status The status of product if this available that status is 'ACTIVE'. String Y
linkMap The mapping link to other platforms. Object N
metadata The custom attribute of product. Object N
soldAmount The amount to sell this product. Object N
rating The rating this product Object N
shippingFrom The name of location to shipping this product. Object N
shippingFee The shipping fee of this product. Object N
specification The specific of product's description. Object N
attributes The list of product attributes e.g., color, size, etc. List N
variants The list of product variants Object N
deliverableStatus The status that indicates if product will be deliverable Object N
publishedStatus The status that indicates if product will be published Object N
imageUrls The urls of images this product Object N
thumbnails The thumbnails of this product Object N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "name": {
              "en": "ultraboot ",
              "th": "ultraboot "
          },
          "status": "ACTIVE",
          "price": {},
          "publishedStatus": {},
          "deliverableStatus": {},
          "linkMap": {},
          "thumbnails": {},
          "imageUrls": [],
          "attributes": [],
          "metadata": {},
          "brand": {
              "createdBy": "66897977620",
              "createdDate": "2020-10-09T12:19:02.675Z",
              "lastModifiedBy": "66897977620",
              "lastModifiedDate": "2020-10-22T08:38:33.180422Z",
              "id": "5f805536e85d8d22d60c948b",
              "name": {
                  "th": "อดิดาส",
                  "en": "adidas"
              },
              "description": null,
              "logoImages": {
                  "icon": "",
                  "logo": ""
              },
              "rating": null,
              "ratingCount": null,
              "status": "ACTIVE",
              "projectId": "5f6467cf723c4100015af031",
              "linkMap": {
                  "website": "",
                  "facebook": ""
              },
              "note": null,
              "aboutUs": null,
              "categories": [],
              "metadata": {}
          },
          "categories": [
              {
                  "id": "5f72beabfc38307c3bf59f8f",
                  "projectId": "5f6467cf723c4100015af031",
                  "name": {
                      "en": "men",
                      "th": "ผู้ชาย"
                  },
                  "status": "ACTIVE",
                  "group": "PRODUCT"
              }
          ],
          "rating": {},
          "soldAmount": {}
      }'

Response Example:

HTTP/1.1 201 CREATED
{
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T08:18:06.871Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T08:18:06.871Z",
    "id": "5f96863e3931ee1e04225c8f",
    "name": {
        "en": "ultraboot ",
        "th": "ultraboot "
    },
    "description": {},
    "status": "ACTIVE",
    "publishedStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "attributes": [],
    "imageUrls": [],
    "thumbnails": {},
    "metadata": {},
    "variants": null,
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-09T12:19:02.675Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-22T08:38:33.180Z",
        "id": "5f805536e85d8d22d60c948b",
        "name": {
            "en": "adidas",
            "th": "อดิดาส"
        },
        "description": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "projectId": "5f6467cf723c4100015af031",
        "linkMap": {
            "website": "",
            "facebook": ""
        },
        "note": null,
        "aboutUs": null,
        "categories": [],
        "metadata": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "categories": [
        {
            "id": "5f72beabfc38307c3bf59f8f",
            "projectId": "5f6467cf723c4100015af031",
            "name": {
                "en": "men",
                "th": "ผู้ชาย"
            },
            "status": "ACTIVE",
            "group": "PRODUCT"
        }
    ],
    "tags": [],
    "soldAmount": {},
    "rating": {},
    "shippingFrom": {},
    "shippingFee": {},
    "specification": {},
    "shops": [],
    "keywords": [],
    "monitoringPrice": false,
    "calculated": {},
    "externalRef": null,
    "batchId": null,
    "source": null
}

# Update Product-Model

Method: PUT
Path: /shop/api/projects/{projId}/product-models
Description: Update a product model

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id The id of product model. String Y
brand The brand of product Object N
name The name of data source in a map of the language short key and name value. Object N
shops The list of shops of product List N
categories The list of categories List N
tags The list of tags List N
status The status of product if this available that status is 'ACTIVE'. String Y
linkMap The mapping link to other platforms. Object N
metadata The custom attribute of product. Object N
soldAmount The amount to sell this product. Object N
rating The rating this product Object N
shippingFrom The name of location to shipping this product. Object N
shippingFee The shipping fee of this product. Object N
specification The specific of product's description. Object N
attributes The list of product attributes e.g., color, size, etc. List N
variants The list of product variants Object N
deliverableStatus The status that indicates if product will be deliverable Object N
publishedStatus The status that indicates if product will be published Object N
imageUrls The urls of images this product Object N
thumbnails The thumbnails of this product Object N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "createdBy": "66897977620",
          "createdDate": "2020-10-26T08:18:06.871Z",
          "lastModifiedBy": "66897977620",
          "lastModifiedDate": "2020-10-26T08:18:06.871Z",
          "id": "5f96863e3931ee1e04225c8f",
          "name": {
              "en": "ultraboot blue",
              "th": "ultraboot blue"
          },
          "description": {},
          "status": "ACTIVE",
          "publishedStatus": {},
          "deliverableStatus": {},
          "linkMap": {},
          "attributes": [],
          "imageUrls": [],
          "thumbnails": {},
          "metadata": {},
          "variants": null,
          "projectId": "5f6467cf723c4100015af031",
          "brand": {
              "createdBy": "66897977620",
              "createdDate": "2020-10-09T12:19:02.675Z",
              "lastModifiedBy": "66897977620",
              "lastModifiedDate": "2020-10-22T08:38:33.180Z",
              "id": "5f805536e85d8d22d60c948b",
              "name": {
                  "en": "adidas",
                  "th": "อดิดาส"
              },
              "description": null,
              "logoImages": {
                  "logo": "",
                  "icon": ""
              },
              "rating": null,
              "ratingCount": null,
              "status": "ACTIVE",
              "projectId": "5f6467cf723c4100015af031",
              "linkMap": {
                  "website": "",
                  "facebook": ""
              },
              "note": null,
              "aboutUs": null,
              "categories": [],
              "metadata": {},
              "externalRef": null,
              "batchId": null,
              "source": null
          },
          "categories": [
              {
                  "id": "5f72beabfc38307c3bf59f8f",
                  "projectId": "5f6467cf723c4100015af031",
                  "name": {
                      "en": "men",
                      "th": "ผู้ชาย"
                  },
                  "status": "ACTIVE",
                  "group": "PRODUCT"
              }
          ],
          "tags": [],
          "soldAmount": {},
          "rating": {},
          "shippingFrom": {},
          "shippingFee": {},
          "specification": {},
          "shops": [],
          "keywords": [],
          "monitoringPrice": false,
          "calculated": {},
          "externalRef": null,
          "batchId": null,
          "source": null
      }'

Response Example:

HTTP/1.1 200 OK
{
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T08:18:06.871Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T08:22:05.567Z",
    "id": "5f96863e3931ee1e04225c8f",
    "name": {
        "en": "ultraboot blue",
        "th": "ultraboot blue"
    },
    "description": {},
    "status": "ACTIVE",
    "publishedStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "attributes": [],
    "imageUrls": [],
    "thumbnails": {},
    "metadata": {},
    "variants": null,
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-09T12:19:02.675Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-22T08:38:33.180Z",
        "id": "5f805536e85d8d22d60c948b",
        "name": {
            "en": "adidas",
            "th": "อดิดาส"
        },
        "description": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "projectId": "5f6467cf723c4100015af031",
        "linkMap": {
            "website": "",
            "facebook": ""
        },
        "note": null,
        "aboutUs": null,
        "categories": [],
        "metadata": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "categories": [
        {
            "id": "5f72beabfc38307c3bf59f8f",
            "projectId": "5f6467cf723c4100015af031",
            "name": {
                "en": "men",
                "th": "ผู้ชาย"
            },
            "status": "ACTIVE",
            "group": "PRODUCT"
        }
    ],
    "tags": [],
    "soldAmount": {},
    "rating": {},
    "shippingFrom": {},
    "shippingFee": {},
    "specification": {},
    "shops": [],
    "keywords": [],
    "monitoringPrice": false,
    "calculated": {},
    "externalRef": null,
    "batchId": null,
    "source": null
}

# Get All Product-Model

Method: GET Path: /shop/api/projects/{projId}/product-models
Description: Get list of product model

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
[
    {
        "createdBy": "66897977620",
        "createdDate": "2020-10-26T08:18:06.871Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-26T08:22:05.567Z",
        "id": "5f96863e3931ee1e04225c8f",
        "name": {
            "en": "ultraboot blue",
            "th": "ultraboot blue"
        },
        "description": {},
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [],
        "thumbnails": {},
        "metadata": {},
        "variants": null,
        "projectId": "5f6467cf723c4100015af031",
        "brand": {
            "createdBy": "66897977620",
            "createdDate": "2020-10-09T12:19:02.675Z",
            "lastModifiedBy": "66897977620",
            "lastModifiedDate": "2020-10-22T08:38:33.180Z",
            "id": "5f805536e85d8d22d60c948b",
            "name": {
                "en": "adidas",
                "th": "อดิดาส"
            },
            "description": null,
            "logoImages": {
                "logo": "",
                "icon": ""
            },
            "rating": null,
            "ratingCount": null,
            "status": "ACTIVE",
            "projectId": "5f6467cf723c4100015af031",
            "linkMap": {
                "website": "",
                "facebook": ""
            },
            "note": null,
            "aboutUs": null,
            "categories": [],
            "metadata": {},
            "externalRef": null,
            "batchId": null,
            "source": null
        },
        "categories": [
            {
                "id": "5f72beabfc38307c3bf59f8f",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "en": "men",
                    "th": "ผู้ชาย"
                },
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "shops": [],
        "keywords": [],
        "monitoringPrice": false,
        "calculated": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    }
]

# Get Product-Model

Method: GET Path: /shop/api/projects/{projId}/product-models/{id}
Description: Get a product model.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models/5f96863e3931ee1e04225c8f' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK

    {
        "createdBy": "66897977620",
        "createdDate": "2020-10-26T08:18:06.871Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-26T08:22:05.567Z",
        "id": "5f96863e3931ee1e04225c8f",
        "name": {
            "en": "ultraboot blue",
            "th": "ultraboot blue"
        },
        "description": {},
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [],
        "thumbnails": {},
        "metadata": {},
        "variants": null,
        "projectId": "5f6467cf723c4100015af031",
        "brand": {
            "createdBy": "66897977620",
            "createdDate": "2020-10-09T12:19:02.675Z",
            "lastModifiedBy": "66897977620",
            "lastModifiedDate": "2020-10-22T08:38:33.180Z",
            "id": "5f805536e85d8d22d60c948b",
            "name": {
                "en": "adidas",
                "th": "อดิดาส"
            },
            "description": null,
            "logoImages": {
                "logo": "",
                "icon": ""
            },
            "rating": null,
            "ratingCount": null,
            "status": "ACTIVE",
            "projectId": "5f6467cf723c4100015af031",
            "linkMap": {
                "website": "",
                "facebook": ""
            },
            "note": null,
            "aboutUs": null,
            "categories": [],
            "metadata": {},
            "externalRef": null,
            "batchId": null,
            "source": null
        },
        "categories": [
            {
                "id": "5f72beabfc38307c3bf59f8f",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "en": "men",
                    "th": "ผู้ชาย"
                },
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "shops": [],
        "keywords": [],
        "monitoringPrice": false,
        "calculated": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    }

# Delete Product-Model

Method: DELETE Path: /shop/api/projects/{projId}/product-models/{id}
Description: Delete a product model.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models/5f96863e3931ee1e04225c8f' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 204 No Content

# Search Product-Model

Method: GET Path: /shop/api/projects/{projId}/_search/product-models
Description: Search product model.

Client Scope: product.search
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Parameter:

Key Description Required Example
query The keyword to search product. Y query=status: ACTIVE

Example Request:

curl -X GET \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer {O2O Access Token}' \
    'https://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/_search/product-models?query=status%3A%20ACTIVE'

Response Example:

HTTP/1.1 200 OK
[
  {
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T08:18:06.871Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T08:22:05.567Z",
    "id": "5f96863e3931ee1e04225c8f",
    "name": {
      "en": "ultraboot blue",
      "th": "ultraboot blue"
    },
    "status": "ACTIVE",
    "publishedStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "imageUrls": [],
    "thumbnails": {},
    "attributes": [],
    "metadata": {},
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
      "createdBy": null,
      "createdDate": "2020-10-26T08:22:05.575832Z",
      "lastModifiedBy": null,
      "lastModifiedDate": "2020-10-26T08:22:05.575833Z",
      "id": "5f805536e85d8d22d60c948b",
      "name": {
        "en": "adidas",
        "th": "อดิดาส"
      },
      "description": null,
      "logoImages": {
        "logo": "",
        "icon": ""
      },
      "rating": null,
      "ratingCount": null,
      "status": "ACTIVE",
      "projectId": "5f6467cf723c4100015af031",
      "linkMap": {
        "website": "",
        "facebook": ""
      },
      "note": null,
      "aboutUs": null,
      "categories": [],
      "metadata": {}
    },
    "shops": [],
    "categories": [
      {
        "id": "5f72beabfc38307c3bf59f8f",
        "projectId": "5f6467cf723c4100015af031",
        "name": {
          "th": "ผู้ชาย",
          "en": "men"
        },
        "parentId": null,
        "status": "ACTIVE",
        "group": "PRODUCT"
      }
    ],
    "tags": [],
    "soldAmount": {},
    "rating": {},
    "shippingFrom": {},
    "shippingFee": {},
    "specification": {},
    "monitoringPrice": false,
    "description": {},
    "calculated": {}
  }
]

# Product

# Create Product

Method: POST Path: /shop/api/projects/{projId}/products
Description: Create product

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of data source in a map of the language short key and name value. Object N
brand The brand of product Object N
shops The list of shops of product List N
productModel The product model of this product Object Y
categories The list of categories List N
tags The list of tags List N
status The status of product if this available that status is 'ACTIVE'. String Y
linkMap The mapping link to other platforms. Object N
metadata The custom attribute of product. Object N
soldAmount The amount to sell this product. Object N
rating The rating this product Object N
specification The specific of product's description. Object N
attributes The list of product attributes e.g., color, size, etc. List N
deliverableStatus The status that indicates if product will be deliverable Object N
imageUrls The urls of images this product Object N
thumbnails The thumbnails of this product Object N
sku The sku of this product Object Y
overview The overview description of this product String N
externalRefs The thumbnails of this product Object N
attributeValues The thumbnails of this product Object N
channelStatus The status of each channels. If PUBLISHED that can discover. Object N
price The mapping price of product. Object N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/products' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "brand": {
              "createdBy": "66897977620",
              "createdDate": "2020-10-09T12:19:02.675Z",
              "lastModifiedBy": "66897977620",
              "lastModifiedDate": "2020-10-22T08:38:33.180Z",
              "id": "5f805536e85d8d22d60c948b",
              "name": {
                  "en": "adidas",
                  "th": "อดิดาส"
              },
              "description": null,
              "logoImages": {
                  "logo": "",
                  "icon": ""
              },
              "rating": null,
              "ratingCount": null,
              "status": "ACTIVE",
              "projectId": "5f6467cf723c4100015af031",
              "linkMap": {
                  "website": "",
                  "facebook": ""
              },
              "note": null,
              "aboutUs": null,
              "categories": [],
              "metadata": {},
              "externalRef": null,
              "batchId": null,
              "source": null
          },
          "productModel": {
              "createdBy": "66897977620",
              "createdDate": "2020-10-26T08:18:06.871Z",
              "lastModifiedBy": "66897977620",
              "lastModifiedDate": "2020-10-26T08:22:05.567Z",
              "id": "5f96863e3931ee1e04225c8f",
              "name": {
                  "en": "ultraboot blue",
                  "th": "ultraboot blue"
              },
              "description": {},
              "status": "ACTIVE",
              "publishedStatus": {},
              "deliverableStatus": {},
              "linkMap": {},
              "attributes": [],
              "imageUrls": [],
              "thumbnails": {},
              "metadata": {},
              "variants": null,
              "projectId": "5f6467cf723c4100015af031",
              "brand": {
                  "createdBy": "66897977620",
                  "createdDate": "2020-10-09T12:19:02.675Z",
                  "lastModifiedBy": "66897977620",
                  "lastModifiedDate": "2020-10-22T08:38:33.180Z",
                  "id": "5f805536e85d8d22d60c948b",
                  "name": {
                      "en": "adidas",
                      "th": "อดิดาส"
                  },
                  "description": null,
                  "logoImages": {
                      "logo": "",
                      "icon": ""
                  },
                  "rating": null,
                  "ratingCount": null,
                  "status": "ACTIVE",
                  "projectId": "5f6467cf723c4100015af031",
                  "linkMap": {
                      "website": "",
                      "facebook": ""
                  },
                  "note": null,
                  "aboutUs": null,
                  "categories": [],
                  "metadata": {},
                  "externalRef": null,
                  "batchId": null,
                  "source": null
              },
              "categories": [
                  {
                      "id": "5f72beabfc38307c3bf59f8f",
                      "projectId": "5f6467cf723c4100015af031",
                      "name": {
                          "en": "men",
                          "th": "ผู้ชาย"
                      },
                      "status": "ACTIVE",
                      "group": "PRODUCT"
                  }
              ],
              "tags": [],
              "soldAmount": {},
              "rating": {},
              "shippingFrom": {},
              "shippingFee": {},
              "specification": {},
              "shops": [],
              "keywords": [],
              "monitoringPrice": false,
              "calculated": {},
              "externalRef": null,
              "batchId": null,
              "source": null
          },
          "sku": "Blue 52",
          "name": {
              "en": "ultraboot blue",
              "th": "ultraboot blue"
          },
          "imageUrls": [],
          "status": "ACTIVE",
          "channelStatus": {},
          "deliverableStatus": {},
          "linkMap": {},
          "metadata": {},
          "price": {
              "normal": "5000"
          },
          "specification": {},
          "logisticInfo": {
              "weight": "",
              "height": ""
          },
          "attributeValues": {},
          "externalRefs": {}
      }'

Response Example:

HTTP/1.1 201 CREATED
{
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T09:20:45.705Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T09:20:45.705Z",
    "id": "5f9694ed3931ee1e04225c90",
    "name": {
        "en": "ultraboot blue",
        "th": "ultraboot blue"
    },
    "description": null,
    "sku": "Blue 52",
    "thumbnails": {},
    "imageUrls": [],
    "status": "ACTIVE",
    "channelStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "price": {
        "normal": 5000.0
    },
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-09T12:19:02.675Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-22T08:38:33.180Z",
        "id": "5f805536e85d8d22d60c948b",
        "name": {
            "en": "adidas",
            "th": "อดิดาส"
        },
        "description": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "projectId": "5f6467cf723c4100015af031",
        "linkMap": {
            "website": "",
            "facebook": ""
        },
        "note": null,
        "aboutUs": null,
        "categories": [],
        "metadata": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "productModel": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-26T08:18:06.871Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-26T08:22:05.567Z",
        "id": "5f96863e3931ee1e04225c8f",
        "name": {
            "en": "ultraboot blue",
            "th": "ultraboot blue"
        },
        "description": {},
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [],
        "thumbnails": {},
        "metadata": {},
        "projectId": "5f6467cf723c4100015af031",
        "categories": [
            {
                "id": "5f72beabfc38307c3bf59f8f",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "en": "men",
                    "th": "ผู้ชาย"
                },
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "keywords": [],
        "monitoringPrice": false,
        "calculated": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "shops": [],
    "categories": [],
    "tags": [],
    "attributeValues": {},
    "metadata": {}
}

# Update Product

Method: PUT Path: /shop/api/projects/{projId}/products
Description: Update a product

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id The id of products. String Y
brand The brand of product Object N
name The name of data source in a map of the language short key and name value. Object N
shops The list of shops of product List N
productModel The product model of this product Object Y
categories The list of categories List N
tags The list of tags List N
status The status of product if this available that status is 'ACTIVE'. String Y
linkMap The mapping link to other platforms. Object N
metadata The custom attribute of product. Object N
soldAmount The amount to sell this product. Object N
rating The rating this product Object N
specification The specific of product's description. Object N
attributes The list of product attributes e.g., color, size, etc. List N
deliverableStatus The status that indicates if product will be deliverable Object N
imageUrls The urls of images this product Object N
thumbnails The thumbnails of this product Object N
sku The sku of this product Object Y
overview The overview description of this product String N
externalRefs The thumbnails of this product Object N
attributeValues The thumbnails of this product Object N
channelStatus The status of each channels. If PUBLISHED that can discover. Object N
price The mapping price of product. Object N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/products' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "createdBy": "66897977620",
          "createdDate": "2020-10-26T09:20:45.705Z",
          "lastModifiedBy": "66897977620",
          "lastModifiedDate": "2020-10-26T09:20:45.705Z",
          "id": "5f9694ed3931ee1e04225c90",
          "name": {
              "en": "ultraboot blue",
              "th": "ultraboot blue"
          },
          "description": null,
          "sku": "Blue 54",
          "thumbnails": {},
          "imageUrls": [],
          "status": "ACTIVE",
          "channelStatus": {},
          "deliverableStatus": {},
          "linkMap": {},
          "price": {
              "normal": "5500"
          },
          "projectId": "5f6467cf723c4100015af031",
          "brand": {
              "createdBy": null,
              "createdDate": "2020-10-26T09:20:45.737980Z",
              "lastModifiedBy": null,
              "lastModifiedDate": "2020-10-26T09:20:45.737980Z",
              "id": "5f805536e85d8d22d60c948b",
              "name": {
                  "en": "adidas",
                  "th": "อดิดาส"
              },
              "description": null,
              "logoImages": {
                  "logo": "",
                  "icon": ""
              },
              "rating": null,
              "ratingCount": null,
              "status": "ACTIVE",
              "projectId": "5f6467cf723c4100015af031",
              "linkMap": {
                  "website": "",
                  "facebook": ""
              },
              "note": null,
              "aboutUs": null,
              "categories": [],
              "metadata": {}
          },
          "categories": [],
          "tags": [],
          "metadata": {},
          "productModel": {
              "createdBy": "66897977620",
              "createdDate": "2020-10-26T08:18:06.871Z",
              "lastModifiedBy": "66897977620",
              "lastModifiedDate": "2020-10-26T08:22:05.567Z",
              "id": "5f96863e3931ee1e04225c8f",
              "name": {
                  "en": "ultraboot blue",
                  "th": "ultraboot blue"
              },
              "status": "ACTIVE",
              "publishedStatus": {},
              "deliverableStatus": {},
              "linkMap": {},
              "imageUrls": [],
              "thumbnails": {},
              "attributes": [],
              "metadata": {},
              "projectId": "5f6467cf723c4100015af031",
              "categories": [
                  {
                      "id": "5f72beabfc38307c3bf59f8f",
                      "projectId": "5f6467cf723c4100015af031",
                      "name": {
                          "en": "men",
                          "th": "ผู้ชาย"
                      },
                      "parentId": null,
                      "status": "ACTIVE",
                      "group": "PRODUCT"
                  }
              ],
              "tags": [],
              "soldAmount": {},
              "rating": {},
              "shippingFrom": {},
              "shippingFee": {},
              "specification": {},
              "monitoringPrice": false,
              "description": {},
              "calculated": {}
          },
          "attributeValues": {},
          "shops": []
      }'

Response Example:

HTTP/1.1 200 OK
{
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T09:20:45.705Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T09:36:31.972Z",
    "id": "5f9694ed3931ee1e04225c90",
    "name": {
        "en": "ultraboot blue",
        "th": "ultraboot blue"
    },
    "description": null,
    "sku": "Blue 54",
    "thumbnails": {},
    "imageUrls": [],
    "status": "ACTIVE",
    "channelStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "price": {
        "normal": 5500.0
    },
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-09T12:19:02.675Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-22T08:38:33.180Z",
        "id": "5f805536e85d8d22d60c948b",
        "name": {
            "en": "adidas",
            "th": "อดิดาส"
        },
        "description": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "projectId": "5f6467cf723c4100015af031",
        "linkMap": {
            "website": "",
            "facebook": ""
        },
        "note": null,
        "aboutUs": null,
        "categories": [],
        "metadata": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "productModel": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-26T08:18:06.871Z",
        "lastModifiedBy": "system",
        "lastModifiedDate": "2020-10-26T09:20:45.753Z",
        "id": "5f96863e3931ee1e04225c8f",
        "name": {
            "en": "ultraboot blue",
            "th": "ultraboot blue"
        },
        "description": {},
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [],
        "thumbnails": {},
        "metadata": {},
        "projectId": "5f6467cf723c4100015af031",
        "categories": [
            {
                "id": "5f72beabfc38307c3bf59f8f",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "en": "men",
                    "th": "ผู้ชาย"
                },
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "keywords": [],
        "monitoringPrice": false,
        "calculated": {
            "price": {
                "normal-max": 5000.0,
                "normal-min": 5000.0
            },
            "imageUrls": []
        },
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "shops": [],
    "categories": [],
    "tags": [],
    "attributeValues": {},
    "metadata": {}
}

# Get All Product

Method: GET Path: /shop/api/projects/{projId}/products
Description: Get list of product

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/products' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
[
   {
       "createdBy": "66897977620",
       "createdDate": "2020-10-26T09:20:45.705Z",
       "lastModifiedBy": "66897977620",
       "lastModifiedDate": "2020-10-26T09:36:31.972Z",
       "id": "5f9694ed3931ee1e04225c90",
       "name": {
           "en": "ultraboot blue",
           "th": "ultraboot blue"
       },
       "description": null,
       "sku": "Blue 54",
       "thumbnails": {},
       "imageUrls": [],
       "status": "ACTIVE",
       "channelStatus": {},
       "deliverableStatus": {},
       "linkMap": {},
       "price": {
           "normal": 5500.0
       },
       "projectId": "5f6467cf723c4100015af031",
       "brand": {
           "createdBy": "66897977620",
           "createdDate": "2020-10-09T12:19:02.675Z",
           "lastModifiedBy": "66897977620",
           "lastModifiedDate": "2020-10-22T08:38:33.180Z",
           "id": "5f805536e85d8d22d60c948b",
           "name": {
               "en": "adidas",
               "th": "อดิดาส"
           },
           "description": null,
           "logoImages": {
               "logo": "",
               "icon": ""
           },
           "rating": null,
           "ratingCount": null,
           "status": "ACTIVE",
           "projectId": "5f6467cf723c4100015af031",
           "linkMap": {
               "website": "",
               "facebook": ""
           },
           "note": null,
           "aboutUs": null,
           "categories": [],
           "metadata": {},
           "externalRef": null,
           "batchId": null,
           "source": null
       },
       "productModel": {
           "createdBy": "66897977620",
           "createdDate": "2020-10-26T08:18:06.871Z",
           "lastModifiedBy": "system",
           "lastModifiedDate": "2020-10-26T09:20:45.753Z",
           "id": "5f96863e3931ee1e04225c8f",
           "name": {
               "en": "ultraboot blue",
               "th": "ultraboot blue"
           },
           "description": {},
           "status": "ACTIVE",
           "publishedStatus": {},
           "deliverableStatus": {},
           "linkMap": {},
           "attributes": [],
           "imageUrls": [],
           "thumbnails": {},
           "metadata": {},
           "projectId": "5f6467cf723c4100015af031",
           "categories": [
               {
                   "id": "5f72beabfc38307c3bf59f8f",
                   "projectId": "5f6467cf723c4100015af031",
                   "name": {
                       "en": "men",
                       "th": "ผู้ชาย"
                   },
                   "status": "ACTIVE",
                   "group": "PRODUCT"
               }
           ],
           "tags": [],
           "soldAmount": {},
           "rating": {},
           "shippingFrom": {},
           "shippingFee": {},
           "specification": {},
           "keywords": [],
           "monitoringPrice": false,
           "calculated": {
               "price": {
                   "normal-max": 5000.0,
                   "normal-min": 5000.0
               },
               "imageUrls": []
           },
           "externalRef": null,
           "batchId": null,
           "source": null
       },
       "shops": [],
       "categories": [],
       "tags": [],
       "attributeValues": {},
       "metadata": {}
   }
]

# Get Product

Method: GET Path: /shop/api/projects/{projId}/products/{id}
Description: Get a product.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product/5f9694ed3931ee1e04225c90' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
{
    "createdBy": "66897977620",
    "createdDate": "2020-10-26T09:20:45.705Z",
    "lastModifiedBy": "66897977620",
    "lastModifiedDate": "2020-10-26T09:36:31.972Z",
    "id": "5f9694ed3931ee1e04225c90",
    "name": {
        "en": "ultraboot blue",
        "th": "ultraboot blue"
    },
    "description": null,
    "sku": "Blue 54",
    "thumbnails": {},
    "imageUrls": [],
    "status": "ACTIVE",
    "channelStatus": {},
    "deliverableStatus": {},
    "linkMap": {},
    "price": {
        "normal": 5500.0
    },
    "projectId": "5f6467cf723c4100015af031",
    "brand": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-09T12:19:02.675Z",
        "lastModifiedBy": "66897977620",
        "lastModifiedDate": "2020-10-22T08:38:33.180Z",
        "id": "5f805536e85d8d22d60c948b",
        "name": {
            "en": "adidas",
            "th": "อดิดาส"
        },
        "description": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "projectId": "5f6467cf723c4100015af031",
        "linkMap": {
            "website": "",
            "facebook": ""
        },
        "note": null,
        "aboutUs": null,
        "categories": [],
        "metadata": {},
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "productModel": {
        "createdBy": "66897977620",
        "createdDate": "2020-10-26T08:18:06.871Z",
        "lastModifiedBy": "system",
        "lastModifiedDate": "2020-10-26T09:20:45.753Z",
        "id": "5f96863e3931ee1e04225c8f",
        "name": {
            "en": "ultraboot blue",
            "th": "ultraboot blue"
        },
        "description": {},
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [],
        "thumbnails": {},
        "metadata": {},
        "projectId": "5f6467cf723c4100015af031",
        "categories": [
            {
                "id": "5f72beabfc38307c3bf59f8f",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "en": "men",
                    "th": "ผู้ชาย"
                },
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "keywords": [],
        "monitoringPrice": false,
        "calculated": {
            "price": {
                "normal-max": 5000.0,
                "normal-min": 5000.0
            },
            "imageUrls": []
        },
        "externalRef": null,
        "batchId": null,
        "source": null
    },
    "shops": [],
    "categories": [],
    "tags": [],
    "attributeValues": {},
    "metadata": {}
}

# Delete Product

Method: DELETE Path: /shop/api/projects/{projId}/products/{id}
Description: Delete a product model.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/product-models/5f9694ed3931ee1e04225c90' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 204 No Content

# Search Product

Method: GET Path: /shop/api/projects/{projId}/_search/products
Description: Search product.

Client Scope: product.search
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Parameter:

Key Description Required Example
query The keyword to search product. Y query=status: ACTIVE

Example Request:

curl -X GET \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer {O2O Access Token}' \
    'https://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/_search/products?query=status:ACTIVE'

Response Example:

HTTP/1.1 200 OK
[
  {
      "createdBy": "66897977620",
      "createdDate": "2020-10-26T09:20:45.705Z",
      "lastModifiedBy": "66897977620",
      "lastModifiedDate": "2020-10-26T09:36:31.972Z",
      "id": "5f9694ed3931ee1e04225c90",
      "name": {
          "en": "ultraboot blue",
          "th": "ultraboot blue"
      },
      "description": null,
      "sku": "Blue 54",
      "thumbnails": {},
      "imageUrls": [],
      "status": "ACTIVE",
      "channelStatus": {},
      "deliverableStatus": {},
      "linkMap": {},
      "price": {
          "normal": 5500.0
      },
      "projectId": "5f6467cf723c4100015af031",
      "brand": {
          "createdBy": "66897977620",
          "createdDate": "2020-10-09T12:19:02.675Z",
          "lastModifiedBy": "66897977620",
          "lastModifiedDate": "2020-10-22T08:38:33.180Z",
          "id": "5f805536e85d8d22d60c948b",
          "name": {
              "en": "adidas",
              "th": "อดิดาส"
          },
          "description": null,
          "logoImages": {
              "logo": "",
              "icon": ""
          },
          "rating": null,
          "ratingCount": null,
          "status": "ACTIVE",
          "projectId": "5f6467cf723c4100015af031",
          "linkMap": {
              "website": "",
              "facebook": ""
          },
          "note": null,
          "aboutUs": null,
          "categories": [],
          "metadata": {},
          "externalRef": null,
          "batchId": null,
          "source": null
      },
      "productModel": {
          "createdBy": "66897977620",
          "createdDate": "2020-10-26T08:18:06.871Z",
          "lastModifiedBy": "system",
          "lastModifiedDate": "2020-10-26T09:20:45.753Z",
          "id": "5f96863e3931ee1e04225c8f",
          "name": {
              "en": "ultraboot blue",
              "th": "ultraboot blue"
          },
          "description": {},
          "status": "ACTIVE",
          "publishedStatus": {},
          "deliverableStatus": {},
          "linkMap": {},
          "attributes": [],
          "imageUrls": [],
          "thumbnails": {},
          "metadata": {},
          "projectId": "5f6467cf723c4100015af031",
          "categories": [
              {
                  "id": "5f72beabfc38307c3bf59f8f",
                  "projectId": "5f6467cf723c4100015af031",
                  "name": {
                      "en": "men",
                      "th": "ผู้ชาย"
                  },
                  "status": "ACTIVE",
                  "group": "PRODUCT"
              }
          ],
          "tags": [],
          "soldAmount": {},
          "rating": {},
          "shippingFrom": {},
          "shippingFee": {},
          "specification": {},
          "keywords": [],
          "monitoringPrice": false,
          "calculated": {
              "price": {
                  "normal-max": 5000.0,
                  "normal-min": 5000.0
              },
              "imageUrls": []
          },
          "externalRef": null,
          "batchId": null,
          "source": null
      },
      "shops": [],
      "categories": [],
      "tags": [],
      "attributeValues": {},
      "metadata": {}
  }
]

# Category

# Create Category

Method: POST Path: /shop/api/projects/{projId}/categories
Description: Create a category

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of data source in a map of the language short key and name value. Object Y
status The status of category if this available that status is 'ACTIVE'. String Y
parentId The brand of product String N
group The list of shops of product String Y

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/categories' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
         {
             "projectId": "5f72d57c43d36200013ae565",
             "name": {
                 "en": "Electronics",
                 "th": "อุปกรณ์อิเล็กทรอนิกส์"
             },
             "status": "ACTIVE",
             "group": "PRODUCT",
             "externalRef": "wemal_cat_001",
             "parentExternalRef": "",
             "batchId": "2020-10-25T10:02:111",
             "source": "wemall"
         }'

Response Example:

HTTP/1.1 201 CREATED
{
    "id": "5f910eb6bcbe713d95120617",
    "projectId": "5f72d57c43d36200013ae565",
    "name": {
        "en": "Electronics",
        "th": "อุปกรณ์อิเล็กทรอนิกส์"
    },
    "status": "ACTIVE",
    "group": "PRODUCT",
    "externalRef": "wemal_cat_001",
    "parentExternalRef": "",
    "batchId": "2020-10-25T10:02:111",
    "source": "wemall"
}

# Update Category

Method: PUT Path: /shop/api/projects/{projId}/categories
Description: Update a category

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id The id of categoryx . String Y
name The name of data source in a map of the language short key and name value. Object Y
status The status of category if this available that status is 'ACTIVE'. String Y
parentId The brand of product String N
group The list of shops of product String Y

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/products' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "id": "5f910eb6bcbe713d95120617",
          "projectId": "5f72d57c43d36200013ae565",
          "name": {
              "en": "Electronics",
              "th": "อุปกรณ์อิเล็กทรอนิกส์"
          },
          "status": "ACTIVE",
          "group": "PRODUCT",
          "externalRef": "wemal_cat_001",
          "parentExternalRef": "",
          "batchId": "2020-10-25T10:02:111",
          "source": "wemall"
      }'

Response Example:

HTTP/1.1 200 OK
{
    "id": "5f910eb6bcbe713d95120617",
    "projectId": "5f72d57c43d36200013ae565",
    "name": {
        "en": "Electronics",
        "th": "อุปกรณ์อิเล็กทรอนิกส์"
    },
    "status": "ACTIVE",
    "group": "PRODUCT",
    "externalRef": "wemal_cat_001",
    "parentExternalRef": "",
    "batchId": "2020-10-25T10:02:111",
    "source": "wemall"
}

# Get All Categories

Method: GET Path: /shop/api/projects/{projId}/categories
Description: Get list of categories.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/categories' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
[
 {
     "id": "5f910eb6bcbe713d95120617",
     "projectId": "5f72d57c43d36200013ae565",
     "name": {
         "en": "Electronics",
         "th": "อุปกรณ์อิเล็กทรอนิกส์"
     },
     "status": "ACTIVE",
     "group": "PRODUCT",
     "externalRef": "wemal_cat_001",
     "parentExternalRef": "",
     "batchId": "2020-10-25T10:02:111",
     "source": "wemall"
 }
]

# Get Category

Method: GET Path: /shop/api/projects/{projId}/categories/{id}
Description: Get a category.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/categories/5f910eb6bcbe713d95120617' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
{
    "id": "5f910eb6bcbe713d95120617",
    "projectId": "5f72d57c43d36200013ae565",
    "name": {
        "en": "Electronics",
        "th": "อุปกรณ์อิเล็กทรอนิกส์"
    },
    "status": "ACTIVE",
    "group": "PRODUCT",
    "externalRef": "wemal_cat_001",
    "parentExternalRef": "",
    "batchId": "2020-10-25T10:02:111",
    "source": "wemall"
}

# Delete Category

Method: DELETE Path: /shop/api/projects/{projId}/categories/{id}
Description: Delete a categories.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/categories/5f910eb6bcbe713d95120617' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 204 No Content

# Search Categories

Method: GET Path: /shop/api/projects/{projId}/_search/categories
Description: Search categories.

Client Scope:
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Parameter:

Key Description Required Example
query The keyword to search product. Y query=status: ACTIVE

Example Request:

curl -X GET \
    --header 'Accept: application/json' \
    --header 'Authorization: Bearer {O2O Access Token}' \
    'https://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/_search/categories?query=status:ACTIVE'

Response Example:

HTTP/1.1 200 OK
[
   {
      "id": "5f900f80ea30bd745e74821e",
      "projectId": "5f6467cf723c4100015af031",
      "name": {
        "th": "อุปกรณ์อิเล็กทรอนิกส์",
        "en": "Electronics"
      },
      "status": "ACTIVE",
      "group": "PRODUCT"
    }
]

# Brand

# Create a brand

Method: POST
Path: /shop/api/projects/{projId}/brands
Description: create a brand

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
status The status of brand (ACTIVE: the brand is eligible and approved to be a valid brand under the project, INACTIVE: the brand has not been approved yet or it intentionally was inactivated by admin) String Y
description Description of brand String N
logoImages List of logo image urls List N
categories List of categories List N
rating Rating score of the shop Number N
ratingCount Number of ratings for the shop Number N
linkMap Mapping links to other platforms Object N
note note String N
aboutUs Background or Description for the brand String N
metadata The custom attributes of the brand Object N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/brands' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "name": {
          "en": "Samsung",
          "th": "ซัมซุง"
        },
        "categories": [
          {
            "id": "catRef001"
          },
          {
            "id": "catRef002"
          }
        ],
        "rating": 4.5,
        "ratingCount": 30,
        "linkMap": {
          "siteA": "https://siteA.com/shop/shopOne"
        },
        "note": "ซัมซุงประเทศไทย",
        "aboutUs": "Best brand ever",
        "metadata": {},
        "status": "ACTIVE"
      }'

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{    
    "id": "10001234",
    "name": {
      "en": "Samsung",
      "th": "ซัมซุง"
    },
    "categories": [
      {
        "id": "catRef001"
      },
      {
        "id": "catRef002"
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "note": "ซัมซุงประเทศไทย",
    "aboutUs": "Best brand ever",
    "metadata": {},
    "status": "ACTIVE"
}

# Update a brand

Method: PUT
Path: /shop/api/projects/{projId}/brands
Description: update an existing brand

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id Id of brand String Y
name The name of data source in a map of the language short key and name value Object Y
status The status of brand (ACTIVE: the brand is eligible and approved to be a valid brand under the project, INACTIVE: the brand has not been approved yet or it intentionally was inactivated by admin) String Y
description Description of brand String N
logoImages List of logo image urls List N
categories List of categories List N
rating Rating score of the shop Number N
ratingCount Number of ratings for the shop Number N
linkMap Mapping links to other platforms Object N
note note String N
aboutUs Background or Description for the brand String N
metadata The custom attributes of the brand Object N
externalRef Reference or id in the original source String N
batchId Import batch id String N
source Original source of data String N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/brands' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{    
          "id": "10001234",
         "name": {
           "en": "Samsung",
           "th": "ซัมซุง"
         },
         "categories": [
           {
             "id": "catRef001"
           },
           {
             "id": "catRef002"
           }
         ],
         "rating": 4.5,
         "ratingCount": 30,
         "linkMap": {
           "siteA": "https://siteA.com/brand/brandOne",
           "facebook": "https://www.facebook.com/samsung_thailand"
         },
         "note": "ซัมซุงประเทศไทย",
         "aboutUs": "Best brand ever",
         "metadata": {},
         "status": "ACTIVE"
      }'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{    
    "id": "10001234",
   "name": {
     "en": "Samsung",
     "th": "ซัมซุง"
   },
   "categories": [
     {
       "id": "catRef001"
     },
     {
       "id": "catRef002"
     }
   ],
   "rating": 4.5,
   "ratingCount": 30,
   "linkMap": {
     "siteA": "https://siteA.com/brand/brandOne",
     "facebook": "https://www.facebook.com/samsung_thailand"
   },
   "note": "ซัมซุงประเทศไทย",
   "aboutUs": "Best brand ever",
   "metadata": {},
   "status": "ACTIVE"
}

# Get brand by Id

Method: GET
Path: /shop/api/projects/{projId}/brands/{id}
Description: get a brand by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the brand Y

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/brands/10001234' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{    
     "id": "10001234",
    "name": {
      "en": "Samsung",
      "th": "ซัมซุง"
    },
    "categories": [
      {
        "id": "catRef001"
      },
      {
        "id": "catRef002"
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "linkMap": {
      "siteA": "https://siteA.com/brand/brandOne",
      "facebook": "https://www.facebook.com/samsung_thailand"
    },
    "note": "ซัมซุงประเทศไทย",
    "aboutUs": "Best brand ever",
    "metadata": {},
    "status": "ACTIVE"
}

# Gel all brands

Method: GET
Path: /shop/api/projects/{projId}/brands
Description: get all brands

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required Example
page Page no, start from 0 N page=0
size Page size N size=30
sort Field and sort order N sort=rating,desc

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/brands' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
  {    
      "id": "10001234",
     "name": {
       "en": "Samsung",
       "th": "ซัมซุง"
     },
     "categories": [
       {
         "id": "catRef001"
       },
       {
         "id": "catRef002"
       }
     ],
     "rating": 4.5,
     "ratingCount": 30,
     "linkMap": {
       "siteA": "https://siteA.com/brand/brandOne",
       "facebook": "https://www.facebook.com/samsung_thailand"
     },
     "note": "ซัมซุงประเทศไทย",
     "aboutUs": "Best brand ever",
     "metadata": {},
     "status": "ACTIVE"
  }
]

# Delete brand by Id

Method: DELETE
Path: /shop/api/projects/{projId}/brands/{id}
Description: delete a brand by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the brand Y

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/brands/10001234' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 204 No Content

# Search brands

Method: GET
Path: /shop/api/projects/{projId}/_search/brands
Description: search brands

Client Scope: brand.search
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required Example
page Page no, start from 0 N page=0
size Page size N size=30
sort Field and sort order N sort=rating,desc
query Query string Y query=name.en:Samsung

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_search/brands?query=name.en:Samsung' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
  {    
      "id": "10001234",
     "name": {
       "en": "Samsung",
       "th": "ซัมซุง"
     },
     "categories": [
       {
         "id": "catRef001"
       },
       {
         "id": "catRef002"
       }
     ],
     "rating": 4.5,
     "ratingCount": 30,
     "linkMap": {
       "siteA": "https://siteA.com/brand/brandOne",
       "facebook": "https://www.facebook.com/samsung_thailand"
     },
     "note": "ซัมซุงประเทศไทย",
     "aboutUs": "Best brand ever",
     "metadata": {},
     "status": "ACTIVE"
  }
]

# Shop

# Create a shop

Method: POST
Path: /shop/api/projects/{projId}/shops
Description: create a shop

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
brand The reference or id of the shop in the source String Y
status The status of shop (ACTIVE: the shop is eligible and approved to be a valid shop under the project, INACTIVE: the shop has not been approved yet or it intentionally was inactivated by admin) String Y
categories The list of categories List N
rating The rating score of the shop Number N
ratingCount The number of ratings for the shop Number N
publishedStatus The status indicates that the shop is PUBLISHED or HIDDEN Object N
deliverableStatus The status indicates that the shop is deliverable or not Object N
isClosed The status indicates that the shop is closed or not Object N
linkMap The mapping links to other platforms Object N
openCloseDays Mapping of open-close status/time for each day in a week {} = depends on isClosed field String N
note note String N
aboutUs Background or Description for the shop String N
address Postal Address for display String N
country Country of the shop String N
state State of the shop String N
province Province of the shop String N
location Geological location of the shop Object N
district District of the shop String N
subDistrict Sub-district of the shop String N
tags Tags of the shop List N
metadata The custom attributes of the shop Object N
logistics The logistic method that this shop support List N
externalRef The reference or id of the shop in the source String N
configs.autoExternalRef The config to manage shop. String N
productNames*** Lists of product's names in a map of the language short key. Object N

Request Body:

Param Description Type Required
configs.autoExternalRef The config to create shop. If 'AKA_ID' is generate externalRef, 'NONE' is default to not generate. String N

** AKA_ID : Only generate externalRef that doesn't has value
*** The productNames will be updated when shop_update_product_names, a setting's attribute in a setting named product-model-actions, is true.

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/shops' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "name": {
          "en": "BananaIT",
          "th": "บานาน่าไอที"
        },
        "brand": {
          "id": "brandRef001"
        },
        "categories": [
          {
            "id": "catRef001"
          },
          {
            "id": "catRef002"
          }
        ],
        "rating": 4.5,
        "ratingCount": 30,
        "publishedStatus": {
          "siteA": "PUBLISHED",
          "siteB": "HIDDEN"
        },
        "deliverableStatus": {
          "siteA": true,
          "siteB": false
        },
        "isClosed": {
          "siteA": false,
          "siteB": true
        },
        "linkMap": {
          "siteA": "https://siteA.com/shop/shopOne"
        },
        "openCloseDays": {
          "MON": {
            "open": "8.30AM",
            "close": "11PM",
            "status": "OPEN"
          },
          "TUE": {
            "open": "8AM",
            "close": "11PM",
            "status": "OPEN"
          },
          "WED": {
            "status": "CLOSED"
          },
          "THU": {
            "status": "CLOSED"
          },
          "FRI": {
            "status": "CLOSED"
          },
          "SAT": {
            "status": "CLOSED"
          },
          "SUN": {
            "status": "CLOSED"
          }
        },
        "note": "ปิดทุกวันที่ 11 ของเดือน",
        "aboutUs": "Best shop ever",
        "address": "101 True Digital Park, Sukhumvit Rd.",
        "country": "Thailand",
        "state": "Bangkok",
        "province": "Bangkok",
        "location": {
          "lat": 13.6851301,
          "lon": 100.6088319
        },
        "district": "Phra Khanong",
        "subDistrict": "Bang Chak",
        "tags": [
          {
            "id": "tagRef001"
          }
        ],
        "metadata": {},
        "logistics": [
          "KERRY",
          "THAIPOST",
          "FLASH"
        ],
        "status": "ACTIVE",
        "productNames": {
          "en": ["Chicken", "Noodle"],
          "th": ["ไก่", "บะหมี่"]
        }
      }'

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "id":"11111111",
    "name": {
      "en": "BananaIT",
      "th": "บานาน่าไอที"
    },
    "brand": {
      "id": "brandRef001"
      "name":{
        "en": "Apple",
        "th": "แอ๊ปเปิ้ล"
        }
    },
    "categories": [
      {
        "id": "catRef001",
        "name":{
            "en": "Electronics",
            "th": "เครื่องใช้ไฟฟ้า"
        }
      },
      {
        "id": "catRef002",
        "name":{
            "en": "Phone",
            "th": "โทรศัพท์"
        }
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "publishedStatus": {
      "siteA": "PUBLISHED",
      "siteB": "HIDDEN"
    },
    "deliverableStatus": {
      "siteA": true,
      "siteB": false
    },
    "isClosed": {
      "siteA": false,
      "siteB": true
    },
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "openCloseDays": {
      "MON": {
        "open": "8.30AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "TUE": {
        "open": "8AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "WED": {
        "status": "CLOSED"
      },
      "THU": {
        "status": "CLOSED"
      },
      "FRI": {
        "status": "CLOSED"
      },
      "SAT": {
        "status": "CLOSED"
      },
      "SUN": {
        "status": "CLOSED"
      }
    },
    "note": "ปิดทุกวันที่ 11 ของเดือน",
    "aboutUs": "Best shop ever",
    "address": "101 True Digital Park, Sukhumvit Rd.",
    "country": "Thailand",
    "state": "Bangkok",
    "province": "Bangkok",
    "location": {
      "lat": 13.6851301,
      "lon": 100.6088319
    },
    "district": "Phra Khanong",
    "subDistrict": "Bang Chak",
    "tags": [
      {
        "id": "tagRef001",
        "name": "Phone"
      }
    ],
    "metadata": {},
    "logistics": [
      "KERRY",
      "THAIPOST",
      "FLASH"
    ],
    "status": "ACTIVE",
    "productNames": {
      "en": ["Chicken", "Noodle"],
      "th": ["ไก่", "บะหมี่"]
    }
   }

Example Create shop with auto generate externalRef:

{
    "configs": {
        "autoExternalRef" : "AKA_ID"
    },
    "name": {
        "en": "test_new",
        "th": "test_new"
    },
    "logoImages": {
        "logo": "",
        "icon": ""
    },
    "status": "ACTIVE",
    "publishedStatus": {},
    "deliverableStatus": {
        "website": false,
        "mobile": false
    },
    "isClosed": {
        "website": false,
        "mobile": false
    },
    "linkMap": {},
    "openCloseDays": {},
    "note": "",
    "aboutUs": "",
    "location": {
        "lat": 0,
        "lon": 0
    },
    "metadata": {},
    "logistics": [],
    "description": "",
    "externalRef: ""
}

Response shop with auto generate externalRef:

    {
        "createdBy": "webackoffice",
        "createdDate": "2021-01-06T09:21:33.176Z",
        "lastModifiedBy": "webackoffice",
        "lastModifiedDate": "2021-01-06T09:21:33.197Z",
        "id": "5ff5811dba136069d5c29585",
        "projectId": "5f6467cf723c4100015af031",
        "name": {
            "en": "test_new",
            "th": "test_new"
        },
        "categories": null,
        "logoImages": {
            "logo": "",
            "icon": ""
        },
        "rating": null,
        "ratingCount": null,
        "status": "ACTIVE",
        "publishedStatus": {},
        "deliverableStatus": {
            "website": false,
            "mobile": false
        },
        "isClosed": {
            "website": false,
            "mobile": false
        },
        "linkMap": {},
        "openCloseDays": {},
        "note": "",
        "aboutUs": "",
        "address": null,
        "country": null,
        "state": null,
        "province": null,
        "location": {
            "lat": 0.0,
            "lon": 0.0
        },
        "district": null,
        "subDistrict": null,
        "tags": null,
        "metadata": {},
        "logistics": [],
        "externalRef": "5ff5811dba136069d5c29585",
        "batchId": null,
        "source": null,
        "description": ""
    }

# Update a shop

Method: PUT
Path: /shop/api/projects/{projId}/shops
Description: update an existing shop

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id The identifier of the shop in system Object Y
name The name of shop in a map of the language short key and name value Object Y
brand The reference or id of the shop in the source String Y
status The status of shop (ACTIVE: the shop is eligible and approved to be a valid shop under the project, INACTIVE: the shop has not been approved yet or it intentionally was inactivated by admin) String Y
categories The list of categories List N
rating The rating score of the shop Number N
ratingCount The number of ratings for the shop Number N
publishedStatus The status indicates that the shop is PUBLISHED or HIDDEN Object N
deliverableStatus The status indicates that the shop is deliverable or not Object N
isClosed The status indicates that the shop is closed or not Object N
linkMap The mapping links to other platforms Object N
openCloseDays Mapping of open-close status/time for each day in a week {} = depends on isClosed field String N
note note String N
aboutUs Background or Description for the shop String N
address Postal Address for display String N
country Country of the shop String N
state State of the shop String N
province Province of the shop String N
location Geological location of the shop Object N
district District of the shop String N
subDistrict Sub-district of the shop String N
tags Tags of the shop List N
metadata The custom attributes of the shop Object N
logistics The logistic method that this shop support List N
externalRef The reference or id of the shop in the source String N
productNames** Lists of product's names in a map of the language short key. Object N

** The productNames will be updated when shop_update_product_names, a setting's attribute in a setting named product-model-actions, is true.

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/shops' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "id": "11111111",
        "name": {
          "en": "BananaIT",
          "th": "บานาน่าไอที"
        },
        "brand": {
          "id": "brandRef001"
        },
        "categories": [
          {
            "id": "catRef001"
          },
          {
            "id": "catRef002"
          }
        ],
        "rating": 4.8,
        "ratingCount": 50,
        "publishedStatus": {
          "siteA": "PUBLISHED",
          "siteB": "HIDDEN"
        },
        "deliverableStatus": {
          "siteA": true,
          "siteB": false
        },
        "isClosed": {
          "siteA": false,
          "siteB": true
        },
        "linkMap": {
          "siteA": "https://siteA.com/shop/shopOne"
        },
        "openCloseDays": {
          "MON": {
            "open": "8.30AM",
            "close": "11PM",
            "status": "OPEN"
          },
          "TUE": {
            "open": "8AM",
            "close": "11PM",
            "status": "OPEN"
          },
          "WED": {
            "status": "CLOSED"
          },
          "THU": {
            "status": "CLOSED"
          },
          "FRI": {
            "status": "CLOSED"
          },
          "SAT": {
            "status": "CLOSED"
          },
          "SUN": {
            "status": "CLOSED"
          }
        },
        "note": "ปิดทุกวันที่ 11 ของเดือน",
        "aboutUs": "Best shop ever",
        "address": "101 True Digital Park, Sukhumvit Rd.",
        "country": "Thailand",
        "state": "Bangkok",
        "province": "Bangkok",
        "location": {
          "lat": 13.6851301,
          "lon": 100.6088319
        },
        "district": "Phra Khanong",
        "subDistrict": "Bang Chak",
        "tags": [
          {
            "id": "tagRef001"
          }
        ],
        "metadata": {},
        "logistics": [
          "KERRY",
          "THAIPOST",
          "FLASH"
        ],
        "status": "ACTIVE",
        "productNames": {
          "en": ["Chicken", "Noodle"],
          "th": ["ไก่", "บะหมี่"]
        }
      }'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "id": "11111111",
    "name": {
      "en": "BananaIT",
      "th": "บานาน่าไอที"
    },
    "brand": {
      "id": "brandRef001"
    },
    "categories": [
      {
        "id": "catRef001"
      },
      {
        "id": "catRef002"
      }
    ],
    "rating": 4.8,
    "ratingCount": 50,
    "publishedStatus": {
      "siteA": "PUBLISHED",
      "siteB": "HIDDEN"
    },
    "deliverableStatus": {
      "siteA": true,
      "siteB": false
    },
    "isClosed": {
      "siteA": false,
      "siteB": true
    },
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "openCloseDays": {
      "MON": {
        "open": "8.30AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "TUE": {
        "open": "8AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "WED": {
        "status": "CLOSED"
      },
      "THU": {
        "status": "CLOSED"
      },
      "FRI": {
        "status": "CLOSED"
      },
      "SAT": {
        "status": "CLOSED"
      },
      "SUN": {
        "status": "CLOSED"
      }
    },
    "note": "ปิดทุกวันที่ 11 ของเดือน",
    "aboutUs": "Best shop ever",
    "address": "101 True Digital Park, Sukhumvit Rd.",
    "country": "Thailand",
    "state": "Bangkok",
    "province": "Bangkok",
    "location": {
      "lat": 13.6851301,
      "lon": 100.6088319
    },
    "district": "Phra Khanong",
    "subDistrict": "Bang Chak",
    "tags": [
      {
        "id": "tagRef001"
      }
    ],
    "metadata": {},
    "logistics": [
      "KERRY",
      "THAIPOST",
      "FLASH"
    ],
    "status": "ACTIVE",
    "productNames": {
      "en": ["Chicken", "Noodle"],
      "th": ["ไก่", "บะหมี่"]
    }
}

# Get shop by Id

Method: GET
Path: /shop/api/projects/{projId}/shops/{id}
Description: get a shop by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the shop Y

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/shops/11111111' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "id":"11111111",
    "name": {
      "en": "BananaIT",
      "th": "บานาน่าไอที"
    },
    "brand": {
      "id": "brandRef001"
      "name":{
        "en": "Apple",
        "th": "แอ๊ปเปิ้ล"
        }
    },
    "categories": [
      {
        "id": "catRef001",
        "name":{
            "en": "Electronics",
            "th": "เครื่องใช้ไฟฟ้า"
        }
      },
      {
        "id": "catRef002",
        "name":{
            "en": "Phone",
            "th": "โทรศัพท์"
        }
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "publishedStatus": {
      "siteA": "PUBLISHED",
      "siteB": "HIDDEN"
    },
    "deliverableStatus": {
      "siteA": true,
      "siteB": false
    },
    "isClosed": {
      "siteA": false,
      "siteB": true
    },
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "openCloseDays": {
      "MON": {
        "open": "8.30AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "TUE": {
        "open": "8AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "WED": {
        "status": "CLOSED"
      },
      "THU": {
        "status": "CLOSED"
      },
      "FRI": {
        "status": "CLOSED"
      },
      "SAT": {
        "status": "CLOSED"
      },
      "SUN": {
        "status": "CLOSED"
      }
    },
    "note": "ปิดทุกวันที่ 11 ของเดือน",
    "aboutUs": "Best shop ever",
    "address": "101 True Digital Park, Sukhumvit Rd.",
    "country": "Thailand",
    "state": "Bangkok",
    "province": "Bangkok",
    "location": {
      "lat": 13.6851301,
      "lon": 100.6088319
    },
    "district": "Phra Khanong",
    "subDistrict": "Bang Chak",
    "tags": [
      {
        "id": "tagRef001",
        "name": "Phone"
      }
    ],
    "metadata": {},
    "logistics": [
      "KERRY",
      "THAIPOST",
      "FLASH"
    ],
    "status": "ACTIVE",
    "productNames": {
      "en": ["Chicken", "Noodle"],
      "th": ["ไก่", "บะหมี่"]
    }
   }

# Gel all shops

Method: GET
Path: /shop/api/projects/{projId}/shops
Description: get all shops

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Param Description Required Example
page Page no, start from 0 N page=0
size Page size N size=30
sort Field and sort order N sort=rating,desc

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/shops' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
   {
    "id":"11111111",
    "name": {
      "en": "BananaIT",
      "th": "บานาน่าไอที"
    },
    "brand": {
      "id": "brandRef001"
      "name":{
        "en": "Apple",
        "th": "แอ๊ปเปิ้ล"
        }
    },
    "categories": [
      {
        "id": "catRef001",
        "name":{
            "en": "Electronics",
            "th": "เครื่องใช้ไฟฟ้า"
        }
      },
      {
        "id": "catRef002",
        "name":{
            "en": "Phone",
            "th": "โทรศัพท์"
        }
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "publishedStatus": {
      "siteA": "PUBLISHED",
      "siteB": "HIDDEN"
    },
    "deliverableStatus": {
      "siteA": true,
      "siteB": false
    },
    "isClosed": {
      "siteA": false,
      "siteB": true
    },
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "openCloseDays": {
      "MON": {
        "open": "8.30AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "TUE": {
        "open": "8AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "WED": {
        "status": "CLOSED"
      },
      "THU": {
        "status": "CLOSED"
      },
      "FRI": {
        "status": "CLOSED"
      },
      "SAT": {
        "status": "CLOSED"
      },
      "SUN": {
        "status": "CLOSED"
      }
    },
    "note": "ปิดทุกวันที่ 11 ของเดือน",
    "aboutUs": "Best shop ever",
    "address": "101 True Digital Park, Sukhumvit Rd.",
    "country": "Thailand",
    "state": "Bangkok",
    "province": "Bangkok",
    "location": {
      "lat": 13.6851301,
      "lon": 100.6088319
    },
    "district": "Phra Khanong",
    "subDistrict": "Bang Chak",
    "tags": [
      {
        "id": "tagRef001",
        "name": "Phone"
      }
    ],
    "metadata": {},
    "logistics": [
      "KERRY",
      "THAIPOST",
      "FLASH"
    ],
    "status": "ACTIVE",
    "productNames": {
      "en": ["Chicken", "Noodle"],
      "th": ["ไก่", "บะหมี่"]
    }
   }
]

# Delete shop by Id

Method: DELETE
Path: /shop/api/projects/{projId}/shops/{id}
Description: delete a shop by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the shop Y

** The productNames will be updated when shop_update_product_names, a setting's attribute in a setting named product-model-actions, is true.

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/shops/11111111' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 204 No Content

# Search shops

Method: GET
Path: /shop/api/projects/{projId}/_search/shops
Description: search shops

Client Scope: shop.search
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Param Description Required Example
query Query string Y query=categories.name.en:Electronics
page Page no, start from 0 N page=0
size Page size N size=30
sort* Field and sort order N sort=rating,desc
lo** Geo Coordinate of location (latitude,longitude N lo=18.785444,99.028595
showDistance Distance in Kilometer between shop and the location param will be shown when true N showDistance=true
openingDateTime*** Date and time in ISO-8601 format. The time which shops are opening N openingDateTime=2021-03-11T00:00:00Z

Remarks:

  • *To get distance or sort by distance, param lo is required
  • **Sorting by distance will use keywork _distance e.g., sort=_distance
  • ***openingDateTime will return the shops which are opening in this time.

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_search/shops?query=categories.name.en:Electronics' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
   {
    "id":"11111111",
    "name": {
      "en": "BananaIT",
      "th": "บานาน่าไอที"
    },
    "brand": {
      "id": "brandRef001"
      "name":{
        "en": "Apple",
        "th": "แอ๊ปเปิ้ล"
        }
    },
    "categories": [
      {
        "id": "catRef001",
        "name":{
            "en": "Electronics",
            "th": "เครื่องใช้ไฟฟ้า"
        }
      },
      {
        "id": "catRef002",
        "name":{
            "en": "Phone",
            "th": "โทรศัพท์"
        }
      }
    ],
    "rating": 4.5,
    "ratingCount": 30,
    "publishedStatus": {
      "siteA": "PUBLISHED",
      "siteB": "HIDDEN"
    },
    "deliverableStatus": {
      "siteA": true,
      "siteB": false
    },
    "isClosed": {
      "siteA": false,
      "siteB": true
    },
    "linkMap": {
      "siteA": "https://siteA.com/shop/shopOne"
    },
    "openCloseDays": {
      "MON": {
        "open": "8.30AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "TUE": {
        "open": "8AM",
        "close": "11PM",
        "status": "OPEN"
      },
      "WED": {
        "status": "CLOSED"
      },
      "THU": {
        "status": "CLOSED"
      },
      "FRI": {
        "status": "CLOSED"
      },
      "SAT": {
        "status": "CLOSED"
      },
      "SUN": {
        "status": "CLOSED"
      }
    },
    "openHours": [
      {
        "day": "MON",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "TUE",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "WED",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "THU",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "FRI",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "SAT",
        "open": "08:00",
        "close": "20:00"
      },
      {
        "day": "SUN",
        "open": "08:00",
        "close": "20:00"
      }
    ],
    "openHoursEncoded": [
      {
        "open": 10800,
        "close": 12000
      },
      {
        "open": 20800,
        "close": 22000
      },
      {
        "open": 30800,
        "close": 32000
      },
      {
        "open": 40800,
        "close": 42000
      },
      {
        "open": 50800,
        "close": 52000
      },
      {
        "open": 60800,
        "close": 62000
      },
      {
        "open": 70800,
        "close": 72000
      }
    ],
    "note": "ปิดทุกวันที่ 11 ของเดือน",
    "aboutUs": "Best shop ever",
    "address": "101 True Digital Park, Sukhumvit Rd.",
    "country": "Thailand",
    "state": "Bangkok",
    "province": "Bangkok",
    "location": {
      "lat": 13.6851301,
      "lon": 100.6088319
    },
    "district": "Phra Khanong",
    "subDistrict": "Bang Chak",
    "tags": [
      {
        "id": "tagRef001",
        "name": "Phone"
      }
    ],
    "metadata": {},
    "logistics": [
      "KERRY",
      "THAIPOST",
      "FLASH"
    ],
    "status": "ACTIVE",
    "productNames": {
      "en": ["Chicken", "Noodle"],
      "th": ["ไก่", "บะหมี่"]
    }
  }
]

# Tag

# Create a tag

Method: POST
Path: /shop/api/projects/{projId}/tags
Description: create a tag

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of tag String Y
status The status of tag: ACTIVE, INACTIVE String Y
description Description of tag String N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/tags' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "name":"New Arrivals",
        "description": "New products",
        "status": "ACTIVE"
     }'

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "id":"10002222",
    "name":"New Arrivals",
    "description": "New products",
    "status": "ACTIVE"
}

# Update a tag

Method: PUT
Path: /shop/api/projects/{projId}/tags
Description: update an existing tag

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
id Id of tag String Y
name The name of data source in a map of the language short key and name value Object Y
status The status of shop (ACTIVE: the shop is eligible and approved to be a valid shop under the project, INACTIVE: the shop has not been approved yet or it intentionally was inactivated by admin) String Y
description Description of brand String N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/tags' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "id":"10002222",
          "name":"New Arrivals",
          "description": "New products and shops",
          "status": "ACTIVE"
      }'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "id":"10002222",
    "name":"New Arrivals",
    "description": "New products and shops",
    "status": "ACTIVE"
}

# Get tag by Id

Method: GET
Path: /shop/api/projects/{projId}/tags/{id}
Description: get a tag by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the tag Y

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/tags/10002222' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "id":"10002222",
    "name":"New Arrivals",
    "description": "New products",
    "status": "ACTIVE"
}

# Gel all tags

Method: GET
Path: /shop/api/projects/{projId}/tags
Description: get all tags

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required Example
page Page no, start from 0 N page=0
size Page size N size=30
sort Field and sort order N sort=rating,desc

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/tags' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
  {
      "id":"10002222",
      "name":"New Arrivals",
      "description": "New products",
      "status": "ACTIVE"
  }
]

# Delete tag by Id

Method: DELETE
Path: /shop/api/projects/{projId}/tags/{id}
Description: delete a tag by id

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}

Request Param:

Param Description Required
projId Id of the project Y
id Id of the tag Y

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/tags/10002222' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 204 No Content

# Bulk Import

# Bulk import categories

Method: POST
Path: /shop/api/projects/{projId}/_import/categories
Description: import categories (update when there is a category with the externalRef exists)

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId The import batch ID, must not exist in the system before import String Y
source The name of data source String Y
data The attributes and values of the categories List Y

Data Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
group The name of category group i.e., PRODUCT, BRAND, SHOP String Y
externalRef The reference or id of the category in the source String Y
parentExternalRef The reference or id of the parent category in the source String N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/{projId}/_import/categories' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "batchId": "20201025T1002111",
        "source":"wemall",
        "data": [
          {
            "name": {
              "en": "Electronics",
              "th": "อุปกรณ์อิเล็กทรอนิกส์"
            },
            "group":"PRODUCT",
            "externalRef": "wemal_cat_001",
            "parentExternalRef": ""
          }
        ]
      }'

Response Example:

HTTP/1.1 202 ACCEPTED

# Bulk import shops

Method: POST
Path: /shop/api/projects/{projId}/_import/shops
Description: import shops (update when there is a shop with the externalRef exists)

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId The import batch ID, must not exist in the system before import String Y
source The name of data source String Y
data The attributes and values of the shops List Y

Data Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the shop in the source String Y

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/{projId}/_import/shops' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "batchId": "20201025T100212",
        "source":"wemall",
        "data": [
          {
            "name": {
              "en": "BananaIT",
              "th": "บานาน่าไอที"
            },
            "externalRef": "wemal_shop_001"
          }
        ]
      }'

Response Example:

HTTP/1.1 202 ACCEPTED

# Bulk import product models

Method: POST
Path: /shop/api/projects/{projId}/_import/product-models
Description: import product models with product variants (update when there is a product model or product variant with the externalRef exists)

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId The import batch ID, must not exist in the system before import String Y
source The name of data source String Y
data The attributes and values of the product models and their variants List Y

Data Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the product model in the source String Y
attributes The list of product attributes e.g., color, size, etc. List N
brand The brand of product Object Y
shops The list of shops of product List N
categories The list of categories List N
tags The list of tags List N
variants The list of product variants Object N
deliverableStatus The status that indicates if product will be deliverable Object N
publishedStatus The status that indicates if product will be published Object N

Variant Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the product in the source String Y
sku The stock keeping unit of product String Y
attributeValues The product attribute values e.g., color: red List N
price The product price e.g., offline: 1000 Object N
imageUrls The list of product image urls List N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/{projId}/_import/product-models' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "batchId": "20201025T1002113",
        "source":"wemall",
        "data": [
          {
            "brand":{"externalRef":"wemall"},
            "name": {
              "en": "iphone 12 pro",
              "th": "ไอโฟน 12 โปร"
            },
            "deliverableStatus": {
               "wemall": true,
               "trueid": false
             },
             "publishedStatus": {
                "wemall": "PUBLISHED",
                "trueid": "HIDDEN"
             },
            "linkMap": {
              "wemall": "https://www.wemall.com/products/000001",
              "trueid": "https://www.trueid.com/products/000001"
            },
            "attributes": [
              "size","color"
            ],
            "externalRef": "WeMallBanana0001",
            "shops": [{"externalRef":"wemal_shop_001"}],
            "categories": [
              {
                "externalRef": "wemallCat1111"
              }
            ],
            "tags": [
              {
                "externalRef": "wemallTag2222"
              }
            ],
            "variants": [
              {
                "sku": "IPHONE12PROGREEN64GB",
                "name": {
                  "en": "iphone 12 pro green 64GB",
                  "th": "ไอโฟน 12 โปร สีเขียว 64GB"
                },
                 "externalRef":"wemall_product_ref",
                "price": {
                  "wemall": 20000
                },
                "imageUrls": [
                  "https://file/repo/img001.png",
                  "https://file/repo/img002.png"
                ],
                "attributeValues": {
                      "size": "xs",
                      "color": "black"
                  }
              }
            ]
          }
        ]
      }'

Response Example:

HTTP/1.1 202 ACCEPTED

# Bulk import tags

Method: POST
Path: /shop/api/projects/{projId}/_import/tags
Description: import tags (update when there is a tag with the externalRef exists)

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId The import batch ID, must not exist in the system before import String Y
source The name of data source String Y
data The attributes and values of the tags List Y

Data Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the tag in the source String Y

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/{projId}/_import/tags' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "batchId": "20201025T1002114",
        "source":"wemall",
        "data": [
          {
            "name": {
              "en": "New Arrivals",
              "th": "สินค้ามาใหม่"
            },
            "externalRef": "wemal_tag_001"
          }
        ]
      }'

Response Example:

HTTP/1.1 202 ACCEPTED

# Bulk import brands

Method: POST
Path: /shop/api/projects/{projId}/_import/brands
Description: import brands (update when there is a brand with the externalRef exists)

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
batchId The import batch ID, must not exist in the system before import String Y
source The name of data source String Y
data The attributes and values of the brand List Y

Data Attributes

Param Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the brand in the source String Y

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/{projId}/_import/brands' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "batchId": "2020-10-25T10:02:111",
        "source":"wemall",
        "data": [
          {
            "name": {
              "en": "Apple",
              "th": "แอ๊ปเปิ้ล"
            },
            "externalRef": "wemal_brand_001"
          }
        ]
      }'

Response Example:

HTTP/1.1 202 ACCEPTED

# Bulk Delete

# Bulk delete categories

Method: POST
Path: /shop/api/projects/{projId}/_delete/categories
Description: delete categories

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Key Description Type Required
ids Set of category's id to delete List N
source source of imported data String N
externalRefs Set of external reference of imported data to delete List N
  • Notes:
  • ids or externalRefs must be specified
  • when externalRefs is provided, source must not be null

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_delete/categories' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
       "ids": ["aaaaabbb", "aaaaabcc"]
      }'

Response Example:

HTTP/1.1 200 OK

# Bulk delete brands

Method: POST
Path: /shop/api/projects/{projId}/_delete/brands
Description: delete brands

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Key Description Type Required
ids Set of brand's id to delete List N
source source of imported data String N
externalRefs Set of external reference of imported data to delete List N
  • Notes:
  • ids or externalRefs must be specified
  • when externalRefs is provided, source must not be null

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_delete/brands' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
       "ids": ["aaaaabbb", "aaaaabcc"]
      }'

Response Example:

HTTP/1.1 200 OK

# Bulk delete shops

Method: POST
Path: /shop/api/projects/{projId}/_delete/shops
Description: delete shops

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Key Description Type Required
ids Set of shop's id to delete List N
source source of imported data String N
externalRefs Set of external reference of imported data to delete List N
  • Notes:
  • ids or externalRefs must be specified
  • when externalRefs is provided, source must not be null

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_delete/shops' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
       "ids": ["aaaaabbb", "aaaaabcc"]
      }'

Response Example:

HTTP/1.1 200 OK

# Bulk delete tags

Method: POST
Path: /shop/api/projects/{projId}/_delete/tags
Description: delete tags

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Key Description Type Required
ids Set of tag's id to delete List N
source source of imported data String N
externalRefs Set of external reference of imported data to delete List N
  • Notes:
  • ids or externalRefs must be specified
  • when externalRefs is provided, source must not be null

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_delete/tags' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
       "ids": ["aaaaabbb", "aaaaabcc"]
      }'

Response Example:

HTTP/1.1 200 OK

# Bulk delete products

Method: POST
Path: /shop/api/projects/{projId}/_delete/product-models
Description: delete product models and their products

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Key Description Type Required
ids Set of product model's id to delete List N
source source of imported data String N
externalRefs Set of external reference of imported data to delete List N
  • Notes:
  • ids or externalRefs must be specified
  • when externalRefs is provided, source must not be null

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/_delete/product-models' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
       "ids": ["aaaaabbb", "aaaaabcc"]
      }'

Response Example:

HTTP/1.1 200 OK

# Get and Update by external ref

# Get product by externalRef

Method: GET
Path: /shop/api/projects/{projId}/product-models/by-external-ref/{source}/{externalRef}
Description: get product model with its variants by the source and externalRef

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Param:

Key Description Type Required
projId Id of project String Y
source source of imported data String Y
externalRef external reference of imported data String Y

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/product-models/by-external-ref/wemall/P001' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
 "id": "5fb50127af7d83202c3c1111",
 "name": {
   "th": "🔥ถูกที่สุด+",
   "en": "🔥Hot price"
 },
 "description": {},
 "status": "ACTIVE",
 "publishedStatus": {},
 "deliverableStatus": {},
 "linkMap": {},
 "attributes": [],
 "imageUrls": [
   "https://wemall/file/111",
   "https://wemall/file/222"
 ],
 "thumbnails": {},
 "metadata": {},
 "projectId": "wemall",
 "categories": [],
 "tags": [],
 "soldAmount": {},
 "rating": {},
 "shippingFrom": {},
 "shippingFee": {},
 "specification": {},
 "shops": [],
 "keywords": [],
 "monitoringPrice": false,
 "calculated": {
   "price": {
     "normal-max": 33,
     "normal-min": 33
   },
   "imageUrls": [
     "https://wemall/file/111",
     "https://wemall/file/222"
   ]
 },
 "externalRef": "P001",
 "batchId": "b3",
 "source": "shopee",
 "price": {
   "normal": 33
 },
 "videoUrls": [],
 "managePricing": false,
 "related": {
   "categories": [
     "กีฬาและกิจกรรมกลางแจ้ง"
   ]
 },
 "variants": [
   {
     "lastModifiedBy": "or-test",
     "lastModifiedDate": "2020-11-19T06:37:19.846Z",
     "id": "5fb50131af7d83202c3c7236",
     "name": {
           "th": "🔥ถูกที่สุด+",
           "en": "🔥Hot price"
     },
     "sku": "100",
     "thumbnails": {},
     "imageUrls": [
       "https://wemall/file/111",
       "https://wemall/file/222"
     ],
     "status": "ACTIVE",
     "channelStatus": {},
     "deliverableStatus": {},
     "linkMap": {},
     "price": {
       "normal": 33
     },
     "projectId": "5f718c5d0e892e00017a6a5f",
     "categories": [],
     "tags": [],
     "attributeValues": {},
     "metadata": {},
     "externalRef": "100"
   }
 ]
} 

# Update product by externalRef

Method: PUT Path: /shop/api/projects/{projId}/product-models/by-external-ref/{source}/{externalRef}
Description: update product model with its variants by the source and externalRef

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Param:

Key Description Type Required
projId Id of project String Y
source source of imported data String Y
externalRef external reference of imported data String Y

Request Body:

Key Description Type Required
name The name of data source in a map of the language short key and name value Object Y
externalRef The reference or id of the product model in the source String Y
attributes The list of product attributes e.g., color, size, etc. List N
brand The brand of product Object Y
shops The list of shops of product List N
categories The list of categories List N
tags The list of tags List N
variants The list of product variants Object N
deliverableStatus The status that indicates if product will be deliverable Object N
publishedStatus The status that indicates if product will be published Object N
related Additional data to product model, e.g., brands, categories Object N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/product-models/by-external-ref/wemall/P001' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
        "name": {
          "th": "🔥ถูกที่สุด++",
          "en": "🔥Hot price!!"
        },
        "description": {},
        "publishedStatus": {},
        "deliverableStatus": {},
        "linkMap": {},
        "attributes": [],
        "imageUrls": [
          "https://wemall/file/111",
          "https://wemall/file/222"
        ],
        "thumbnails": {},
        "metadata": {},
        "categories": [],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "shops": [],
        "keywords": [],
        "monitoringPrice": false,
        "externalRef": "P001",
        "batchId": "b3",
        "source": "shopee",
        "price": {
          "normal": 33
        },
        "videoUrls": [],
        "managePricing": false,
        "related": {
          "categories": [
            "กีฬาและกิจกรรมกลางแจ้ง"
          ]
        },
        "variants": [
          {
            "name": {
                  "th": "🔥ถูกที่สุด+",
                  "en": "🔥Hot price"
            },
            "sku": "100",
            "thumbnails": {},
            "imageUrls": [
              "https://wemall/file/111",
              "https://wemall/file/222"
            ],
            "status": "ACTIVE",
            "channelStatus": {},
            "deliverableStatus": {},
            "linkMap": {},
            "price": {
              "normal": 33
            },
            "categories": [],
            "tags": [],
            "attributeValues": {},
            "metadata": {},
            "externalRef": "100"
          }
        ]
      } '

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
 "id": "5fb50127af7d83202c3c1111",
 "name": {
   "th": "🔥ถูกที่สุด++",
   "en": "🔥Hot price!!"
 },
 "description": {},
 "status": "ACTIVE",
 "publishedStatus": {},
 "deliverableStatus": {},
 "linkMap": {},
 "attributes": [],
 "imageUrls": [
   "https://wemall/file/111",
   "https://wemall/file/222"
 ],
 "thumbnails": {},
 "metadata": {},
 "projectId": "wemall",
 "categories": [],
 "tags": [],
 "soldAmount": {},
 "rating": {},
 "shippingFrom": {},
 "shippingFee": {},
 "specification": {},
 "shops": [],
 "keywords": [],
 "monitoringPrice": false,
 "calculated": {
   "price": {
     "normal-max": 33,
     "normal-min": 33
   },
   "imageUrls": [
     "https://wemall/file/111",
     "https://wemall/file/222"
   ]
 },
 "externalRef": "100",
 "batchId": "b3",
 "source": "shopee",
 "price": {
   "normal": 33
 },
 "videoUrls": [],
 "managePricing": false,
 "related": {
   "categories": [
     "กีฬาและกิจกรรมกลางแจ้ง"
   ]
 },
 "variants": [
   {
     "lastModifiedBy": "or-test",
     "lastModifiedDate": "2020-11-19T06:37:19.846Z",
     "id": "5fb50131af7d83202c3c7236",
     "name": {
           "th": "🔥ถูกที่สุด+",
           "en": "🔥Hot price"
     },
     "sku": "100",
     "thumbnails": {},
     "imageUrls": [
       "https://wemall/file/111",
       "https://wemall/file/222"
     ],
     "status": "ACTIVE",
     "channelStatus": {},
     "deliverableStatus": {},
     "linkMap": {},
     "price": {
       "normal": 33
     },
     "projectId": "wemall",
     "categories": [],
     "tags": [],
     "attributeValues": {},
     "metadata": {},
     "externalRef": "P001"
   }
 ]
} 

# Delete product by externalRef

Method: DELETE
Path: /shop/api/projects/{projId}/product-models/by-external-ref/{source}/{externalRef}
Description: delete product model with its variants by the source and externalRef

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Param:

Key Description Type Required
projId Id of project String Y
source source of imported data String Y
externalRef external reference of imported data String Y

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/wemall/product-models/by-external-ref/wemall/P001' \
  -H 'Authorization: Bearer {O2O Access Token}'\

Response Example:

HTTP/1.1 204 No Content

# Setting

# Create Setting

Method: POST Path: /shop/api/projects/{projId}/settings
Description: Create setting that is effective from create/update product and search api.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of setting that unique value. String N
data The data of setting that dynamic type. Object N

Example Request:

curl -X POST \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "name" : "brand_search_access_control",
          "data" : {
              "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4" : {
                   "exclude" : [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId",
                      "$[*].metadata"
                  ]
              }
          }
      }'

Response Example:

HTTP/1.1 201 CREATED
{
    "id": "5fc75d239c560b06455b8b4f",
    "projectId": "5f6467cf723c4100015af031",
    "name": "brand_search_access_control",
    "data": {
        "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4": {
            "exclude": [
                "$[*].createdDate",
                "$[*].createdBy",
                "$[*].lastModifiedBy",
                "$[*].lastModifiedDate",
                "$[*].projectId",
                "$[*].metadata"
            ]
        },
        "0a7d01d5-2c6b-424a-a844-58c1eceec66d": {
            "exclude": [
                "$[*].createdDate",
                "$[*].createdBy",
                "$[*].lastModifiedBy",
                "$[*].lastModifiedDate",
                "$[*].projectId"
            ]
        }
    }
}

# Update Setting

Method: PUT
Path: /shop/api/projects/{projId}/settings
Description: Update setting that is effective from create/update product and search api.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Request Body:

Param Description Type Required
name The name of setting that unique value. String N
data The data of setting that dynamic type. Object N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "id": "5fc75d239c560b06455b8b4f",
          "name" : "brand_search_access_control",
          "data" : {
              "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4" : {
                   "exclude" : [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId",
                      "$[*].metadata"
                  ]
              }
          }
      }'

Response Example:

HTTP/1.1 200 OK
{
    "id": "5fc75d239c560b06455b8b4f",
    "projectId": "5f6467cf723c4100015af031",
    "name": "brand_search_access_control",
    "data": {
        "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4": {
            "exclude": [
                "$[*].createdDate",
                "$[*].createdBy",
                "$[*].lastModifiedBy",
                "$[*].lastModifiedDate",
                "$[*].projectId",
                "$[*].metadata"
            ]
        },
        "0a7d01d5-2c6b-424a-a844-58c1eceec66d": {
            "exclude": [
                "$[*].createdDate",
                "$[*].createdBy",
                "$[*].lastModifiedBy",
                "$[*].lastModifiedDate",
                "$[*].projectId"
            ]
        }
    }
}

# Get All Settings

Method: GET Path: /shop/api/projects/{projId}/settings
Description: Get list of settings

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK
[
    {
        "id": "5fc75d239c560b06455b8b4f",
        "projectId": "5f6467cf723c4100015af031",
        "name": "brand_search_access_control",
        "data": {
            "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4": {
                "exclude": [
                    "$[*].createdDate",
                    "$[*].createdBy",
                    "$[*].lastModifiedBy",
                    "$[*].lastModifiedDate",
                    "$[*].projectId",
                    "$[*].metadata"
                ]
            },
            "0a7d01d5-2c6b-424a-a844-58c1eceec66d": {
                "exclude": [
                    "$[*].createdDate",
                    "$[*].createdBy",
                    "$[*].lastModifiedBy",
                    "$[*].lastModifiedDate",
                    "$[*].projectId"
                ]
            }
        }
    }
]

# Get Setting

Method: GET Path: /shop/api/projects/{projId}/settings/{name}
Description: Get a setting by name.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X GET \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings/5fc75d239c560b06455b8b4f' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 200 OK

   {
          "id": "5fc75d239c560b06455b8b4f",
          "projectId": "5f6467cf723c4100015af031",
          "name": "brand_search_access_control",
          "data": {
              "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4": {
                  "exclude": [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId",
                      "$[*].metadata"
                  ]
              },
              "0a7d01d5-2c6b-424a-a844-58c1eceec66d": {
                  "exclude": [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId"
                  ]
              }
          }
      }

# Delete Setting

Method: DELETE Path: /shop/api/projects/{projId}/settings/{name}
Description: Delete a setting by name.

Client Scope: -
Authority: -

Request Header:

Param Description Required Example
Authorization The OAuth2 authentication with the O2O System Y Bearer {O2O Access Token}
Content-Type The MIME type of this content Y application/json

Example Request:

curl -X DELETE \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings/5fc75d239c560b06455b8b4f' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'

Response Example:

HTTP/1.1 204 No Content

Brand, shop, product-model and product and specific fields to response with setting api.

Data request:

Param Description Type Required
data.${client_id}.exclude The field that want to exclude from response. List N
data.${client_id}.include The field that want to exclude all except this field from response. List N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "name": "product_model_search_access_control",
            "data": {
              "f561c80b-9232-4e8e-aadf-3c30fd8ce5a4": {
                  "exclude": [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId",
                      "$[*].metadata"
                  ],
                  "include": [
                      "$[*].calculated.price.normal-min"
                  ]
              },
              "0a7d01d5-2c6b-424a-a844-58c1eceec66d": {
                  "exclude": [
                      "$[*].createdDate",
                      "$[*].createdBy",
                      "$[*].lastModifiedBy",
                      "$[*].lastModifiedDate",
                      "$[*].projectId"
                  ]
              }
           }
      }'

Example specific search with setting:

[
    {
        "id": "5fd9c65c19e581260ec45a6b",
        "name": {
            "en": "tset",
            "th": "test"
        },
        "status": "ACTIVE",
        "publishedStatus": {
            "website": "PUBLISHED",
            "mobile": "PUBLISHED"
        },
        "deliverableStatus": {
            "website": true,
            "mobile": true
        },
        "linkMap": {},
        "imageUrls": [],
        "thumbnails": {},
        "attributes": [],
        "categories": [
            {
                "id": "5f900f80ea30bd745e74821e",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "th": "อุปกรณ์อิเล็กทรอนิกส์",
                    "en": "Electronics"
                },
                "parentId": null,
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "monitoringPrice": false,
        "description": {},
        "calculated": {
            "price": {
                "normal-max": 0.0,
                "normal-min": 0.0
            },
            "imageUrls": []
        },
        "source": null,
        "externalRef": null,
        "batchId": null,
        "price": {
            "normal": 0.0
        },
        "videoUrls": [],
        "managePricing": true,
        "related": null
    },
    {
        "id": "5f9f7e7470f3cd12039ccdef",
        "name": {
            "th": "ไอโฟน 12 โปร แม็ค1",
            "en": "Iphone 12 pro max1"
        },
        "status": "ACTIVE",
        "publishedStatus": {
            "website": "PUBLISHED",
            "mobile": "HIDDEN"
        },
        "deliverableStatus": {
            "website": true,
            "mobile": false
        },
        "linkMap": {},
        "imageUrls": [
            "https://dev-cms.weomni-test.com/projects/5f6467cf723c4100015af031/content-types/5f744296ebceda0001d05b5e/contents/5f7443ba69ee4f00015511af/file.jpeg?version=1",
            "https://dev-cms.weomni-test.com/projects/5f6467cf723c4100015af031/content-types/5f744296ebceda0001d05b5e/contents/5f7443b869ee4f00015511ae/file.jpeg?version=4",
            "https://dev-cms.weomni-test.com/projects/5f6467cf723c4100015af031/content-types/5f744296ebceda0001d05b5e/contents/5f7443b269ee4f00015511ab/file.jpeg?version=2"
        ],
        "thumbnails": {},
        "attributes": [],
        "categories": [
            {
                "id": "5f900f80ea30bd745e74821e",
                "projectId": "5f6467cf723c4100015af031",
                "name": {
                    "th": "อุปกรณ์อิเล็กทรอนิกส์",
                    "en": "Electronics"
                },
                "parentId": null,
                "status": "ACTIVE",
                "group": "PRODUCT"
            }
        ],
        "tags": [],
        "soldAmount": {},
        "rating": {},
        "shippingFrom": {},
        "shippingFee": {},
        "specification": {},
        "monitoringPrice": false,
        "description": {
            "th": "A14 Bionic ที่แรงแซงหน้าชิพในบรรดาสมาร์ทโฟนอื่นๆ\nไปไกลหลายขุม ระบบกล้องระดับโปรที่ยกระดับการถ่ายภาพใน\nสภาวะแสงน้อยไปอีกขั้น และยิ่งเหนือชั้นขึ้นไปอีกบน\niPhone 12 Pro Max รวมทั้ง Ceramic Shield ที่ทนต่อการตกกระแทก\nได้ดีขึ้น 4 เท่า มาดูกันว่าโทรศัพท์เครื่องนี้ทำอะไรได้บ้าง\n\n\n",
            "en": "A14 Bionic ที่แรงแซงหน้าชิพในบรรดาสมาร์ทโฟนอื่นๆ\nไปไกลหลายขุม ระบบกล้องระดับโปรที่ยกระดับการถ่ายภาพใน\nสภาวะแสงน้อยไปอีกขั้น และยิ่งเหนือชั้นขึ้นไปอีกบน\niPhone 12 Pro Max รวมทั้ง Ceramic Shield ที่ทนต่อการตกกระแทก\nได้ดีขึ้น 4 เท่า มาดูกันว่าโทรศัพท์เครื่องนี้ทำอะไรได้บ้าง\n\n\n"
        },
        "calculated": {},
        "source": null,
        "externalRef": null,
        "batchId": null,
        "price": {},
        "videoUrls": [
            "https://www.youtube.com/embed/tgbNymZ7vqY"
        ],
        "managePricing": false,
        "related": null
    }
]

# Setting for validation product model

Create/update product can setting for flag for validate brand and shop.

Data request:

Param Description Type Required
data.${client_id}.isRequireBrand The flag for require brand when create/update product model Boolean N
data.${client_id}.isRequireShop The flag for require brand when create/update product model Boolean N

Example Request:

curl -X PUT \
  'http://dev-platform.weomni-test.com/shop/api/projects/5f6467cf723c4100015af031/settings' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {O2O Access Token}'\
  -d '{
          "name": "product_model_validation",
          "data": {
              "isRequireBrand": true,
              "isRequireShop": false
          }
      }'

Example create/update product model with require brand:

{
    "entityName": "shopBrand",
    "errorKey": "categorynotexist",
    "type": "https://www.jhipster.tech/problem/problem-with-message",
    "title": "Category Ids: 5fb489c00d454c34c1e5ddcd, 5fb489c00d454c34c1e5ddcd1 does not exist",
    "status": 400,
    "message": "error.categorynotexist",
    "params": "shopBrand"
}
Last Updated: 6/15/2022, 9:56:46 AM