Öffentlich
Nur lesende Endpunkte für den Browser (Snippet), mit Publishable Key.
Die API ist gebaut und getestet. Das Hosting unter api.garanify.com ist in Vorbereitung; bis dahin läuft sie lokal. Schlüssel gibt es auf Anfrage.
Feldbeschreibungen auf Englisch, direkt aus der OpenAPI-Datei.
Anzeige-Einstellungen eines Shops
GET /v1/public/{shop}
Schlüssel: Publishable Key
Einstellungen der Mitteilung für Seiten ohne Produkt, etwa den Warenkorb. CORS nur für die Domains des Shops.
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
shopPflicht | path | string | Shop ID (shp_…).pattern ^shp_[A-Za-z0-9]{12}$ |
lang | query | string | Language of texts and notice. Locales such as de-AT are mapped to one of the 24 EU languages; unknown languages fall back to the default language of the shop, then English.≤ 16 chars |
Anfrage
curl "https://api.garanify.com/v1/public/shp_4kq8Zt2mWc9x?lang=de&key=gfy_pk_4kq8Zt2mWc9x_…"import { Garanify } from '@garanify/sdk';
const garanify = new Garanify({ apiKey: 'gfy_pk_4kq8Zt2mWc9x_…' });
const settings = await garanify.public.shop({
lang: 'de'
});<?php
// composer require garanify/sdk guzzlehttp/guzzle
$factory = new GuzzleHttp\Psr7\HttpFactory();
$garanify = new Garanify\Garanify('gfy_pk_4kq8Zt2mWc9x_…', ['httpClient' => new GuzzleHttp\Client(), 'requestFactory' => $factory, 'streamFactory' => $factory]);
$settings = $garanify->public->shop('de');import os, requests
res = requests.get(
"https://api.garanify.com/v1/public/shp_4kq8Zt2mWc9x?lang=de&key=gfy_pk_4kq8Zt2mWc9x_…",
timeout=10,
)
res.raise_for_status()
data = res.json()Ausprobieren GET /v1/public/{shop}
Antwort 200 application/json
{
"shop": "shp_4kq8Zt2mWc9x",
"lang": "de",
"notice": {
"enabled": true,
"placements": [
"product",
"cart",
"checkout"
],
"maxWidth": 480,
"link": false,
"title": "Gesetzliche Gewährleistung",
"image": "https://api.garanify.com/v1/render/notice?lang=de&format=png"
},
"display": {
"product": "full",
"cart": "nested"
}
} Antworten
200Display settings. ·PublicShop304Not modified (ETag matches).401Key missing, invalid, expired or revoked. ·Problem403Plan, key type or origin does not allow the request. ·Problem429Too many requests. Wait `Retry-After` seconds. ·Problem
Etikett eines Produkts für den Browser
GET /v1/public/{shop}/products/{sku}
Schlüssel: Publishable Key
Was das Snippet lädt: das aufgelöste GARAN-Etikett und die Einstellungen der Mitteilung. Den Publishable Key als ?key= übergeben, dann sendet der Browser eine einfache Anfrage ohne Preflight. Antworten sind cachebar (ETag, Cache-Control mit stale-while-revalidate).
Parameter
| Name | Ort | Typ | Beschreibung |
|---|---|---|---|
shopPflicht | path | string | Shop ID (shp_…).pattern ^shp_[A-Za-z0-9]{12}$ |
skuPflicht | path | Sku | Your product ID, usually the SKU. URL-encode special characters.1–120 chars, pattern ^[^\x00-\x1f]+$ |
lang | query | string | Language of texts and notice. Locales such as de-AT are mapped to one of the 24 EU languages; unknown languages fall back to the default language of the shop, then English.≤ 16 chars |
Anfrage
curl "https://api.garanify.com/v1/public/shp_4kq8Zt2mWc9x/products/WCR870?lang=de&key=gfy_pk_4kq8Zt2mWc9x_…"import { Garanify } from '@garanify/sdk';
const garanify = new Garanify({ apiKey: 'gfy_pk_4kq8Zt2mWc9x_…' });
const product = await garanify.public.product('WCR870', {
lang: 'de'
});<?php
// composer require garanify/sdk guzzlehttp/guzzle
$factory = new GuzzleHttp\Psr7\HttpFactory();
$garanify = new Garanify\Garanify('gfy_pk_4kq8Zt2mWc9x_…', ['httpClient' => new GuzzleHttp\Client(), 'requestFactory' => $factory, 'streamFactory' => $factory]);
$product = $garanify->public->product('WCR870', 'de');import os, requests
res = requests.get(
"https://api.garanify.com/v1/public/shp_4kq8Zt2mWc9x/products/WCR870?lang=de&key=gfy_pk_4kq8Zt2mWc9x_…",
timeout=10,
)
res.raise_for_status()
data = res.json()Ausprobieren GET /v1/public/{shop}/products/{sku}
Antwort 200 application/json
{
"shop": "shp_4kq8Zt2mWc9x",
"sku": "WCR870",
"lang": "de",
"label": {
"years": 10,
"brand": "Miele",
"model": "WCR 870 WPS",
"text": "GARAN – Herstellergarantie in Jahren: 10 (Miele WCR 870 WPS)"
},
"notice": {
"enabled": true,
"placements": [
"product",
"cart",
"checkout"
],
"maxWidth": 480,
"link": false,
"title": "Gesetzliche Gewährleistung",
"image": "https://api.garanify.com/v1/render/notice?lang=de&format=png"
},
"display": {
"product": "full",
"cart": "nested"
}
} Antworten
200Label and display settings. ·PublicProduct304Not modified (ETag matches).401Key missing, invalid, expired or revoked. ·Problem403Plan, key type or origin does not allow the request. ·Problem404Not found. ·Problem429Too many requests. Wait `Retry-After` seconds. ·Problem