{
    "openapi": "3.0.0",
    "info": {
        "title": "Wolet Accounting API",
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://wolet.lt/api",
            "description": "Production"
        }
    ],
    "paths": {
        "/v1/customers/company/create": {
            "post": {
                "tags": [
                    "v1/customers"
                ],
                "summary": "Create new company customer",
                "operationId": "0ed990ec0e193e7a9eeea59337ee6f61",
                "parameters": [
                    {
                        "name": "full_name",
                        "in": "query",
                        "description": "Customer full name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "address",
                        "in": "query",
                        "description": "Customer address",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "city",
                        "in": "query",
                        "description": "Customer city",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "zip",
                        "in": "query",
                        "description": "Customer zip code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "country",
                        "in": "query",
                        "description": "Customer country",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "locale",
                        "in": "query",
                        "description": "Customer locale",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "phone",
                        "in": "query",
                        "description": "Customer phone",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "description": "Customer email",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password",
                        "in": "query",
                        "description": "Customer password",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "password_confirmation",
                        "in": "query",
                        "description": "Customer password conformation",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "company_code",
                        "in": "query",
                        "description": "Customer company code",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "company_name",
                        "in": "query",
                        "description": "Customer company name",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "company_vat",
                        "in": "query",
                        "description": "Customer company vat code",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "400": {
                        "description": "Invalid request"
                    },
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "string"
                                        },
                                        "response": {
                                            "description": "The response array",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "message": {
                                                        "description": "The reponse description",
                                                        "type": "string"
                                                    },
                                                    "data": {
                                                        "description": "The response data",
                                                        "type": "array",
                                                        "items": {}
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": "SUCCESS",
                                        "response": {
                                            "message": "customer created",
                                            "data": {
                                                "id": "123"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/hostings/sync": {
            "post": {
                "tags": [
                    "v1/hostings"
                ],
                "summary": "Sync hosting plan with customer",
                "operationId": "a5706517be4598fb976d3627103ccd50",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "description": "Customer id",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "plan_id",
                        "in": "query",
                        "description": "Hosting plan title",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "Svetainei",
                                "Universalus",
                                "Verslui",
                                "Didmenininkas",
                                "Paštui"
                            ],
                            "example": "Universalus"
                        }
                    },
                    {
                        "name": "server_id",
                        "in": "query",
                        "description": "Hosting server hostname",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "enum": [
                                "s20.wolet.lt",
                                "s2.wolet.lt",
                                "s1.wolet.lt",
                                "s19.wolet.lt",
                                "s18.webas.lt",
                                "s17.webas.lt",
                                "s16.webas.lt",
                                "s14.webas.lt",
                                "s12.webas.lt"
                            ],
                            "example": "s1.wolet.lt"
                        }
                    },
                    {
                        "name": "qty",
                        "in": "query",
                        "description": "Hosting pay term month",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "price",
                        "in": "query",
                        "description": "Hostings month price",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "username",
                        "in": "query",
                        "description": "Hosting Direct Admin username",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "domain",
                        "in": "query",
                        "description": "Hosting domain",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "expires_at",
                        "in": "query",
                        "description": "Customer email",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "400": {
                        "description": "Invalid request"
                    },
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "string"
                                        },
                                        "response": {
                                            "description": "The response array",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "message": {
                                                        "description": "The reponse description",
                                                        "type": "string"
                                                    },
                                                    "data": {
                                                        "description": "The response data",
                                                        "type": "array",
                                                        "items": {}
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": "SUCCESS",
                                        "response": {
                                            "message": "Hosting synced",
                                            "data": {
                                                "id": "123"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/hostings/domains": {
            "post": {
                "tags": [
                    "v1/hostings"
                ],
                "summary": "Sync hosting plan with customer",
                "operationId": "45d609af3de4c861348bb57f9cf9e9a5",
                "parameters": [
                    {
                        "name": "username",
                        "in": "query",
                        "description": "DA username",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "400": {
                        "description": "Invalid request"
                    },
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "string"
                                        },
                                        "response": {
                                            "description": "The response array",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "message": {
                                                        "description": "The reponse description",
                                                        "type": "string"
                                                    },
                                                    "data": {
                                                        "description": "The response data",
                                                        "type": "array",
                                                        "items": {}
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": "SUCCESS",
                                        "response": {
                                            "message": "Hosting domians",
                                            "data": {
                                                "id": "123"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/hostings/users": {
            "post": {
                "tags": [
                    "v1/hostings"
                ],
                "summary": "Get all school users",
                "operationId": "1cc992ff4e85eddefeeeabf2e7d6babe",
                "parameters": [
                    {
                        "name": "server",
                        "in": "query",
                        "description": "Server hotname",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "400": {
                        "description": "Invalid request"
                    },
                    "200": {
                        "description": "success",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "description": "The response code",
                                            "type": "string"
                                        },
                                        "response": {
                                            "description": "The response array",
                                            "type": "array",
                                            "items": {
                                                "properties": {
                                                    "message": {
                                                        "description": "The reponse description",
                                                        "type": "string"
                                                    },
                                                    "data": {
                                                        "description": "The response data",
                                                        "type": "array",
                                                        "items": {}
                                                    }
                                                },
                                                "type": "object"
                                            }
                                        }
                                    },
                                    "type": "object",
                                    "example": {
                                        "status": "SUCCESS",
                                        "response": {
                                            "message": "All school domains",
                                            "data": {
                                                "id": "123"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/get": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get list of invoices",
                "description": "Returns list of invoices filtered by seller name containing 'UAB Duomen'",
                "operationId": "a32c92da778b472012ad9d7a47f9bad8",
                "parameters": [
                    {
                        "name": "type",
                        "in": "query",
                        "description": "Filter by invoice type (canceled or active)",
                        "required": false,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Invoices list"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/proforma": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get invoices without VAT invoice",
                "description": "Returns list of invoices that do not have an associated VAT invoice",
                "operationId": "1894516c416cd57dc7cc178a4f7c9680",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Invoices without VAT invoice"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/vat/paid": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Set VAT invoice as paid",
                "description": "Marks the VAT invoice associated with the given invoice_id as paid",
                "operationId": "ecf7b3f1ab5f4cd2dafade7b3d29300d",
                "parameters": [
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "VAT invoice marked as paid"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "VAT invoice not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/vat/generate": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Save invoice as paid and generate VAT invoice",
                "description": "Generates VAT invoice and marks invoice as paid. Returns error if already paid or VAT date set.",
                "operationId": "1c4eabbb57be49d6f87c6393dbe5a495",
                "parameters": [
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Invoice saved as paid"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/school-users": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get all school users",
                "description": "Returns all users from s19.wolet.lt and s20.wolet.lt school servers via DirectAdmin",
                "operationId": "7366a2d8b2febff979e0c2f6693cdf97",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "School users list"
                                                },
                                                "data": {
                                                    "properties": {
                                                        "s19.wolet.lt": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object"
                                                            }
                                                        },
                                                        "s20.wolet.lt": {
                                                            "type": "array",
                                                            "items": {
                                                                "type": "object"
                                                            }
                                                        }
                                                    },
                                                    "type": "object"
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/items": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get invoice items with service details",
                "description": "Returns all invoice items for a given invoice with full hosting/domain service info including plan details",
                "operationId": "b90ad663b22f96052c59a6a0d6b67f47",
                "parameters": [
                    {
                        "name": "invoice_id",
                        "in": "query",
                        "description": "Invoice ID",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Invoice items with service details"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Invoice not found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/domain-plans": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get all domain plans",
                "description": "Returns all available domain plans with pricing and TLD info",
                "operationId": "f74b9139741709a134faf5a1818a9543",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Domain plans list"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        },
        "/v1/invoices/hosting-plans": {
            "post": {
                "tags": [
                    "v1/invoices"
                ],
                "summary": "Get all hosting plans",
                "description": "Returns all available hosting plans including archived ones",
                "operationId": "a5a210cdee17993b7414d7d4587d4d74",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "status": {
                                            "type": "string",
                                            "example": "success"
                                        },
                                        "response": {
                                            "properties": {
                                                "message": {
                                                    "type": "string",
                                                    "example": "Hosting plans list"
                                                },
                                                "data": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        }
    },
    "tags": [
        {
            "name": "v1/customers",
            "description": "v1/customers"
        },
        {
            "name": "v1/hostings",
            "description": "v1/hostings"
        },
        {
            "name": "v1/invoices",
            "description": "v1/invoices"
        }
    ],
    "components": {
        "securitySchemes": {
            "sanctum": {
                "type": "apiKey",
                "description": "Enter token in format (Bearer <token>)",
                "name": "Authorization",
                "in": "header"
            }
        }
    }
}