Loyetta

İptal Et

Bir aboneliği iptal edin. Durum cancelled olarak ayarlanır, ended_at mevcut zamana ayarlanır ve bir cancelled olayı kaydedilir.

POST/v1/superuser/subscriptions/cancel

İstek Gövdesi

AlanTürZorunluNotlar
external_idstringEvetMevcut bir aboneliği referans almalı

Örnek İstek

bash
curl -X POST "https://marka.prod.loyetta.com/api/v1/superuser/subscriptions/cancel" \
  -H "Authorization: Bearer loy_sk_live_xxxx" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "external_id": "sub_12345"
  }'

Yanıt (200 OK)

json
{
  "success": true
}

Hata Yanıtları

403 — Yasak (token super_user yetkisine sahip değil)

json
{
  "message": "Operation not allowed."
}

422 — Doğrulama Hatası (ör. bilinmeyen external_id)

json
{
  "message": "The given data was invalid.",
  "errors": {
    "external_id": ["The selected external id is invalid."]
  }
}