Izstrādātājiem
Atvērtais kods, GitHub.
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.maison-noor.example/.well-known/obx{
"obx_version": "0.3",
"spec_version": "0.3.1",
"publisher": { "name": "MAISON NOOR Group" },
"api_base": "https://brands.maison-noor.example/obx/v1",
"portal_url": "https://brands.maison-noor.example/",
"capabilities": ["changes", "products", "by_gtin",
"renditions", "exports", "webhooks"]
}Specifikācija
Versija 0.3. OpenAPI 3.1, JSON Schema 2020-12, piemēri un izdomāts testa zīmols MAISON NOOR. Licence CC-BY-4.0: brīvi implementējama, arī komerciāli.
openbrandexchange/spec · Sāciet ar protocol.md ·Ātrais sākums: OBX 10 minūtēs
Jaunumi versijā 0.3
- Materiāli un kopšana ir kodi ar nosaukumiem angļu, nīderlandiešu, vācu un franču valodā. Tie nāk no kopīgām vārdnīcām, kas publicētas /vocabularies/v0.3/.
- Vairāki ilgtspējas apgalvojumi katrai šķiedrai: pārstrādāta, bioloģiska, pārejas periodā, pirms patēriņa, pēc patēriņa un reģeneratīva. Failā, piemēram: 100% polyester (recycled) (post_consumer).
- Stabili variantu ID: pēc noklusējuma modeļa numurs, krāsa un izmērs, nekad EAN. Tā EAN var parādīties vai mainīties vēlāk, neradot jaunu variantu.
- Paplašinājumi: jūsu pašu lauki x-<vendor>-<name> tiek saglabāti un atgriezti, un nezināms lauks nekad neizraisa ieraksta kļūmi.
- Jauni kodi: kļūda idempotency_key_reused un brīdinājumi material_unknown un qualifier_deprecated. Katram kodam ir sava lapa sadaļā /errors/.
- No 0.3 esošās struktūras sadaļā /obx/v1 mainās tikai ar papildinājumiem. Versijai 0.4 plānots: mājas un sports, meklēšana un filtri, kā arī labāki webhooks.
Repozitoriji
Viss ir atvērtā koda GitHub: specifikācija, kopīgais kods un trīs portāla izdevumi.
- openbrandexchange/specSpecifikācija, shēmas un testa dati
- openbrandexchange/obx-goGo SDK, rīks obx un atbilstības tests
- openbrandexchange/node-tsPortāls Cloudflare Workers
- openbrandexchange/node-goPortāls savam serverim
- openbrandexchange/node-phpPortāls parastai tīmekļa mitināšanai
- openbrandexchange/admin-uiKatra portāla tīmekļa saskarne
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 |
Izmēģiniet demo portālā
Demo portālam ir publiska testa atslēga, kas var tikai lasīt. Katalogs ir izdomāts un tiek atiestatīts katru stundu, tāpēc ātrā sākšana darbojas uzreiz.
- Publiska testa atslēga (tikai lasīšanai)
obxc_demo-portal-read-only·obxs_demo-portal-read-only-public
HOST=https://obx-portal-demo.richardlindhout96.workers.dev
CLIENT_ID=obxc_demo-portal-read-only
CLIENT_SECRET=obxs_demo-portal-read-only-public
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" | jq '{phase, has_more, n: (.changes | length)}'
curl -s -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
-d '{"gtins": ["2000100801017", "2000100101025"]}' "$HOST/obx/v1/products:by-gtin"Zīmola portāla nolasīšana dažās rindās
HOST=https://brands.maison-noor.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 ./maison-noorSDK 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.maison-noor.example --client-id obxc_… --client-secret obxs_…
obx-conformance mock # a mock server that passes everythingVēlaties ātri paskatīties? Saderības pārbaude tiešsaistē testē portālu no ārpuses, tikai lasot. Saderības pārbaude tiešsaistē
Izveidojiet to ar savu MI asistentu
Iekopējiet uzvedni Claude, ChatGPT vai Cursor, aizpildiet daļu iekavās un ļaujiet asistentam uzrakstīt kodu atbilstoši specifikācijai.
You are helping me connect our system to Open Brand Exchange (OBX), the open standard for how brands share product photos and article data with retailers.
Read these first:
- Import format: https://github.com/openbrandexchange/spec/blob/main/docs/import-format.md
- Example data (fictional brand MAISON NOOR): https://github.com/openbrandexchange/spec/blob/main/fixtures/maison-noor/products.csv
- JSON Schemas: https://openbrandexchange.com/schemas/v0.3/
- Codes with their names (materials, qualifiers, care): https://openbrandexchange.com/vocabularies/v0.3/
Our system: [name, version, database or API, programming language].
Task:
1. Write an export that produces products.csv exactly in the OBX import format: the same columns in the same order as the MAISON NOOR example, one row per size, UTF-8.
2. Map our fields to the OBX columns. Include the fibre composition per part, the care codes and the EANs. List every OBX field we cannot fill, and every field of ours that has no place in OBX.
3. Rename or copy our product photos to the OBX naming rule {style}_{color}_{position}.jpg, for example MN-1001_NVY_1.jpg.
4. Add a test that runs the export on sample data and compares the result with the MAISON NOOR example's columns.
5. Explain how to check the result with: obx push --dry-run
Ask me for anything you need to know about our system before you write code.You are helping me read Open Brand Exchange (OBX) in our software. OBX is the open standard for how brands share product photos and article data with retailers; every brand runs its own portal with the same API.
Read these first:
- OBX in 10 minutes: https://github.com/openbrandexchange/spec/blob/main/docs/quickstart.md
- Protocol: https://github.com/openbrandexchange/spec/blob/main/docs/protocol.md
- OpenAPI contract: https://github.com/openbrandexchange/spec/blob/main/openapi/obx-protocol.yaml
Our software: [name, programming language, where products and images are stored].
Task:
1. Discover a brand portal through /.well-known/obx and get a token with OAuth2 client credentials.
2. Read the change feed: a full snapshot first, then only the changes, including deletions. Store the cursor so a restart continues where it stopped.
3. Map OBX products, variants (by EAN) and assets to our data model, including fibre composition, care and measurements.
4. Download the image renditions we need, and keep the usage rights and embargo dates with each image.
5. Handle errors and rate limits as the protocol describes, and add tests against the mock portal: obx-conformance mock.
Ask me for anything you need to know about our software before you write code.Implementācijas
| Repozitorijs | Kas | Licence | Statuss |
|---|---|---|---|
| spec | specifikācija, shēmas, testa dati | CC-BY-4.0 | 0.3 |
| obx-go | Go SDK, rīks obx, atbilstības testi, imitācijas serveris | Apache-2.0 | 0.3 |
| admin-ui | kopīgā tīmekļa saskarne: pārvaldība un tirgotāju portāls | Apache-2.0 | 0.3 |
| node-go | Portāls savam serverim Go: savs serveris ar vienas rindas instalētāju | AGPL-3.0 | 0.3 |
| node-php | Portāls tīmekļa mitināšanai PHP: parasta tīmekļa mitināšana | AGPL-3.0 | 0.3 |
| node-ts | Portāls Cloudflare TypeScript: Cloudflare Workers | AGPL-3.0 | 0.3 |
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.
Iesaistieties
Standarts top publiski, un piedalīties var ikviens. Jums nav jāraksta kods: ja strādājat zīmolā vai pie tirgotāja, pastāstiet mums, ar ko saskaraties, kas trūkst un kas darbojas.
Diskusijas
Uzdodiet jautājumu, dalieties idejā vai komentējiet priekšlikumu nākamajai versijai. Labākā vieta, kur sākt.
Issues un pull requests
Konkrētām izmaiņām: kļūdai specifikācijā, trūkstošam laukam, labākam piemēram. Atveriet issue vai ierosiniet izmaiņas paši ar pull request.
E-pasts
Jautājumam, ko negribat uzdot publiski.
Esiet lietas kursā
Sekojiet spec repozitorijam GitHub (Watch → Custom → Releases), un uzzināsiet par katru jaunu versiju.