# Shop Management APIs

# Brand API

# Create brand

Method: POST
Path: /shopmgmt/api/weshop/brands
Description: Create a new brand, require client scope as below.

Client Scope:
- ws.brand.w

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
data The attributes and values of brand content Object Y
data.merchantId Id of merchant or Id of brands String Y
data.nameTh Name of brand in Thai String N
data.nameEn Name of brand in English String N
data.onlineStatus Online status of brand String Y
data.socialLine Line id of brand String N
data.tsmMerchantId merchant id of true smart merchant String N
data.subCategoryId Sub category id of brand String N
data.subCategoryDescription Sub category description of brand String N
data.categoryDescription Description of brand category String N
data.socialFacebook Url social facebook String N
data.logoImage Brand logo image String N
data.socialInstagram Instagram of brand String N
data.socialWebsite Url website String N
data.socialTwitter Twitter of brand String N
data.categoryId Category Id of brand String N

Request Body Example:

{
	 "data": {
            "merchantId": "595292",
            "nameTh": "ข้าวแกง",
            "nameEn": "khao kang",
            "tsmMerchantId": "0346321",
            "onlineStatus": "true",
            "socialLine": "",
            "subCategoryId": "5812",
            "subCategoryDescription": "อาหาร",
            "categoryDescription": "อาหารและเครื่องดื่ม",
            "socialFacebook": "https://www.facebook.com/",
            "logoImage": null,
            "socialInstagram": "",
            "socialWebsite": "",
            "socialTwitter": "",
            "categoryId": "5948d60ee1382323583e31c7"
        }
}

Request Example:

curl -X POST \
--header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' -d '{ \ 
 	 "data": { \ 
             "merchantId": "595292", \ 
             "nameTh": "ข้าวแกง", \ 
             "nameEn": "khao kang", \ 
             "tsmMerchantId": "0346321", \ 
             "onlineStatus": "true", \ 
             "socialLine": "", \ 
             "subCategoryId": "5812", \ 
             "subCategoryDescription": "อาหาร", \ 
             "categoryDescription": "อาหารและเครื่องดื่ม", \ 
             "socialFacebook": "https://www.facebook.com/", \ 
             "logoImage": null, \ 
             "socialInstagram": "", \ 
             "socialWebsite": "", \ 
             "socialTwitter": "", \ 
             "categoryId": "5948d60ee1382323583e31c7" \ 
         } \ 
 }' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/brands'

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
    "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
    "createdDate": "2020-06-15T08:04:58.090Z",
    "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
    "lastModifiedDate": "2020-06-15T08:04:58.090Z",
    "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
    "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
    "id": "5ee72baaeb96da000135858f",
    "projectId": "5d42a4b6f085380001da6a63",
    "data": {
        "nameTh": "ข้าวแกง",
        "tsmMerchantId": "0346321",
        "onlineStatus": "true",
        "socialLine": "",
        "nameEn": "khao kang",
        "subCategoryId": "5812",
        "subCategoryDescription": "อาหาร",
        "categoryDescription": "อาหารและเครื่องดื่ม",
        "socialFacebook": "https://www.facebook.com/",
        "logoImage": null,
        "merchantId": "595292",
        "socialInstagram": "",
        "socialWebsite": "",
        "socialTwitter": "",
        "categoryId": "5948d60ee1382323583e31c7"
    }
}

# Update brand

Method: PUT
Path: /shopmgmt/api/weshop/brands/{id}
Description: Update a exist brand, require client scope as below.

Client Scope:
- ws.brand.w

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
data The attributes and values of brand content Object Y
data.merchantId Id of merchant or Id of brands String Y
data.onlineStatus Online status of brand String Y
data.nameTh Name of brand in Thai String N
data.nameEn Name of brand in English String N
data.socialLine Line id of brand String N
data.tsmMerchantId merchant id of true smart merchant String N
data.subCategoryId Sub category id of brand String N
data.subCategoryDescription Sub category description of brand String N
data.categoryDescription Description of brand category String N
data.socialFacebook Url social facebook String N
data.logoImage Brand logo image String N
data.socialInstagram Instagram of brand String N
data.socialWebsite Url website String N
data.socialTwitter Twitter of brand String N
data.categoryId Category Id of brand String N

Request Body Example:

{
	 "data": {
            "merchantId": "5952911",
            "nameTh": "ข้าวแกง",
            "nameEn": "khao kang",
            "tsmMerchantId": "0346321",
            "onlineStatus": "true",
            "socialLine": "",
            "subCategoryId": "5812",
            "subCategoryDescription": "อาหาร",
            "categoryDescription": "อาหารและเครื่องดื่ม",
            "socialFacebook": "https://www.facebook.com/",
            "logoImage": null,
            "socialInstagram": "",
            "socialWebsite": "",
            "socialTwitter": "",
            "categoryId": "5948d60ee1382323583e31c7"
        }
}

Request Example:

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' -d '{ \ 
 	 "data": { \ 
             "merchantId": "5952911", \ 
             "nameTh": "ข้าวแกงใต้", \ 
             "nameEn": "khao kang", \ 
             "tsmMerchantId": "0346321", \ 
             "onlineStatus": "true", \ 
             "socialLine": "", \ 
             "subCategoryId": "5812", \ 
             "subCategoryDescription": "อาหาร", \ 
             "categoryDescription": "อาหารและเครื่องดื่ม", \ 
             "socialFacebook": "https://www.facebook.com/", \ 
             "logoImage": null, \ 
             "socialInstagram": "", \ 
             "socialWebsite": "", \ 
             "socialTwitter": "", \ 
             "categoryId": "5948d60ee1382323583e31c7" \ 
         } \ 
 }' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/brands/5ee72baaeb96da000135858f'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
      "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "createdDate": "2020-06-15T06:11:06.546Z",
      "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedDate": "2020-06-15T06:11:39.945Z",
      "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "id": "5ee710fa3508260001d96b8c",
      "projectId": "5d42a4b6f085380001da6a63",
      "data": {
        "nameTh": "ข้าวแกงใต้",
        "tsmMerchantId": "0346321",
        "onlineStatus": "true",
        "socialLine": "",
        "nameEn": "khao kang",
        "subCategoryId": "5812",
        "subCategoryDescription": "อาหาร",
        "categoryDescription": "อาหารและเครื่องดื่ม",
        "socialFacebook": "https://www.facebook.com/",
        "logoImage": null,
        "merchantId": "5952911",
        "socialInstagram": "",
        "socialWebsite": "",
        "socialTwitter": "",
        "categoryId": "5948d60ee1382323583e31c7"
      }
}

# Get brand

Method: GET
Path: /shopmgmt/api/weshop/brands/{id}
Description: Get brand by brandId, require client scope as below.

Client Scope:
- ws.brand.r

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 Example:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/brands/5ee72baaeb96da000135858f'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
      "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "createdDate": "2020-06-15T06:11:06.546Z",
      "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedDate": "2020-06-15T06:11:39.945Z",
      "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "id": "5ee710fa3508260001d96b8c",
      "projectId": "5d42a4b6f085380001da6a63",
      "data": {
        "nameTh": "ข้าวแกงใต้",
        "tsmMerchantId": "0346321",
        "onlineStatus": "true",
        "socialLine": "",
        "nameEn": "khao kang",
        "subCategoryId": "5812",
        "subCategoryDescription": "อาหาร",
        "categoryDescription": "อาหารและเครื่องดื่ม",
        "socialFacebook": "https://www.facebook.com/",
        "logoImage": null,
        "merchantId": "5952911",
        "socialInstagram": "",
        "socialWebsite": "",
        "socialTwitter": "",
        "categoryId": "5948d60ee1382323583e31c7"
      }
}

# Search brand

Method: GET
Path: /shopmgmt/api/weshop/brands
Description: List all brands or get brand by criteria.

Client Scope:
- ws.brand.r

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
data search by attribute name and value N data.merchantId=5952911
page The requested page number to display N page=0
size The page size of the result in response body N size=10
sort Sorting criteria. Default sort order is ascending. Multiple sort criteria are supported. N sort=id,desc
createdBy.<operator_name> search by createdBy that support operator only 'equals' N createdBy.equals=admin
createdDate.<operator_name>. search by createdDate that support operator 'greaterThan', 'greaterOrEqualThan', 'lessThan' and 'lessOrEqualThan' N createdDate.greaterThan='2020-04-16T02:15:11.455Z'
lastModifiedBy.<operator_name> search by lastModifiedBy that support operator only 'equals' N lastModifiedBy.equals=admin
lastModifiedDate.<operator_name> search by lastModifiedDate that support operator 'greaterThan', 'greaterOrEqualThan', 'lessThan' and 'lessOrEqualThan' N lastModifiedDate.greaterOrEqualThan='2020-04-16T02:15:11.455Z'

Operator_Name:

Operator Description Required Example
equals search by key and value N createdBy.equals=admin
greaterThan search date type that can search greater than date in value N createdDate.greaterThan='2020-04-16T02:15:11.455Z'
greaterOrEqualThan search date type that can search greater or equal than date in value N createdDate.greaterOrEqualsThan='2020-04-16T02:15:11.455Z'
lessThan search date type that can search less or equal than date in value N lastModifiedDate.lessThan='2020-04-16T02:15:11.455Z'
lessThanOrEqualThan search date type that can search less or equal than date in value N lastModifiedDate.lessOrEquallThan='2020-04-16T02:15:11.455Z'

Request Example:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/brands?createdDate.greaterOrEqualThan=2020-06-15T06:11:06.546Z&sort=id,desc&page=0&size=10&data.merchantId=5952911' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
     [
         {
             "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
             "createdDate": "2020-06-15T06:11:06.546Z",
             "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
             "lastModifiedDate": "2020-06-15T06:11:39.945Z",
             "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
             "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
             "id": "5ee710fa3508260001d96b8c",
             "projectId": "5d42a4b6f085380001da6a63",
             "data": {
                 "nameTh": "ข้าวแกงใต้",
                 "tsmMerchantId": "0346321",
                 "onlineStatus": "true",
                 "socialLine": "",
                 "nameEn": "khao kang",
                 "subCategoryId": "5812",
                 "subCategoryDescription": "อาหาร",
                 "categoryDescription": "อาหารและเครื่องดื่ม",
                 "socialFacebook": "https://www.facebook.com/",
                 "logoImage": null,
                 "merchantId": "5952911",
                 "socialInstagram": "",
                 "socialWebsite": "",
                 "socialTwitter": "",
                 "categoryId": "5948d60ee1382323583e31c7"
             }
         }
     ]
}

# Shop API

# Create shop

Method: POST
Path: /shopmgmt/api/weshop/shops/{id}
Description: Create a new shop, require client scope as below.

Client Scope:
- ws.shop.w

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
data The attributes and values of brand content Object Y
data.brandId Brand id of shop String Y
data.outletId Id of shop String Y
data.tsmMerchantId Merchant id of true smart merchant String N
data.onlineStatus Online status of brand String Y
data.subCategoryDescription Sub category description of shop String N
data.categoryDescription Description of shop category String N
data.province Province of shop String N
data.zone Area of shop String N
data.averageRating Rating average of shop String N
data.publishStatus Status of shop publisher String N
data.shopNameTh Shop name in Thai String N
data.shopNameEn Shop name in English String N
data.address Address of shop String N
data.subCategoryId Sub category id of shop String N
data.shopMobile Mobile Tel of shop String N
data.shopTel Tel of shop String N
data.logoImage Shop logo image String N
data.district District of shop String N
data.shopHighlight Highlight description of shop String N
data.postCode Postcode of shop String N
data.openDate Shop open date String N
data.tsmOutletId Id of shop in true smart merchant String N
data.subDistrict Sub districts of shop String N
data.categoryId Category id of shop String N
data.<attribute_name>.latitude A latitude of shop origin point String N
data.<attribute_name>.longitude A longitude of shop origin point String N
data.<attribute_name>.type Type of location String N

Request Body Example:

{
  "data": {
            "outletId": "12345",
            "tsmMerchantId": "0138737",
            "onlineStatus": "true",
            "subCategoryDescription": "",
            "categoryDescription": "อาหารและเครื่องดื่ม",
            "province": "เชียงราย",
            "zone": "asoke",
            "averageRating": "4",
            "publishStatus": "true",
            "shopNameEn": "aroytaledead",
            "geo_location": {
                "longitude": "99.818892",
                "latitude": "19.901981",
                "type": "POINT_LOCATION"
            },
            "address": "ถนนคนม่วน",
            "subCategoryId": "",
            "shopMobile": "66-861894654",
            "shopTel": "66-861894654",
            "logoImage": null,
            "brandId": "11111",
            "district": "เมืองตราด",
            "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
            "postCode": "57000",
            "openDate": "",
            "tsmOutletId": "00001",
            "subDistrict": "รอบเวียง",
            "shopNameTh": "อร่อยทะเลเดือด",
            "categoryId": "5948d60ee1382323583e31c7"
        }
}

Request Example:

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' -d '{ \ 
   "data": { \ 
             "outletId": "12345", \ 
             "tsmMerchantId": "0138737", \ 
             "onlineStatus": "true", \ 
             "subCategoryDescription": "", \ 
             "categoryDescription": "อาหารและเครื่องดื่ม", \ 
             "province": "เชียงราย", \ 
             "zone": "asoke", \ 
             "averageRating": "4", \ 
             "publishStatus": "true", \ 
             "shopNameEn": "aroytaledead", \ 
             "geo_location": { \ 
                 "longitude": "99.818892", \ 
                 "latitude": "19.901981", \ 
                 "type": "POINT_LOCATION" \ 
             }, \ 
             "address": "ถนนคนม่วน", \ 
             "subCategoryId": "", \ 
             "shopMobile": "66-861894654", \ 
             "shopTel": "66-861894654", \ 
             "logoImage": null, \ 
             "brandId": "11111", \ 
             "district": "เมืองตราด", \ 
             "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด", \ 
             "postCode": "57000", \ 
             "openDate": "", \ 
             "tsmOutletId": "00001", \ 
             "subDistrict": "รอบเวียง", \ 
             "shopNameTh": "อร่อยทะเลเดือด", \ 
             "categoryId": "5948d60ee1382323583e31c7" \ 
         } \ 
 }' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/shops'

Response Example:

HTTP/1.1 201 CREATED
Content-Type: application/json
{
      "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "createdDate": "2020-06-15T06:46:47.169Z",
      "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedDate": "2020-06-15T06:46:47.169Z",
      "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "id": "5ee719573508260001d96b9c",
      "projectId": "5d42a4b6f085380001da6a63",
      "data": {
        "tsmMerchantId": "0138737",
        "onlineStatus": "true",
        "subCategoryDescription": "",
        "categoryDescription": "อาหารและเครื่องดื่ม",
        "province": "เชียงราย",
        "zone": "asoke",
        "averageRating": "4",
        "publishStatus": "true",
        "shopNameEn": "aroytaledead",
        "geo_location": {
          "longitude": "99.818892",
          "latitude": "19.901981",
          "type": "POINT_LOCATION"
        },
        "address": "ถนนคนม่วน",
        "outletId": "12345",
        "subCategoryId": "",
        "shopMobile": "66-861894654",
        "shopTel": "66-861894654",
        "logoImage": null,
        "brandId": "11111",
        "district": "เมืองตราด",
        "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
        "postCode": "57000",
        "openDate": "",
        "tsmOutletId": "00001",
        "subDistrict": "รอบเวียง",
        "shopNameTh": "อร่อยทะเลเดือด",
        "categoryId": "5948d60ee1382323583e31c7"
      }
}

# Update shop

Method: PUT
Path: /shopmgmt/api/weshop/shops/{id}
Description: Update a exist shop, require client scope as below.

Client Scope:
- ws.shop.w

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
data The attributes and values of brand content Object Y
data.brandId Brand id of shop String Y
data.outletId Id of shop String Y
data.tsmMerchantId Merchant id of true smart merchant String N
data.onlineStatus Online status of brand String Y
data.subCategoryDescription Sub category description of shop String N
data.categoryDescription Description of shop category String N
data.province Province of shop String N
data.zone Area of shop String N
data.averageRating Rating average of shop String N
data.publishStatus Status of shop publisher String N
data.shopNameTh Shop name in Thai String N
data.shopNameEn Shop name in English String N
data.address Address of shop String N
data.subCategoryId Sub category id of shop String N
data.shopMobile Mobile Tel of shop String N
data.shopTel Tel of shop String N
data.logoImage Shop logo image String N
data.district District of shop String N
data.shopHighlight Highlight description of shop String N
data.postCode Postcode of shop String N
data.openDate Shop open date String N
data.tsmOutletId Id of shop in true smart merchant String N
data.subDistrict Sub districts of shop String N
data.categoryId Category id of shop String N
data.<attribute_name>.latitude A latitude of shop origin point String N
data.<attribute_name>.longitude A longitude of shop origin point String N
data.<attribute_name>.type Type of location String N

Request Body Example:

{
  "data": {
            "outletId": "12345",
            "tsmMerchantId": "0138737",
            "onlineStatus": "true",
            "subCategoryDescription": "",
            "categoryDescription": "อาหารและเครื่องดื่ม",
            "province": "ตราด",
            "zone": "asoke",
            "averageRating": "4",
            "publishStatus": "true",
            "shopNameEn": "aroytaledead",
            "geo_location": {
                "longitude": "99.818892",
                "latitude": "19.901981",
                "type": "POINT_LOCATION"
            },
            "address": "ถนนคนม่วน",
            "subCategoryId": "",
            "shopMobile": "66-861894654",
            "shopTel": "66-861894654",
            "logoImage": null,
            "brandId": "11111",
            "district": "เมืองตราด",
            "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
            "postCode": "57000",
            "openDate": "",
            "tsmOutletId": "00001",
            "subDistrict": "รอบเวียง",
            "shopNameTh": "อร่อยทะเลเดือด",
            "categoryId": "5948d60ee1382323583e31c7"
        }
}

Request Example:

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' -d '{ \ 
   "data": { \ 
             "outletId": "12345", \ 
             "tsmMerchantId": "0138737", \ 
             "onlineStatus": "true", \ 
             "subCategoryDescription": "", \ 
             "categoryDescription": "อาหารและเครื่องดื่ม", \ 
             "province": "ตราด", \ 
             "zone": "asoke", \ 
             "averageRating": "4", \ 
             "publishStatus": "true", \ 
             "shopNameEn": "aroytaledead", \ 
             "geo_location": { \ 
                 "longitude": "99.818892", \ 
                 "latitude": "19.901981", \ 
                 "type": "POINT_LOCATION" \ 
             }, \ 
             "address": "ถนนคนม่วน", \ 
             "subCategoryId": "", \ 
             "shopMobile": "66-861894654", \ 
             "shopTel": "66-861894654", \ 
             "logoImage": null, \ 
             "brandId": "11111", \ 
             "district": "เมืองตราด", \ 
             "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด", \ 
             "postCode": "57000", \ 
             "openDate": "", \ 
             "tsmOutletId": "00001", \ 
             "subDistrict": "รอบเวียง", \ 
             "shopNameTh": "อร่อยทะเลเดือด", \ 
             "categoryId": "5948d60ee1382323583e31c7" \ 
         } \ 
 }' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/shops/5ee719573508260001d96b9c'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
     {
           "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
           "createdDate": "2020-06-15T06:46:47.169Z",
           "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
           "lastModifiedDate": "2020-06-15T06:51:13.247Z",
           "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
           "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
           "id": "5ee719573508260001d96b9c",
           "projectId": "5d42a4b6f085380001da6a63",
           "data": {
             "tsmMerchantId": "0138737",
             "onlineStatus": "true",
             "subCategoryDescription": "",
             "categoryDescription": "อาหารและเครื่องดื่ม",
             "province": "ตราด",
             "zone": "asoke",
             "averageRating": "4",
             "publishStatus": "true",
             "shopNameEn": "aroytaledead",
             "geo_location": {
               "longitude": "99.818892",
               "latitude": "19.901981",
               "type": "POINT_LOCATION"
             },
             "address": "ถนนคนม่วน",
             "outletId": "12345",
             "subCategoryId": "",
             "shopMobile": "66-861894654",
             "shopTel": "66-861894654",
             "logoImage": null,
             "brandId": "11111",
             "district": "เมืองตราด",
             "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
             "postCode": "57000",
             "openDate": "",
             "tsmOutletId": "00001",
             "subDistrict": "รอบเวียง",
             "shopNameTh": "อร่อยทะเลเดือด",
             "categoryId": "5948d60ee1382323583e31c7"
           }
     }
}

# Get shop

Method: GET
Path: /shopmgmt/api/weshop/shops/{id}
Description: Get shop by brandId and shopId, require client scope as below.

Client Scope:
- ws.shop.r

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 Example:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/shops/5ee719573508260001d96b9c'

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
{
      "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "createdDate": "2020-06-15T06:46:47.169Z",
      "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedDate": "2020-06-15T06:51:13.247Z",
      "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
      "id": "5ee719573508260001d96b9c",
      "projectId": "5d42a4b6f085380001da6a63",
      "data": {
        "tsmMerchantId": "0138737",
        "onlineStatus": "true",
        "subCategoryDescription": "",
        "categoryDescription": "อาหารและเครื่องดื่ม",
        "province": "ตราด",
        "zone": "asoke",
        "averageRating": "4",
        "publishStatus": "true",
        "shopNameEn": "aroytaledead",
        "geo_location": {
          "longitude": "99.818892",
          "latitude": "19.901981",
          "type": "POINT_LOCATION"
        },
        "address": "ถนนคนม่วน",
        "outletId": "12345",
        "subCategoryId": "",
        "shopMobile": "66-861894654",
        "shopTel": "66-861894654",
        "logoImage": null,
        "brandId": "11111",
        "district": "เมืองตราด",
        "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
        "postCode": "57000",
        "openDate": "",
        "tsmOutletId": "00001",
        "subDistrict": "รอบเวียง",
        "shopNameTh": "อร่อยทะเลเดือด",
        "categoryId": "5948d60ee1382323583e31c7"
      }
}

# Search brand

Method: GET
Path: /shopmgmt/api/weshop/shops
Description: List all brands or get brand by criteria.

Client Scope:
- ws.shop.r

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
data search by attribute name and value N data.merchantId=5952911
page The requested page number to display N page=0
size The page size of the result in response body N size=10
sort Sorting criteria. Default sort order is ascending. Multiple sort criteria are supported. N sort=id,desc
createdBy.<operator_name> search by createdBy that support operator only 'equals' N createdBy.equals=admin
createdDate.<operator_name>. search by createdDate that support operator 'greaterThan', 'greaterOrEqualThan', 'lessThan' and 'lessOrEqualThan' N createdDate.greaterThan='2020-04-16T02:15:11.455Z'
lastModifiedBy.<operator_name> search by lastModifiedBy that support operator only 'equals' N lastModifiedBy.equals=admin
lastModifiedDate.<operator_name> search by lastModifiedDate that support operator 'greaterThan', 'greaterOrEqualThan', 'lessThan' and 'lessOrEqualThan' N lastModifiedDate.greaterOrEqualThan='2020-04-16T02:15:11.455Z'

Operator_Name:

Operator Description Required Example
equals search by key and value N createdBy.equals=admin
greaterThan search date type that can search greater than date in value N createdDate.greaterThan='2020-04-16T02:15:11.455Z'
greaterOrEqualThan search date type that can search greater or equal than date in value N createdDate.greaterOrEqualsThan='2020-04-16T02:15:11.455Z'
lessThan search date type that can search less or equal than date in value N lastModifiedDate.lessThan='2020-04-16T02:15:11.455Z'
lessThanOrEqualThan search date type that can search less or equal than date in value N lastModifiedDate.lessOrEquallThan='2020-04-16T02:15:11.455Z'

Request Example:

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer {O2O Access Token}' 'https://dev-platform.weomni-test.com/shopmgmt/api/weshop/shops?data.outletId=12345&createdDate.greaterThan=2020-06-15T06:46:47.168Z&sort=id,desc&page=0&size=10' \

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
[
    {
        "createdBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
        "createdDate": "2020-06-15T06:46:47.169Z",
        "lastModifiedBy": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
        "lastModifiedDate": "2020-06-15T06:51:13.247Z",
        "createdByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
        "lastModifiedByApp": "9fe9f9fe-d4ab-4862-bae5-8d1082ce815f",
        "id": "5ee719573508260001d96b9c",
        "projectId": "5d42a4b6f085380001da6a63",
        "data": {
            "tsmMerchantId": "0138737",
            "onlineStatus": "true",
            "subCategoryDescription": "",
            "categoryDescription": "อาหารและเครื่องดื่ม",
            "province": "ตราด",
            "zone": "asoke",
            "averageRating": "4",
            "publishStatus": "true",
            "shopNameEn": "aroytaledead",
            "geo_location": {
                "longitude": "99.818892",
                "latitude": "19.901981",
                "type": "POINT_LOCATION"
            },
            "address": "ถนนคนม่วน",
            "outletId": "12345",
            "subCategoryId": "",
            "shopMobile": "66-861894654",
            "shopTel": "66-861894654",
            "logoImage": null,
            "brandId": "11111",
            "district": "เมืองตราด",
            "shopHighlight": "ขายลูกชิ้นน้ำจิ้มทะเลเดือด",
            "postCode": "57000",
            "openDate": "",
            "tsmOutletId": "00001",
            "subDistrict": "รอบเวียง",
            "shopNameTh": "อร่อยทะเลเดือด",
            "categoryId": "5948d60ee1382323583e31c7"
        }
    }
]
Last Updated: 8/25/2020, 7:35:21 AM