{
    "openapi": "3.0.3",
    "info": {
        "title": "LIONFIN Müşteri API",
        "version": "1.0.0",
        "description": "Müşteri paneli → API Anahtarları'ndan üretilen Bearer anahtarla kullanılır. Her anahtar için kapsam (scope) ve izinli IP tanımlanabilir; her istek loglanır."
    },
    "servers": [
        {
            "url": "https://lionfin.com.tr/api/v1"
        }
    ],
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Authorization: Bearer lf_…"
            }
        }
    },
    "tags": [
        {
            "name": "Hesap bilgisi",
            "description": "Kapsam: me"
        },
        {
            "name": "Hizmetler",
            "description": "Kapsam: services"
        },
        {
            "name": "Alan adları",
            "description": "Kapsam: domains"
        },
        {
            "name": "Faturalar",
            "description": "Kapsam: invoices"
        },
        {
            "name": "Siparişler",
            "description": "Kapsam: orders"
        }
    ],
    "paths": {
        "/me": {
            "get": {
                "summary": "Hesap bilgisi",
                "description": "Anahtarın sahibi olan müşteri hesabı.",
                "tags": [
                    "Hesap bilgisi"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "x-scope": "me",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "phone": {
                                            "type": "string",
                                            "nullable": true
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "credit_balance": {
                                            "type": "number",
                                            "format": "float"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz ya da süresi dolmuş API anahtarı"
                    },
                    "403": {
                        "description": "IP kısıtı ya da kapsam (scope) yetkisi yok"
                    },
                    "429": {
                        "description": "Dakikada 60 istek sınırı aşıldı"
                    }
                }
            }
        },
        "/services": {
            "get": {
                "summary": "Hizmetler",
                "description": "Hosting / sunucu hizmetleri, dönem ve sonraki ödeme tarihiyle.",
                "tags": [
                    "Hizmetler"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "x-scope": "services",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "product": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "domain": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "billing_period": {
                                                        "type": "string",
                                                        "nullable": true
                                                    },
                                                    "recurring_amount": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "next_due_date": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "nullable": true
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz ya da süresi dolmuş API anahtarı"
                    },
                    "403": {
                        "description": "IP kısıtı ya da kapsam (scope) yetkisi yok"
                    },
                    "429": {
                        "description": "Dakikada 60 istek sınırı aşıldı"
                    }
                }
            }
        },
        "/domains": {
            "get": {
                "summary": "Alan adları",
                "description": "Kayıtlı alan adları, durum ve bitiş tarihi.",
                "tags": [
                    "Alan adları"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "x-scope": "domains",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "registered_at": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "nullable": true
                                                    },
                                                    "expires_at": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "nullable": true
                                                    },
                                                    "auto_renew": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz ya da süresi dolmuş API anahtarı"
                    },
                    "403": {
                        "description": "IP kısıtı ya da kapsam (scope) yetkisi yok"
                    },
                    "429": {
                        "description": "Dakikada 60 istek sınırı aşıldı"
                    }
                }
            }
        },
        "/invoices": {
            "get": {
                "summary": "Faturalar",
                "description": "Tüm faturalar (ödenmiş / ödenmemiş / kısmen ödenmiş).",
                "tags": [
                    "Faturalar"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "x-scope": "invoices",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "total": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "tax_total": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "due_at": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "nullable": true
                                                    },
                                                    "paid_at": {
                                                        "type": "string",
                                                        "format": "date",
                                                        "nullable": true
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz ya da süresi dolmuş API anahtarı"
                    },
                    "403": {
                        "description": "IP kısıtı ya da kapsam (scope) yetkisi yok"
                    },
                    "429": {
                        "description": "Dakikada 60 istek sınırı aşıldı"
                    }
                }
            }
        },
        "/orders": {
            "get": {
                "summary": "Siparişler",
                "description": "Sipariş geçmişi.",
                "tags": [
                    "Siparişler"
                ],
                "security": [
                    {
                        "bearerAuth": []
                    }
                ],
                "x-scope": "orders",
                "responses": {
                    "200": {
                        "description": "Başarılı",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "total": {
                                                        "type": "number",
                                                        "format": "float"
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Geçersiz ya da süresi dolmuş API anahtarı"
                    },
                    "403": {
                        "description": "IP kısıtı ya da kapsam (scope) yetkisi yok"
                    },
                    "429": {
                        "description": "Dakikada 60 istek sınırı aşıldı"
                    }
                }
            }
        }
    }
}