The Shop Details API allows developers to fetch comprehensive information about a shop by using its unique identifier and configurable query parameters. This endpoint supports retrieving specific fields based on the user’s request. For instance, users can request key shop attributes such as id, name, and email.
This API is especially useful for:
1. Retrieving store metadata like name, owner details, and operational settings.
2. Customizing query results by specifying required fields.
3. Verifying shop details through its unique domain prefix (shopdomain).
Example: If the shop’s domain is https://store123.myshoplazza.com, the shopdomain
would be store123.
Requires
read_shop
access scope. For more access scope
Public Request Parameters
Parameter Name | Type | Required | Parameter Location | Parameter Value | Description |
---|---|---|---|---|---|
Access-Token | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | Used to authenticate API requests. Obtain an access token from the Access Token Guide. Pass it in the Authorization header for every request. |
Content-Type | String | Yes | Header | application /json | Indicates the media type of the request body. It tells the server how to parse the request and the client how to interpret the response. For more details, visit Content-Type. |
Public Response Parameters
Parameter Name | Type | Mandatory | Parameter Location | Example Value | Description |
---|---|---|---|---|---|
error | String | No | Response Body | { "error": "store is not active" } | Indicates an error encountered during the process. This field typically appears when the Access Token is missing or invalid. Example: { "error": "store is not active" } . |
errors | Array | No | Response Body | { "errors"["No Context"] } | A list of errors that occurred during the request processing. Example: { "errors": [ "No Context" ] } . |
Request-Id | String | Yes | Header | Bx-_5aV eXNwl-4AB98s5xLV yg0fNzGf MuTpqtlBA | A unique identifier for each request. It helps in identifying and debugging specific requests. |
Error and Errors Clarification:
Added explanation that the error and errors fields are currently dependent on the API implementation, with plans for future unification.
Request Parameter
Query Parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
fields | String | No | id,name,email | Specifies which fields to include in the response. Use commas to separate multiple fields. |
Response Parameters
Successful Response
Field | Type | Example | Description |
---|---|---|---|
shop.account | String | [email protected] | Email address of the shop account. |
shop.address1 | String | address1 | Primary address of the shop. |
shop.city | String | city | City where the shop is located. |
shop.country_code | String | CN | Country code of the shop's location. |
shop.created_at | String | 2023-11-08T11:51:39Z | ISO timestamp when the shop was created. |
shop.currency | String | USD | Default currency used by the shop. |
shop.email | String | [email protected] | Contact email address of the shop owner. |
shop.id | Integer | 633130 | Unique identifier for the shop. |
shop.name | String | test-shoplazza | Name of the shop. |
shop.state | String | available | Current operational state of the shop. |
shop.timezone | String | +0800 | Timezone offset for the shop location. |
Error Response
Error responses in the API can be represented using two different fields: errors
and error
. Both fields provide details about issues encountered during request processing. Below is an explanation of the fields with their respective examples and descriptions.
Field | Type | Example | Description |
---|---|---|---|
errors | Array | ["Context"] | A list of errors encountered during the request processing. |
Field | Type | Example | Description |
---|---|---|---|
error | String | "store is not active" | Indicates an error encountered during the process. |
Request Examples
curl --request GET \
--url https://developer.myshoplaza.com/openapi/2022-01/shop?fields=id' \
--header 'accept: application/json' \
--header 'access-token: WPMSdB6M8Cpum4X1GoMYOKZpiESd8d2x7dZW8d79ZeQ'
const url = 'https://developer.myshoplaza.com/openapi/2022-01/shop?fields=id';
const options = {
method: 'GET',
headers: {
accept: 'application/json',
'access-token': 'WPMSdB6M8Cpum4X1GoMYOKZpiESd8d2x7dZW8d79ZeQ'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
Success Response Example
{
"shop": {
"account": "[email protected]",
"address1": "address1",
"address2": "",
"city": "city",
"country_code": "CN",
"created_at": "2023-11-08T11:51:39Z",
"currency": "USD",
"customer_email": "[email protected]",
"domain": "test-shoplazza.stg.myshoplaza.com",
"email": "[email protected]",
"icon": {
"alt": "",
"path": "55f1a60e47d1462c7d88dec3844369f0.png",
"src": "http://img.staticdj.com/55f1a60e47d1462c7d88dec3844369f0.png"
},
"id": 633130,
"name": "test-shoplazza",
"phone": "15014471143",
"primary_locale": "en-US",
"province_code": "CN-GD",
"root_url": "",
"shop_owner": "test-shoplazza",
"state": "available",
"system_domain": "test-shoplazza.stg.myshoplaza.com",
"timezone": "+0800",
"updated_at": "2024-04-29T09:18:01Z",
"zip": "515300"
}
}
Error Response Example
{
"errors": [
"No Context"
]
}
{
"error": "store is not active"
}
Error Detail
HTTP Status Code | Error Message | Description |
---|---|---|
400 | Bad Request | The request is malformed or contains invalid parameters. |
401 | UnauthorizedError | Missing or invalid authentication credentials. |
404 | store is not active | The requested store is inactive or unavailable. |
500 | Response message parsing error | Internal server error caused by a failure in parsing the response message. |
520 | No context | The request lacks sufficient context to process successfully. |