Skip to content
Garanify

Resolve

Which label applies to a product, and why.

The API is built and tested. Hosting at api.garanify.com is in preparation; until then it runs locally. Keys are available on request.

Resolve a stored product

GET /v1/shops/{shop}/products/{sku}/resolve

Key: Secret key

Which label the product shows and why. Order is product value, then main product (for variants), then the first matching rule.

Parameters

NameInTypeDescription
shoprequired path string Shop ID (shp_…).pattern ^shp_[A-Za-z0-9]{12}$
skurequired 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

Request

curl "https://api.garanify.com/v1/shops/shp_4kq8Zt2mWc9x/products/WCR870/resolve?lang=de" \
  -H "Authorization: Bearer $GARANIFY_SECRET_KEY"
import { Garanify } from '@garanify/sdk';

const garanify = new Garanify({ apiKey: process.env.GARANIFY_SECRET_KEY });
const resolution = await garanify.products.resolve('WCR870', {
  lang: 'de'
});
<?php
// composer require garanify/sdk guzzlehttp/guzzle
$factory = new GuzzleHttp\Psr7\HttpFactory();
$garanify = new Garanify\Garanify(getenv('GARANIFY_SECRET_KEY'), ['httpClient' => new GuzzleHttp\Client(), 'requestFactory' => $factory, 'streamFactory' => $factory]);
$resolution = $garanify->products->resolve('WCR870', 'de');
import os, requests

res = requests.get(
    "https://api.garanify.com/v1/shops/shp_4kq8Zt2mWc9x/products/WCR870/resolve?lang=de",
    headers={"Authorization": f"Bearer {os.environ['GARANIFY_SECRET_KEY']}"},
    timeout=10,
)
res.raise_for_status()
data = res.json()

Response 200 application/json

{
  "sku": "WAN28200",
  "lang": "de",
  "label": {
    "years": 5,
    "brand": "Bosch",
    "model": "WAN28200",
    "source": "rule",
    "rule": 1,
    "text": "GARAN – Herstellergarantie in Jahren: 5 (Bosch WAN28200)"
  },
  "reason": {
    "code": "rule",
    "rule": 1,
    "detail": "Rule 1 applies (5 years)."
  },
  "errors": []
}

Responses

  • 200 Resolution. · Resolution
  • 401 Key missing, invalid, expired or revoked. · Problem
  • 404 Not found. · Problem
  • 429 Too many requests. Wait `Retry-After` seconds. · Problem

Resolve without saving

POST /v1/shops/{shop}/resolve

Key: Secret key

Resolves a product against the rules of the shop without storing it. Useful for previews in your admin.

Parameters

NameInTypeDescription
shoprequired 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

Body

NameTypeDescription
parentSku Sku | null SKU of the main product, for variants.
name string | null ≤ 300 chars
brand string | null Brand or manufacturer.≤ 120 chars
mpn string | null Manufacturer part number. Preferred model identifier. Not a GTIN/EAN.≤ 120 chars
categories string[] Category names. A path like Household > Coffee machines also matches its parent categories.0–50 items
tags string[] 0–50 items
garan GaranInput Producer guarantee of the product. Empty values come from the main product or the rules.
garan.years number | null Years, more than 2, whole or half years. 0 or null = not set (main product or rules apply).≥ 0, ≤ 99
garan.brand string | null Brand on the label. Default is brand of the product.≤ 120 chars
garan.model string | null Model identifier on the label. Default is MPN, then SKU.≤ 120 chars
hidden boolean true = never show a GARAN label for this product.
skurequired Sku 1–120 chars, pattern ^[^\x00-\x1f]+$

Request

curl -X POST "https://api.garanify.com/v1/shops/shp_4kq8Zt2mWc9x/resolve" \
  -H "Authorization: Bearer $GARANIFY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sku":"PREVIEW-1","brand":"Bosch","mpn":"WAN28200","garan":{"years":2}}'
import { Garanify } from '@garanify/sdk';

const garanify = new Garanify({ apiKey: process.env.GARANIFY_SECRET_KEY });
const resolution = await garanify.products.preview({
  sku: 'PREVIEW-1',
  brand: 'Bosch',
  mpn: 'WAN28200',
  garan: {
    years: 2
  }
});
<?php
// composer require garanify/sdk guzzlehttp/guzzle
$factory = new GuzzleHttp\Psr7\HttpFactory();
$garanify = new Garanify\Garanify(getenv('GARANIFY_SECRET_KEY'), ['httpClient' => new GuzzleHttp\Client(), 'requestFactory' => $factory, 'streamFactory' => $factory]);
$resolution = $garanify->products->preview([
    'sku' => 'PREVIEW-1',
    'brand' => 'Bosch',
    'mpn' => 'WAN28200',
    'garan' => [
        'years' => 2,
    ],
]);
import os, requests

res = requests.post(
    "https://api.garanify.com/v1/shops/shp_4kq8Zt2mWc9x/resolve",
    headers={"Authorization": f"Bearer {os.environ['GARANIFY_SECRET_KEY']}"},
    json={
        "sku": "PREVIEW-1",
        "brand": "Bosch",
        "mpn": "WAN28200",
        "garan": {
            "years": 2,
        },
    },
    timeout=10,
)
res.raise_for_status()
data = res.json()

Response 200 application/json

{
  "sku": "PREVIEW-1",
  "lang": "en",
  "label": null,
  "reason": {
    "code": "invalid",
    "rule": null,
    "detail": "The guarantee data is invalid."
  },
  "errors": [
    {
      "code": "years_too_low",
      "message": "GARAN only for producer guarantees of more than 2 years."
    }
  ]
}

Responses

  • 200 Resolution. · Resolution
  • 401 Key missing, invalid, expired or revoked. · Problem
  • 422 The request does not match the schema. · Problem
  • 429 Too many requests. Wait `Retry-After` seconds. · Problem

Next: Render