Zum Hauptinhalt springen
Getly

API

API-Dokumentation

Vollständige Referenz für die Getly Developer-API v1

Authentifizierung

Alle API-Anfragen müssen deinen API-Schlüssel im Authorization-Header mit dem Bearer-Token-Schema enthalten.

HTTP header
Authorization: Bearer gk_your_api_key_here

Verfügbare Scopes

API-Schlüssel sind auf einen bestimmten Shop beschränkt und haben granulare Berechtigungen. Erstelle Schlüssel unter /dashboard/developer/keys.

read:productswrite:productsread:ordersread:storewrite:storeread:analyticswebhooks:manageread:postswrite:postsread:couponswrite:couponsread:licenseswrite:licensescheckout:create

Rate-Limits

API-Anfragen sind auf 100 requests per minute pro API-Schlüssel begrenzt. Bei Überschreitung erhalten Sie eine 429-Antwort — bitte kurz warten und erneut versuchen.

Plane deine Integrationen so, dass du innerhalb dieser Limits bleibst. Wo möglich Batch-Operationen verwenden und Antworten auf deiner Seite cachen.

Fehlerbehandlung

Alle API-Antworten folgen einem konsistenten Format. Fehler enthalten eine beschreibende Nachricht.

application/json
// Success
{ "success": true, "data": { ... } }

// Error
{ "success": false, "error": "Description of what went wrong" }

HTTP-Statuscodes

200 Erfolg

201 Erstellt

400 Bad Request (ungültige Eingabe)

401 Unauthorized (fehlender/ungültiger API-Schlüssel)

403 Forbidden (fehlender Scope oder keine eigene Ressource)

404 Nicht gefunden

500 Interner Serverfehler

Endpunkte

Basis-URL: https://www.getly.store. Alle Preise sind in Cent (z. B. 1999 = 19,99 $).

GET/api/v1/productsread:products

Produkte deines Shops auflisten

bash
curl -X GET "https://www.getly.store/api/v1/products?page=1&limit=20" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "name": "Premium Icon Pack",
      "slug": "premium-icon-pack-abc123",
      "price": 1999,
      "status": "active",
      "category": { "id": "uuid", "name": "Design", "slug": "design" },
      "images": [{ "url": "...", "altText": "..." }]
    }
  ],
  "total": 42,
  "page": 1,
  "limit": 20,
  "hasMore": true
}
POST/api/v1/productswrite:products

Ein neues Produkt in deinem Shop erstellen

bash
curl -X POST "https://www.getly.store/api/v1/products" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My New Product",
    "description": "A great digital product",
    "price": 29.99,
    "categoryId": "uuid",
    "status": "active",
    "tags": ["design", "icons"],
    "images": [{ "url": "https://cdn.getly.store/...png", "altText": "cover" }],
    "files": [{ "fileUrl": "https://cdn.getly.store/files/.../abc.zip", "fileName": "pack.zip", "fileSize": 10485760, "fileType": "application/zip" }]
  }'
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "My New Product",
    "slug": "my-new-product-abc123",
    "price": 2999,
    "status": "active",
    "createdAt": "2025-01-15T10:30:00Z"
  }
}
GET/api/v1/products/:idread:products

Produktdetails anhand der ID abrufen

bash
curl -X GET "https://www.getly.store/api/v1/products/{id}" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "Premium Icon Pack",
    "price": 1999,
    "images": [...],
    "files": [...],
    "reviews": [...]
  }
}
PATCH/api/v1/products/:idwrite:products

Ein bestehendes Produkt aktualisieren

bash
curl -X PATCH "https://www.getly.store/api/v1/products/{id}" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Updated Name", "price": 39.99 }'
Antwort · application/json
{
  "success": true,
  "data": { "id": "uuid", "name": "Updated Name", "price": 3999 }
}
DELETE/api/v1/products/:idwrite:products

Produkt archivieren (Soft-Delete). Es wird nicht mehr öffentlich gelistet; bestehende Bestellungen und Downloads funktionieren weiter.

bash
curl -X DELETE "https://www.getly.store/api/v1/products/{id}" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": { "id": "uuid", "status": "archived" },
  "message": "Product archived"
}
POST/api/v1/products/:id/fileswrite:products

Eine herunterladbare Datei an ein Produkt anhängen. Für kleine Dateien Multipart verwenden, für Dateien bis 2 GB den Presign-Unterpfad + direkten R2-PUT. Du kannst auch ein files[]-Array an POST /api/v1/products übergeben, um die Datei direkt beim Erstellen anzuhängen.

bash
# Direct upload (multipart) — best for files under ~4MB:
curl -X POST "https://www.getly.store/api/v1/products/{id}/files" \
  -H "Authorization: Bearer gk_your_api_key" \
  -F "file=@/path/to/your-file.zip"

# Large files (up to 2GB) — 3 steps:
# 1) get a presigned upload URL
curl -X POST "https://www.getly.store/api/v1/products/{id}/files/presign" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "fileName": "pack.zip", "fileSize": 524288000, "fileType": "application/zip" }'
# 2) PUT the bytes straight to R2 (use the returned uploadUrl)
curl -X PUT "<uploadUrl>" --data-binary "@/path/to/pack.zip" \
  -H "Content-Length: 524288000"
# 3) attach the uploaded object (use the returned fileUrl)
curl -X POST "https://www.getly.store/api/v1/products/{id}/files" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "fileUrl": "<fileUrl>", "fileName": "pack.zip", "fileSize": 524288000, "fileType": "application/zip" }'
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "fileName": "pack.zip",
    "fileUrl": "https://cdn.getly.store/files/.../abc.zip",
    "fileSize": 524288000,
    "fileType": "application/zip",
    "version": "1.0",
    "isLatest": true,
    "createdAt": "2026-06-02T10:30:00Z"
  }
}
GET/api/v1/ordersread:orders

Bestellungen mit Artikeln aus deinem Shop auflisten

bash
curl -X GET "https://www.getly.store/api/v1/orders?page=1&limit=20" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "orderId": "uuid",
      "price": 2999,
      "order": { "status": "completed", "buyer": { "name": "John" } },
      "product": { "name": "Premium Pack" }
    }
  ],
  "total": 156,
  "page": 1
}
GET/api/v1/orders/:idread:orders

Bestelldetails abrufen (nur Artikel aus deinem Shop)

bash
curl -X GET "https://www.getly.store/api/v1/orders/{id}" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "status": "completed",
    "total": 5999,
    "buyer": { "name": "John", "email": "john@example.com" },
    "items": [...]
  }
}
GET/api/v1/storeread:store

Deine Shop-Informationen abrufen

bash
curl -X GET "https://www.getly.store/api/v1/store" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "My Store",
    "slug": "my-store",
    "description": "...",
    "totalSales": 250,
    "totalRevenue": 450000,
    "badges": [...]
  }
}
PATCH/api/v1/storewrite:store

Shop-Name, Beschreibung, Website, socialLinks aktualisieren

bash
curl -X PATCH "https://www.getly.store/api/v1/store" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{ "description": "Updated store description" }'
Antwort · application/json
{
  "success": true,
  "data": { "id": "uuid", "name": "My Store", "description": "Updated store description" }
}
GET/api/v1/analyticsread:analytics

Verkaufsanalysen für deinen Shop abrufen

bash
curl -X GET "https://www.getly.store/api/v1/analytics" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": {
    "totalSales": 250,
    "totalRevenue": 450000,
    "monthlySales": 42,
    "monthlyRevenue": 75000,
    "averageOrderValue": 1800,
    "productCount": 15,
    "totalDownloads": 1200,
    "salesByMonth": [
      { "month": "2025-01", "sales": 38, "revenue": 68000 }
    ]
  }
}
GET/api/v1/webhookswebhooks:manage

Webhook-Endpunkte für deinen Shop auflisten

bash
curl -X GET "https://www.getly.store/api/v1/webhooks" \
  -H "Authorization: Bearer gk_your_api_key"
Antwort · application/json
{
  "success": true,
  "data": [
    {
      "id": "uuid",
      "url": "https://example.com/webhooks",
      "events": ["sale.completed"],
      "isActive": true
    }
  ]
}
POST/api/v1/webhookswebhooks:manage

Einen neuen Webhook-Endpunkt registrieren

bash
curl -X POST "https://www.getly.store/api/v1/webhooks" \
  -H "Authorization: Bearer gk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://example.com/webhooks",
    "events": ["sale.completed", "product.updated"]
  }'
Antwort · application/json
{
  "success": true,
  "data": {
    "id": "uuid",
    "url": "https://example.com/webhooks",
    "events": ["sale.completed", "product.updated"],
    "secret": "abcdef1234567890..."
  }
}

Webhooks

Webhooks ermöglichen es deiner Anwendung, Echtzeit-Benachrichtigungen zu erhalten, wenn Ereignisse in deinem Shop passieren. Registriere Endpunkte unter /dashboard/developer/webhooks oder über die API.

Ereignistypen

sale.completed Ein Verkauf für eines deiner Produkte wurde abgeschlossen

product.created In deinem Shop wurde ein Produkt erstellt

product.updated Ein Produkt in deinem Shop wurde aktualisiert

review.created Eines deiner Produkte hat eine neue Bewertung erhalten

download.completed Ein Käufer hat eines deiner Produkte heruntergeladen

* Alle Ereignisse abonnieren

Payload-Format

Jede Webhook-Zustellung sendet eine JSON-POST-Anfrage mit folgender Struktur:

POST · application/json
POST https://your-endpoint.com/webhooks
Content-Type: application/json
X-Getly-Signature: sha256=<hmac_hex>
X-Getly-Event: sale.completed

{
  "event": "sale.completed",
  "deliveryId": "uuid",
  "data": {
    "orderId": "uuid",
    "productId": "uuid",
    "buyerEmail": "john@example.com",
    "amount": 2999
  },
  "timestamp": "2025-01-15T10:30:00.000Z"
}

Signaturverifizierung

Jede Webhook-Zustellung enthält einen X-Getly-Signature-Header. Verifiziere die Signatur mit HMAC-SHA256 und deinem Webhook-Secret, um sicherzustellen, dass die Anfrage von Getly stammt.

node.js
const crypto = require('crypto');

function verifyWebhook(body, signature, secret) {
  const expected = 'sha256=' +
    crypto
      .createHmac('sha256', secret)
      .update(body)
      .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// In your webhook handler
app.post('/webhooks', (req, res) => {
  const signature = req.headers['x-getly-signature'];
  const isValid = verifyWebhook(
    JSON.stringify(req.body),
    signature,
    process.env.GETLY_WEBHOOK_SECRET
  );

  if (!isValid) {
    return res.status(401).send('Invalid signature');
  }

  const { event, data } = req.body;
  // Handle the event...

  res.status(200).send('OK');
});

Retry-Richtlinie

Fehlgeschlagene Zustellungen (Nicht-2xx-Antwort oder Timeout) werden automatisch mit exponentiellem Backoff erneut versucht:

Versuch 1: Erneut nach 1 Minute

Versuch 2: Erneut nach 5 Minuten

Versuch 3: Erneut nach 30 Minuten

Versuch 4: Erneut nach 2 Stunden

Versuch 5: Aufgeben (Zustellung als fehlgeschlagen markiert)

Dein Endpunkt sollte innerhalb von 10 Sekunden antworten. Sende einen 2xx-Statuscode zur Empfangsbestätigung.