跳到主要内容

API 使用方式

API 公共参数

详情请参阅:https://www.shoplazza.dev/reference/api-public-parameters


RESTful API

获取应用的 Access Token 后,您可以构建 RESTful API 请求来访问 Shoplazza 的 API。请求 URL 必须包含版本号以正确识别所需的 API 版本,格式如下:

RESTful API URL: https://{shopdomain}.myshoplaza.com/openapi/{ version }/{ endpoint }

例如,以下 URL 调用 2025-06 版本:

RESTful API URL: https://{shopdomain}.myshoplaza.com/openapi/2025-06/articles

注意

  • 所有 endpoint 仅可通过 HTTPS 访问。
  • 基础域名格式为 https://{shopdomain}.myshoplazza.com,其中 {shopdomain} 代表您店铺的唯一域名。
  • 使用本文档中的"试用"功能时,{shopdomain} 已预填为 Shoplazza 提供的测试店铺,方便您进行操作。

RESTful API 调用示例

以下 curl 请求通过 Article API 的 GET /openapi/2025-06/articles endpoint 获取信息。请将 {shopdomain} 替换为您店铺的域名,{token} 替换为您在鉴权部分生成的 access token。
请求:

curl -X GET \
https://{shopdomain}.myshoplaza.com/openapi/2025-06/articles/id \-H 'Content-Type: application/json' \-H 'Access-Token: {token}'

Response 示例:

{
"code" : "string",
"message" : "string",
"data" : {
"article" : {
"author" : "string",
"blog_ids" : [
"string"
],
"content" : "string",
"created_at" : "string",
"excerpt" : "string",
"handle" : "string",
"id" : "string",
"image" : {
"height" : 0,
"path" : "string",
"src" : "string",
"width" : 0
},
"published" : true,
"published_at" : "string",
"seo_description" : "string",
"seo_keywords" : [
"string"
],
"seo_title" : "string",
"title" : "string",
"updated_at" : "string"
}
}
}

如果您的应用调用了已不再支持的版本,请求将返回 404 状态码。

Cursor 分页

详情请参阅: https://www.shoplazza.dev/reference/pagination

如何获取 ID

详情请参阅: https://www.shoplazza.dev/reference/global-ids