☰ Meniu · Endpointuri webhook
Referință API

Endpointuri webhook

Unde trimitem evenimentele acestui local.

POST/v1/webhook_endpoints
Permisiune: webhooks:write

Adaugă un endpoint. url trebuie să fie HTTPS public. events este o listă de tipuri de evenimente; omite-o ca să le primești pe toate. secret-ul pentru semnături apare doar în acest răspuns.

curl
curl https://loyaltyfy.io/api/v1/webhook_endpoints \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://pos.example.com/loyaltyfy/webhooks",
    "events": ["transaction.completed", "order.created"]
  }'
Răspuns · 201
{
  "object": "webhook_endpoint",
  "id": "01c2a784-4bcf-43b9-8ac9-ddbad7a25341",
  "url": "https://pos.example.com/loyaltyfy/webhooks",
  "description": null,
  "events": ["transaction.completed", "order.created"],
  "status": "enabled",
  "disabled_reason": null,
  "livemode": false,
  "created_at": "2026-10-06T18:17:32.381+00:00",
  "secret": "whsec_UvjHvXfPk80ITYl_xPeAtskI0WjR8-PS"
}
GET/v1/webhook_endpoints
Permisiune: webhooks:write

Toate endpointurile localului.

GET/v1/webhook_endpoints/{id}
Permisiune: webhooks:write

Un endpoint, cu statusul lui și motivul, dacă a fost dezactivat.

PATCH/v1/webhook_endpoints/{id}
Permisiune: webhooks:write

Schimbă url, events, description sau enabled. Folosește enabled: true ca să reactivezi un endpoint dezactivat din cauza erorilor.

DELETE/v1/webhook_endpoints/{id}
Permisiune: webhooks:write

Șterge endpointul. Livrările în curs se opresc.

POST/v1/webhook_endpoints/{id}/test
Permisiune: webhooks:write

Trimite imediat un eveniment semnat test.ping și îți spune ce a răspuns endpointul tău.

curl
curl -X POST https://loyaltyfy.io/api/v1/webhook_endpoints/01c2a784-4bcf-43b9-8ac9-ddbad7a25341/test \
  -H "Authorization: Bearer sk_test_..."

# { "object": "webhook_test", "delivered": true, "status_code": 200, "error": null }
Întrebări despre integrare: api@loyaltyfy.io. Răspundem în cel mult o zi lucrătoare.