{
    "openapi": "3.0.0",
    "info": {
        "title": "LK API – API Reference",
        "description": "Welcome to the LK API platform. All endpoints require an API key passed in the `Authorization` header as `Bearer YOUR_API_KEY`.",
        "contact": {
            "name": "LK API Support",
            "email": "support@lkapi.io"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://lkapi.udarax.me",
            "description": "Primary API Server"
        }
    ],
    "paths": {
        "/api/location/sri-lanka-province": {
            "get": {
                "summary": "List Sri Lanka provinces",
                "description": "Returns a list of Sri Lanka provinces. Optionally filter by name or code, or limit the number of results.",
                "operationId": "getProvinces",
                "parameters": [
                    {
                        "name": "name",
                        "in": "query",
                        "description": "Filter provinces by name (partial match, case-insensitive)",
                        "required": false
                    },
                    {
                        "name": "code",
                        "in": "query",
                        "description": "Filter by exact province code (e.g. WP, CP, NP)",
                        "required": false
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of results to return",
                        "required": false
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response — array of province objects",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "$ref": "#/components/schemas/Province"
                                    }
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthorized — missing or invalid API key",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "Unauthenticated."
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validation error",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The name field must be a string."
                                        },
                                        "errors": {
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "x-product-slug": "sri-lanka-province",
                "x-codeSamples": [
                    {
                        "lang": "cURL",
                        "source": "curl -X GET 'http://localhost:8000/api/location/sri-lanka-province?limit=5' \\n  -H 'Authorization: Bearer YOUR_API_KEY'"
                    },
                    {
                        "lang": "JavaScript",
                        "source": "fetch('http://localhost:8000/api/location/sri-lanka-province?limit=5', {\\n  method: 'GET',\\n  headers: {\\n    'Authorization': 'Bearer YOUR_API_KEY'\\n  }\\n})\\n  .then(response => response.json())\\n  .then(console.log);"
                    },
                    {
                        "lang": "PHP",
                        "source": "$client = new \\GuzzleHttp\\Client();\\n$response = $client->request('GET', 'http://localhost:8000/api/location/sri-lanka-province?limit=5', [\\n  'headers' => [\\n    'Authorization' => 'Bearer YOUR_API_KEY',\\n    'Accept'        => 'application/json',\\n  ]\\n]);\\n\\necho $response->getBody();"
                    },
                    {
                        "lang": "Python",
                        "source": "import requests\\n\\nurl = 'http://localhost:8000/api/location/sri-lanka-province?limit=5'\\nheaders = {\\n  'Authorization': 'Bearer YOUR_API_KEY'\\n}\\n\\nresponse = requests.get(url, headers=headers)\\nprint(response.json())"
                    }
                ]
            }
        },
        "/api/location/sri-lanka-district": {
            "get": {
                "summary": "List Sri Lanka districts",
                "description": "Returns a list of Sri Lanka districts.",
                "operationId": "getDistricts",
                "parameters": [
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "Maximum number of results to return",
                        "required": false
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful response — array of district objects",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "ApiKeyAuth": []
                    }
                ],
                "x-product-slug": "sri-lanka-district",
                "x-codeSamples": [
                    {
                        "lang": "cURL",
                        "source": "curl -X GET 'http://localhost:8000/api/location/sri-lanka-district' \\n  -H 'Authorization: Bearer YOUR_API_KEY'"
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "Province": {
                "type": "object"
            }
        },
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "description": "Pass your API key. Format: <code>Bearer YOUR_API_KEY</code>",
                "name": "Authorization",
                "in": "header"
            }
        }
    },
    "tags": []
}