{
    "basePath": "http://api.basetax.co.uk/v4",
    "swaggerVersion": "1.2",
    "apiVersion": "1.0.0",
    "resourcePath": "/invoices",
    "apis": [
        {
            "path": "/invoices",
            "operations": [
                {
                    "method": "GET",
                    "summary": "Get all invoices",
                    "nickname": "invoices",
                    "parameters": [
                        {
                            "paramType": "query",
                            "name": "business_id",
                            "type": "string",
                            "description": "Business ID"
                        },
                        {
                            "paramType": "query",
                            "name": "customer_id",
                            "type": "string",
                            "description": "Customer ID"
                        },
                        {
                            "paramType": "query",
                            "name": "invoice_template_id",
                            "type": "string",
                            "description": "Invoice template ID"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                },
                {
                    "method": "POST",
                    "summary": "Create a invoice",
                    "nickname": "invoice",
                    "parameters": [
                        {
                            "paramType": "body",
                            "name": "body",
                            "type": "Invoice",
                            "required": true,
                            "allowMultiple": true,
                            "description": "Json Object"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/export",
            "operations": [
                {
                    "method": "POST",
                    "summary": "Export all invoice",
                    "nickname": "exportInvoice",
                    "parameters": [
                        {
                            "paramType": "body",
                            "name": "json",
                            "type": "json",
                            "description": "Json"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/generate/number",
            "operations": [
                {
                    "method": "GET",
                    "summary": "Generate number of invoice",
                    "nickname": "invoice",
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/{id}",
            "operations": [
                {
                    "method": "GET",
                    "summary": "Get a invoice",
                    "nickname": "invoice",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                },
                {
                    "method": "PUT",
                    "summary": "Update a invoice",
                    "nickname": "invoice",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        },
                        {
                            "paramType": "body",
                            "name": "body",
                            "type": "Invoice",
                            "required": true,
                            "allowMultiple": true,
                            "description": "Json Object"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                },
                {
                    "method": "DELETE",
                    "summary": "Delete a invoice",
                    "nickname": "invoice",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/{id}/export-pdf",
            "operations": [
                {
                    "method": "GET",
                    "summary": "Export invoice pdf",
                    "nickname": "exportInvoicePdf",
                    "parameters": [
                        {
                            "paramType": "body",
                            "name": "json",
                            "type": "json",
                            "description": "Json"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/{id}/paid",
            "operations": [
                {
                    "method": "POST",
                    "summary": "Update a invoice",
                    "nickname": "invoice",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        },
                        {
                            "paramType": "query",
                            "name": "paid",
                            "type": "string",
                            "description": "Paid"
                        },
                        {
                            "paramType": "query",
                            "name": "paid_on",
                            "type": "string",
                            "description": "Paid on"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/{id}/remind-customer",
            "operations": [
                {
                    "method": "POST",
                    "summary": "Send to client",
                    "nickname": "remindCustomer",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        },
        {
            "path": "/invoices/{id}/send-to-client",
            "operations": [
                {
                    "method": "POST",
                    "summary": "Send to client",
                    "nickname": "sendToClient",
                    "parameters": [
                        {
                            "paramType": "path",
                            "name": "id",
                            "type": "string",
                            "required": true,
                            "description": "Id"
                        }
                    ],
                    "responseMessages": [
                        {
                            "code": 400,
                            "message": "Invalid request params"
                        },
                        {
                            "code": 401,
                            "message": "Caller is not authenticated"
                        },
                        {
                            "code": 404,
                            "message": "Resource not found"
                        }
                    ]
                }
            ]
        }
    ],
    "models": {
        "Invoice": {
            "id": "Invoice",
            "properties": {
                "invoice_no": {
                    "type": "number"
                },
                "customer_id": {
                    "type": "integer"
                },
                "business_id": {
                    "type": "integer"
                },
                "payment_type_id": {
                    "type": "integer"
                },
                "invoice_template_id": {
                    "type": "integer"
                },
                "invoice_template": {
                    "type": "string"
                },
                "invoice_details": {
                    "type": "array",
                    "items": {
                        "$ref": "invoiceDetail"
                    }
                },
                "date": {
                    "type": "string"
                },
                "due_selection": {
                    "type": "string"
                },
                "due_on": {
                    "type": "string"
                },
                "amount": {
                    "type": "number"
                },
                "vat": {
                    "type": "number"
                },
                "total": {
                    "type": "number"
                },
                "notes": {
                    "type": "string"
                },
                "paid": {
                    "type": "string"
                },
                "paid_on": {
                    "type": "string"
                },
                "extra": {
                    "type": "string"
                }
            }
        },
        "invoiceDetail": {
            "id": "invoiceDetail",
            "properties": {
                "product_id": {
                    "type": "integer"
                },
                "quantity": {
                    "type": "integer"
                },
                "name": {
                    "$ref": "product"
                },
                "description": {
                    "$ref": "product"
                },
                "unit_price": {
                    "$ref": "product"
                },
                "tax_rate": {
                    "$ref": "product"
                }
            }
        }
    },
    "produces": [
        "application/json"
    ]
}