Izstrādātājiem
Specifikācija, uz kuras būvēt.
Open Brand Exchange ir specifikācija ar trim API, JSON shēmām, testa datiem un atbilstības testiem. Specifikācija ir patiesības avots; implementācijas tai seko.
$ curl https://brands.kestrel.example/.well-known/obx{
"obx_version": "0.1",
"publisher": { "name": "Kestrel Outfitters" },
"api_base": "https://brands.kestrel.example/obx/v1",
"portal_url": "https://brands.kestrel.example/",
"capabilities": ["changes", "products", "by_gtin",
"renditions", "exports", "webhooks"]
}Specifikācija
Versija 0.1. OpenAPI 3.1, JSON Schema 2020-12, piemēri un izdomāts testa zīmols Kestrel Outfitters. Licence CC-BY-4.0: brīvi implementējama, arī komerciāli.
Trīs API
| API | Kam | Statuss | Līgums |
|---|---|---|---|
| OBX Protocol | tirgotāju programmatūra: discovery, OAuth2 client credentials, izmaiņu plūsma, GTIN meklēšana, renditions, eksporti, webhooks | normatīvs | obx-protocol.yaml · HTML |
| OBX Ingest API | zīmola automatizācija: idempotenti upserts pēc zīmola paša ID, ar sha256 adresētas augšupielādes, partijas, importi | normatīvs | obx-ingest.yaml · HTML |
| Node Admin + Portal API | kopīgā pārvaldība un tirgotāju portāls | nenormatīvs | node-admin.yaml · HTML |
Zīmola portāla nolasīšana dažās rindās
HOST=https://brands.kestrel.example
curl -s $HOST/.well-known/obx # what does this brand offer?
TOKEN=$(curl -s -u "$CLIENT_ID:$CLIENT_SECRET" -d grant_type=client_credentials \
$HOST/obx/v1/oauth/token | jq -r .access_token)
curl -s -H "Authorization: Bearer $TOKEN" "$HOST/obx/v1/changes?limit=500" # everything, then only changes
curl -s -H "Authorization: Bearer $TOKEN" -X POST -H 'Content-Type: application/json' \
-d '{"gtins":["2000100101025"]}' "$HOST/obx/v1/products:by-gtin"
# or let the obx tool keep a copy in a folder, only fetching what changed:
OBX_CLIENT_ID=$CLIENT_ID OBX_CLIENT_SECRET=$CLIENT_SECRET obx pull $HOST --out ./kestrelSDK un komandrindas rīks
Atbilstība
Implementācija atbilst OBX profilam, ja obx-conformance iztur visus šī profila obligātos testus. Ir četri profili: protocol, ingest, portal un security. conformance.md
obx-conformance all --url http://localhost:8080 --setup-code … # a fresh portal: setup, fixtures, every profile
obx-conformance protocol --url https://brands.kestrel.example --client-id obxc_… --client-secret obxs_…
obx-conformance mock # a mock server that passes everythingImplementācijas
| Repozitorijs | Kas | Licence | Statuss |
|---|---|---|---|
| spec | specifikācija, shēmas, testa dati | CC-BY-4.0 | 0.1 |
| obx-go | Go SDK, rīks obx, atbilstības testi, imitācijas serveris | Apache-2.0 | 0.1 |
| admin-ui | kopīgā tīmekļa saskarne: pārvaldība un tirgotāju portāls | Apache-2.0 | 0.1 |
| node-go | Portāls Google Cloud un Docker Go: Docker un Google Cloud Run | AGPL-3.0 | 0.1 |
| node-php | Portāls tīmekļa mitināšanai PHP: parasta tīmekļa mitināšana | AGPL-3.0 | 0.1 |
| node-ts | Portāls Cloudflare TypeScript: Cloudflare Workers | AGPL-3.0 | 0.1 |
Veidojat savu implementāciju vai klientu? Paziņojiet ar issue vai pull request; tā nonāks šajā tabulā, tiklīdz izturēs atbilstības testus.
Dokumenti
protocol.mdprotokols tekstāingest.mdpublicēšana caur Ingest APIimport-format.mdCSV formāts un failu nosaukumiautomation.mdautomatizācijas receptessecurity.mddrošības prasībasversioning.mdversijas un saderībadirectory.mdzīmolu saraksti
Ieguldījums notiek ar pull requests spec repozitorijā. Kā tiek pieņemti lēmumi.