双十一预售进行中 · 满 ¥299 包邮

用 Store API 搭建你的店铺

1. 获取商品

在后台“设置 → API 密钥”复制可发布密钥。

curl http://localhost:9000/store/products?limit=3 \
  -H "x-publishable-api-key: $PK" \
  -H "x-locale: en"

2. 在 JavaScript 中调用

const res = await fetch("http://localhost:9000/store/products?limit=3", {
  headers: { "x-publishable-api-key": process.env.PK, "x-locale": "en" },
})
const { products } = await res.json()

更多接口请参考 API 文档。

评论

还没有评论,来说两句吧。

评论经运营审核后才会显示。