Za programere

Otvoreni kod, na GitHubu.

Open Brand Exchange je specifikacija s tri API-ja, JSON shemama, testnim podacima i testovima sukladnosti. Specifikacija je izvor istine; implementacije je slijede.

Terminal
$ curl https://brands.maison-noor.example/.well-known/obx
200 OK · application/json
{
  "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"]
}

Specifikacija

Verzija 0.3. OpenAPI 3.1, JSON Schema 2020-12, primjeri i izmišljena testna marka MAISON NOOR. Licenca CC-BY-4.0: slobodno za implementaciju, i komercijalno.

openbrandexchange/spec · Počnite s protocol.md ·Brzi početak: OBX za 10 minuta

Novo u verziji 0.3

  • Materijali i održavanje su kodovi s nazivima na engleskom, nizozemskom, njemačkom i francuskom, iz zajedničkih rječnika objavljenih na /vocabularies/v0.3/.
  • Više tvrdnji o održivosti po vlaknu: reciklirano, organsko, u prijelaznom razdoblju, prije potrošnje, nakon potrošnje i regenerativno. U datoteci, na primjer: 100% polyester (recycled) (post_consumer).
  • Stabilni ID-jevi varijanti: standardno broj modela, boja i veličina, nikad EAN. Tako EAN može stići ili se promijeniti kasnije, a da ne nastane nova varijanta.
  • Proširenja: vaša vlastita polja x-<vendor>-<name> spremaju se i vraćaju, a nepoznato polje nikad ne uzrokuje neuspjeh upisa.
  • Novi kodovi: pogreška idempotency_key_reused te upozorenja material_unknown i qualifier_deprecated. Svaki kod ima svoju stranicu pod /errors/.
  • Od verzije 0.3 postojeći oblici pod /obx/v1 mijenjaju se samo dodavanjem. U planu za 0.4: dom i sport, pretraga i filtri te bolji webhookovi.

Potpuni popis promjena · /vocabularies/v0.3/ ·/errors/

Repozitoriji

Tri API-ja

APIZaStatusUgovor
OBX Protocolsoftver trgovaca: discovery, OAuth2 client credentials, tok promjena, pretraga po GTIN-u, renditions, izvozi, webhookovinormativnoobx-protocol.yaml · HTML
OBX Ingest APIautomatizacija marke: idempotentni upserti po vlastitim ID-jevima marke, prijenosi adresirani sha256, paketi, uvozinormativnoobx-ingest.yaml · HTML
Node Admin + Portal APIzajednička administracija i portal za trgovcenenormativnonode-admin.yaml · HTML

Isprobajte na demo portalu

Demo portal ima javni testni ključ koji može samo čitati. Katalog je izmišljen i vraća se na početno stanje svakih sat vremena, pa brzi početak odmah radi.

Javni testni ključ (samo čitanje)
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"

Otvori demo portal

Čitanje portala marke u nekoliko redaka

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-noor

SDK i alat naredbenog retka

obx-go sadrži Go SDK (tipove, klijent protokola i ingest klijent s uklanjanjem duplikata, višedijelnim prijenosima i paketima), alat obx za marke, obx-conformance i lažni poslužitelj. U drugim jezicima dovoljan je bilo koji HTTP klijent: ugovor je u OpenAPI datotekama.

obx-go · obx

Sukladnost

Implementacija je sukladna s OBX-om za profil kad obx-conformance prođe sve obvezne testove tog profila. Postoje četiri profila: protocol, ingest, portal i 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 everything

Želite brz prvi pregled? Online provjera kompatibilnosti testira portal izvana, samo čitanjem. Online provjera kompatibilnosti

Izgradite ga sa svojim AI asistentom

Kopirajte upit u Claude, ChatGPT ili Cursor, dovršite dio u zagradama i neka asistent napiše kod prema specifikaciji.

Izvoz iz vašeg sustava · Za marke te dobavljače ERP-a i PIM-a: products.csv i nazivi fotografija.
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.
Čitanje OBX-a u vašem softveru · Za dobavljače softvera za web-trgovinu, PIM i blagajnu: tok promjena i fotografije.
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.

Implementacije

RepozitorijŠtoLicencaStatus
specspecifikacija, sheme, testni podaciCC-BY-4.00.3
obx-goGo SDK, alat obx, testovi sukladnosti, lažni poslužiteljApache-2.00.3
admin-uizajedničko web sučelje: administracija i portal za trgovceApache-2.00.3
node-goPortal za vlastiti poslužitelj
Go: vlastiti poslužitelj, s instalacijom u jednom retku
AGPL-3.00.3
node-phpPortal za web hosting
PHP: običan web hosting
AGPL-3.00.3
node-tsPortal za Cloudflare
TypeScript: Cloudflare Workers
AGPL-3.00.3

Gradite vlastitu implementaciju ili klijent? Javite nam putem issuea ili pull requesta; ući će u tablicu čim prođe testove sukladnosti.

Dokumenti

Uključite se

Standard nastaje javno i svatko može sudjelovati. Ne morate pisati kod: ako radite za marku ili trgovca, recite nam na što nailazite, što nedostaje i što funkcionira.

  • Rasprave

    Postavite pitanje, podijelite ideju ili komentirajte prijedlog za sljedeću verziju. Najbolje mjesto za početak.

    Otvorite rasprave

  • Issues i pull requestovi

    Za konkretnu promjenu: pogrešku u specifikaciji, polje koje nedostaje, bolji primjer. Otvorite issue ili sami predložite promjenu u pull requestu.

    Otvorite issue

  • E-pošta

    Za pitanje koje radije ne biste postavili javno.

    hello@openbrandexchange.com

  • Budite u tijeku

    Pratite repozitorij spec na GitHubu (Watch → Custom → Releases) i saznat ćete za svaku novu verziju.

    Pratite repozitorij