Branch #11 docs/api/11-marketplace.md

13. Marketplace API

Branch #11 — Catalog plugin, download, update, phân phối module trong hệ sinh thái BizCity.

Endpoints

GET
https://bizgpt.vn/wp-json/market/v1/catalog

Danh sách plugin

Auth: Bearer/Public

GET
https://bizgpt.vn/wp-json/market/v1/catalog/{slug}

Chi tiết plugin

Auth: Bearer/Public

GET
https://bizgpt.vn/wp-json/market/v1/catalog/{slug}/download

Download package

Auth: Bearer

POST
https://bizgpt.vn/wp-json/market/v1/updates

Batch check cập nhật

Auth: Bearer

GET
https://bizgpt.vn/wp-json/market/v1/categories

Category list

Auth: Public

Method Path Auth Mô tả
GET https://bizgpt.vn/wp-json/market/v1/catalog Bearer/Public Danh sách plugin
GET https://bizgpt.vn/wp-json/market/v1/catalog/{slug} Bearer/Public Chi tiết plugin
GET https://bizgpt.vn/wp-json/market/v1/catalog/{slug}/download Bearer Download package
POST https://bizgpt.vn/wp-json/market/v1/updates Bearer Batch check cập nhật
GET https://bizgpt.vn/wp-json/market/v1/categories Public Category list

Query Examples

GET Danh sách plugin
curl -X GET "https://bizgpt.vn/wp-json/market/v1/catalog" -H "Authorization: Bearer biz-YOUR_KEY"
const res = await fetch('https://bizgpt.vn/wp-json/market/v1/catalog', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
  },
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/market/v1/catalog"
headers = {'Authorization': 'Bearer biz-YOUR_KEY'}
res = requests.get(url, headers=headers)
print(res.json())
GET Chi tiết plugin
curl -X GET "https://bizgpt.vn/wp-json/market/v1/catalog/{slug}" -H "Authorization: Bearer biz-YOUR_KEY"
const res = await fetch('https://bizgpt.vn/wp-json/market/v1/catalog/{slug}', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
  },
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/market/v1/catalog/{slug}"
headers = {'Authorization': 'Bearer biz-YOUR_KEY'}
res = requests.get(url, headers=headers)
print(res.json())
GET Download package
curl -X GET "https://bizgpt.vn/wp-json/market/v1/catalog/{slug}/download" -H "Authorization: Bearer biz-YOUR_KEY"
const res = await fetch('https://bizgpt.vn/wp-json/market/v1/catalog/{slug}/download', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
  },
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/market/v1/catalog/{slug}/download"
headers = {'Authorization': 'Bearer biz-YOUR_KEY'}
res = requests.get(url, headers=headers)
print(res.json())
POST Batch check cập nhật
curl -X POST "https://bizgpt.vn/wp-json/market/v1/updates" -H "Authorization: Bearer biz-YOUR_KEY" -H "Content-Type: application/json" -d '{"sample":true}'
const res = await fetch('https://bizgpt.vn/wp-json/market/v1/updates', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer biz-YOUR_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"sample":true}),
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/market/v1/updates"
headers = {'Authorization': 'Bearer biz-YOUR_KEY', 'Content-Type': 'application/json'}
payload = '{"sample":true}'
res = requests.request("POST", url, headers=headers, data=payload)
print(res.json())
GET Category list
curl -X GET "https://bizgpt.vn/wp-json/market/v1/categories"
const res = await fetch('https://bizgpt.vn/wp-json/market/v1/categories', {
  method: 'GET',
});
const data = await res.json();
console.log(data);
import requests
url = "https://bizgpt.vn/wp-json/market/v1/categories"
headers = {}
res = requests.get(url, headers=headers)
print(res.json())

Use Cases

  • Cài thêm module CRM, POS, Astro, Content Ops từ hub.
  • Kiểm tra cập nhật plugin tập trung theo policy.
  • Quản lý entitlement plugin theo tier/license.

Implementation Steps

  1. Load catalog trên tab Marketplace của client.
  2. Download package theo slug/version.
  3. Kích hoạt module và log lifecycle trong admin.

Quick Start cURL

bash
curl -X GET "https://bizgpt.vn/wp-json/market/v1/catalog?page=1&per_page=20" -H "Authorization: Bearer biz-YOUR_KEY"
Canonical Spec

docs/api/11-marketplace.md