initializeShoppingArea

POST /v2/pds/store/initializeShoppingArea

The F&B (food and beverage) mini program relies on the SaaS provider or Independent Software Vendor (ISV) to feed full data. With this API call, the SaaS provider or ISV can complete the full data synchronization of the shopping area list.

Note: To execute the full data synchronization, follow the steps below:

  1. (Optional) Full synchronization of all shopping areas via the initializeShoppingArea API. Maximum 50 shopping areas per API call. This step is required when areaId is requested in the initializeStore API.
  2. (Optional) Full synchronization of all brands via the initializeBrand API. Maximum 50 brands per API call. This step is required when brandId is requested in the initializeStore API.
  3. Full synchronization of all stores via the initializeStore API. 20 stores at most for one API call. The store data object includes menu, category, item, SKU, and modifier group information.

Structure

A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:

Request parameters

Field

Data type

Required

Description

Example

requestId

String

Yes

Indicates the unique ID assigned by the SaaS provider or ISV to identify a request for the full synchronization of shopping areas.

  • Maximum length: 255 characters

Note: This field is an idempotency field.

  • To synchronize shopping areas (more than 50) in several batches, requestId should be different for each API call.
  • For the initializeShoppingArea requests using the same requestId value, our server must return the same result.
  • For details about API idempotency, see the Idempotency chapter.

"area_2022012111061234567890"

shoppingAreas

Array<ShoppingArea>

Yes

Indicates a list of the ShoppingArea object.

  • Maximum size: 50 elements
-

Response parameters

Field

Data type

Required

Description

result

Result

Yes

Indicates the request result, such as status and error codes.

Result process logic

In the response, the result.resultStatus field indicates the result of processing a request. The following table describes each result status:

Result status

Description 

A

The request for full data synchronization of shopping areas is accepted by us.

The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section.

S

The full data synchronization of shopping areas is successful.

The corresponding result.resultCode is SUCCESS and result.resultMessage is SUCCESS.

U

The status of full data synchronization of shopping areas is unknown.

The corresponding result.resultCode is UNKNOWN_EXCEPTION and result.resultMessage is "An API calling is failed, which is caused by unknown reasons.". For details, see the Common error codes section.

F

The full data synchronization of shopping areas failed.

The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section.

Error codes

Error codes are usually classified into the following categories:

Samples

Request

copy
{
    "requestId": "202215168498545476025589001",
    "shoppingAreas": [
        {
            "name": "Toy Hawker Centre",
            "areaId": "A39200300011234546705001",
            "address": "Toy Hawker Centre,Road C,District B,City A,Country Z",
            "images": [
                "http://www.example.com/iamges/cdZOWIR73/0011icon.jpg"
            ],
            "description": "Toy Hawker Centre, the largest hawker with long history in Singapore",
            "shoppingAreaStatus": "OPEN",
            "pickUpAddress": "door one",
            "recommendItemIds": [
                "singleItem1234"
            ],
            "pickUpContactDetails": [
                {
                    "name": "John Doe",
                    "phoneNo": "9999999999"
                }
            ],
            "timeZone": "GMT+8:00",
            "serviceAvailabilityList": [
                {
                    "dayOfWeek": "MONDAY",
                    "timePeriods": [
                        {
                            "startTime": "08:00",
                            "endTime": "17:00",
                            "description": "timePeriod desc"
                        }
                    ]
                }
            ],
            "location": {
                "latitude": "24.1",
                "longitude": "154.2",
                "postCode": "9999999"
            },
            "contactPhoneNos": [
                "9999999999"
            ],
            "commentFlag": true
        }
    ]
}

Response

copy
{
    "result": {
        "resultCode": "SUCCESS",
        "resultStatus": "S",
        "resultMessage": "success"
    }
}