{
    "swagger": "2.0",
    "info": {
        "description": "This is a billing system server",
        "title": "Billing System  API",
        "contact": {},
        "version": "1.0"
    },
    "host": "127.0.0.1:18888",
    "basePath": "/api/v1/billing",
    "paths": {
        "/packages": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Package",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.PackageInfo"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create Package",
                "parameters": [
                    {
                        "description": "Package",
                        "name": "Package",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfo"
                        }
                    }
                }
            }
        },
        "/packages/{package_id}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Package",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfo"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Update Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "package_id",
                        "name": "package_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Package",
                        "name": "Package",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfo"
                        }
                    }
                }
            },
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Delete Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "package_id",
                        "name": "package_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            },
            "patch": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Patch Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "package_id",
                        "name": "package_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Package",
                        "name": "Package",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.PackageInfo"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/binded_packages": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Binded Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.BindedPackageInfo"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Bind Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Package",
                        "name": "Package",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.BindedPackageInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.BindedPackageInfo"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/binded_packages/{binded_package_id}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Get Binded Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.BindedPackageInfo"
                        }
                    }
                }
            },
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Unbind Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/binded_packages/{binded_package_id}/charge_credits": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Charge Credits History",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "ChargeCredits",
                        "name": "ChargeCredits",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.CreditsChargeInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.CreditsChargeHistory"
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Charge Credits",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "ChargeCredits",
                        "name": "ChargeCredits",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.CreditsChargeInfoInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.BindedPackageInfo"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/binded_packages/{binded_package_id}/discount": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Ubbind Package",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Discount",
                        "name": "Discount",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.ChangeBindedDiscountInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.BindedPackageInfo"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/commitment_invoices": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create Commitment Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "CommitmentInvoiceInput",
                        "name": "CommitmentInvoiceInput",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.CommitmentInvoiceInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Invoice"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/costexplorer": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Cost Explorer",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Query",
                        "name": "Query",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.CostExplorerQuery"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.CostExplorerResult"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/costexplorer/monthly_cost/year/{year}/month/{month}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Cost Explorer Monthly",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "year",
                        "name": "year",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "month",
                        "name": "month",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.MonthlycostExplorerResult"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/costexplorer/monthly_cost/year/{year}/month/{month}/export": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/octet-stream"
                ],
                "summary": "Cost Explorer Monthly",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "year",
                        "name": "year",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "month",
                        "name": "month",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/tenants/{tenant_id}/invoices": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Invoices",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.Invoice"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "CreateInvoiceReq",
                        "name": "CreateInvoiceReq",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.CreateInvoiceReq"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Invoice"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/invoices/{invoice_id}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Get Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "invoice_id",
                        "name": "invoice_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Invoice"
                        }
                    }
                }
            },
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Delete Unsent Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "invoice_id",
                        "name": "invoice_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/invoices/{invoice_id}/confirm": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Confirm Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "invoice_id",
                        "name": "invoice_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Invoice"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/invoices/{invoice_id}/send": {
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Send Invoice",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "invoice_id",
                        "name": "invoice_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Invoice"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/measures": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Cost Units",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Cost",
                        "name": "Cost",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.UnitCostsInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.UnitCosts"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/measures/dryrun": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Cost Units Dryrun",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Cost",
                        "name": "Cost",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.UnitCostsInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.UnitCosts"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List PaymentMethod",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.PaymentMethod"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create PaymentMethod",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "PaymentMethod",
                        "name": "PaymentMethod",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.PaymentMethodInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.PaymentMethod"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/customer": {
            "get": {
                "description": "GetCustomerInfo",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "GetCustomerInfo",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.StripeCustomerInfo"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/invoices": {
            "get": {
                "description": "ListStripeInvoices",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "ListStripeInvoices",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.StripeInvoice"
                            }
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/payment_methods": {
            "get": {
                "description": "ListPaymentMethods",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "ListPaymentMethods",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.StripePaymentMethod"
                            }
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/payment_methods/{payment_method_id}": {
            "put": {
                "description": "UpdatePaymentMethod",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "UpdatePaymentMethod",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "payment_method_id",
                        "name": "payment_method_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "method",
                        "name": "method",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.StripePaymentMethod"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.StripePaymentMethod"
                        }
                    }
                }
            },
            "delete": {
                "description": "DeletePaymentMethod",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "DeletePaymentMethod",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "payment_method_id",
                        "name": "payment_method_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/payment_methods/{payment_method_id}/default": {
            "put": {
                "description": "SetPaymentMethodDefault",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "SetPaymentMethodDefault",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "payment_method_id",
                        "name": "payment_method_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/setup_intent": {
            "post": {
                "description": "SetupIntent",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "SetupIntent",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.SetupIntent"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/payments/stripe/setup_intent/confirm": {
            "put": {
                "description": "ConfirmIntent",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "StripePayment"
                ],
                "summary": "ConfirmIntent",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List All Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.Subscription"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Subscription",
                        "name": "Subscription",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.SubscriptionInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Subscription"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Get Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Subscription"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Update Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "Subscription",
                        "name": "Subscription",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.SubscriptionInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.Subscription"
                        }
                    }
                }
            },
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Delete Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}/actions/accept": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Accept Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}/actions/download": {
            "post": {
                "summary": "Download Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {}
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}/actions/reject": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Reject Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "SubscriptionChange",
                        "name": "SubscriptionChange",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.SubscriptionChange"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}/actions/submit": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Submit Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "SubscriptionChange",
                        "name": "SubscriptionChange",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.SubscriptionChange"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/subcriptions/{subscription_id}/actions/suspend": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Suspend Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "SubscriptionChange",
                        "name": "SubscriptionChange",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.SubscriptionChange"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/tenants/{tenant_id}/submited_subcriptions": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Submited Subscription",
                "parameters": [
                    {
                        "type": "string",
                        "description": "tenant_id",
                        "name": "tenant_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.Subscription"
                            }
                        }
                    }
                }
            }
        },
        "/units": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "List Units",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.UnitInfo"
                            }
                        }
                    }
                }
            },
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Create Unit",
                "parameters": [
                    {
                        "description": "unit",
                        "name": "unit",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/forms.UnitInfo"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.UnitInfo"
                        }
                    }
                }
            }
        },
        "/units/_bulk": {
            "post": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Bulk CreateOrUpdate Unit",
                "parameters": [
                    {
                        "description": "units",
                        "name": "unit",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/forms.UnitInfo"
                            }
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        },
        "/units/{unit_key}": {
            "get": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Get Unit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UnitKey",
                        "name": "unit_key",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.UnitInfo"
                        }
                    }
                }
            },
            "put": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Update Unit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UnitKey",
                        "name": "unit_key",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.UnitInfo"
                        }
                    }
                }
            },
            "delete": {
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "summary": "Delete Unit",
                "parameters": [
                    {
                        "type": "string",
                        "description": "UnitKey",
                        "name": "unit_key",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/forms.OKType"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "forms.Address": {
            "type": "object",
            "properties": {
                "city": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "line1": {
                    "type": "string"
                },
                "line2": {
                    "type": "string"
                },
                "postal_code": {
                    "type": "string"
                },
                "state": {
                    "type": "string"
                }
            }
        },
        "forms.BillingDetails": {
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/forms.Address"
                },
                "email": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                },
                "phone": {
                    "type": "string"
                }
            }
        },
        "forms.BindedPackageInfo": {
            "type": "object",
            "properties": {
                "binded_discount": {
                    "type": "number"
                },
                "binded_package_id": {
                    "type": "integer"
                },
                "package_id": {
                    "type": "integer"
                },
                "package_info": {
                    "$ref": "#/definitions/forms.PackageInfo"
                },
                "remaining_credits": {
                    "type": "number"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "integer"
                }
            }
        },
        "forms.BindedPackageInfoInput": {
            "type": "object",
            "properties": {
                "package_id": {
                    "type": "integer"
                }
            }
        },
        "forms.Card": {
            "type": "object",
            "properties": {
                "brand": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "exp_month": {
                    "type": "string",
                    "example": "0"
                },
                "exp_year": {
                    "type": "string",
                    "example": "0"
                },
                "fingerprint": {
                    "type": "string"
                },
                "funding": {
                    "type": "string"
                },
                "last4": {
                    "type": "string"
                }
            }
        },
        "forms.CategoryCosts": {
            "type": "object",
            "properties": {
                "category_unit_costs": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/forms.Price"
                    }
                },
                "cost_price": {
                    "type": "number"
                },
                "raw_price": {
                    "type": "number"
                },
                "unit_costs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.UnitCosts"
                    }
                }
            }
        },
        "forms.ChangeBindedDiscountInput": {
            "type": "object",
            "properties": {
                "binded_discount": {
                    "type": "number"
                },
                "change_reason": {
                    "type": "string"
                },
                "changer_tenant_id": {
                    "type": "integer"
                },
                "changer_user_id": {
                    "type": "integer"
                }
            }
        },
        "forms.CommitmentInvoiceInput": {
            "type": "object",
            "properties": {
                "amount": {
                    "type": "number"
                },
                "owner": {
                    "type": "string"
                },
                "time": {
                    "type": "string"
                }
            }
        },
        "forms.CostExplorerQuery": {
            "type": "object",
            "properties": {
                "end_date": {
                    "type": "string"
                },
                "invoice_id": {
                    "type": "integer"
                },
                "start_date": {
                    "type": "string"
                }
            }
        },
        "forms.CostExplorerResult": {
            "type": "object",
            "properties": {
                "binded_invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "credits_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "unbind_invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                }
            }
        },
        "forms.Costs": {
            "type": "object",
            "properties": {
                "category_unit_costs": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/forms.Price"
                    }
                },
                "cost_price": {
                    "type": "number"
                },
                "label_unit_costs": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/forms.LabelCosts"
                    }
                },
                "raw_price": {
                    "type": "number"
                },
                "unit_costs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.UnitCosts"
                    }
                }
            }
        },
        "forms.CreateInvoiceReq": {
            "type": "object",
            "properties": {
                "start_date": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                }
            }
        },
        "forms.CreditsChargeHistory": {
            "type": "object",
            "properties": {
                "binded_package_id": {
                    "type": "integer"
                },
                "history": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.CreditsChargeInfo"
                    }
                },
                "total_amounts": {
                    "type": "number"
                }
            }
        },
        "forms.CreditsChargeInfo": {
            "type": "object",
            "properties": {
                "binded_package_id": {
                    "type": "integer"
                },
                "charge_count": {
                    "type": "number"
                },
                "charge_reason": {
                    "type": "string"
                },
                "charge_time": {
                    "type": "string"
                },
                "charger_tenant_id": {
                    "type": "integer"
                },
                "charger_user_id": {
                    "type": "integer"
                }
            }
        },
        "forms.CreditsChargeInfoInput": {
            "type": "object",
            "properties": {
                "charge_count": {
                    "type": "number"
                },
                "charge_reason": {
                    "type": "string"
                },
                "charger_tenant_id": {
                    "type": "integer"
                },
                "charger_user_id": {
                    "type": "integer"
                }
            }
        },
        "forms.ExpressionLabel": {
            "type": "object",
            "properties": {
                "label": {
                    "type": "string"
                },
                "operator": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                }
            }
        },
        "forms.Invoice": {
            "type": "object",
            "properties": {
                "category_unit_costs": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/forms.Price"
                    }
                },
                "cost_price": {
                    "type": "number"
                },
                "end_date": {
                    "type": "string"
                },
                "invoice_id": {
                    "type": "integer"
                },
                "label_unit_costs": {
                    "type": "object",
                    "additionalProperties": {
                        "$ref": "#/definitions/forms.LabelCosts"
                    }
                },
                "raw_price": {
                    "type": "number"
                },
                "start_date": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "integer"
                },
                "type": {
                    "type": "string"
                },
                "unit_costs": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.UnitCosts"
                    }
                }
            }
        },
        "forms.LabelCosts": {
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/forms.CategoryCosts"
            }
        },
        "forms.MonthlycostExplorerResult": {
            "type": "object",
            "properties": {
                "binded_invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "credits_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                },
                "invoice_generated": {
                    "type": "boolean"
                },
                "unbind_invoice_costs": {
                    "$ref": "#/definitions/forms.Costs"
                }
            }
        },
        "forms.OKType": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string",
                    "example": "ok"
                }
            }
        },
        "forms.PackageInfo": {
            "type": "object",
            "properties": {
                "credits": {
                    "type": "number"
                },
                "credits_enable": {
                    "type": "boolean"
                },
                "credits_only": {
                    "type": "boolean"
                },
                "description": {
                    "type": "string"
                },
                "discount": {
                    "description": "no need unit count for now, only pay for need\nUnitCount   []UnitCount",
                    "type": "number"
                },
                "expression_labels": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.ExpressionLabel"
                    }
                },
                "extra_pricing_infos": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.PricingInfo"
                    }
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "package_id": {
                    "type": "integer"
                },
                "tenant_max_binded_times": {
                    "type": "integer"
                },
                "unit_prices": {
                    "$ref": "#/definitions/forms.UnitPrices"
                },
                "version": {
                    "type": "integer"
                }
            }
        },
        "forms.PackageInfoInput": {
            "type": "object",
            "properties": {
                "credits": {
                    "type": "number"
                },
                "credits_enable": {
                    "type": "boolean"
                },
                "credits_only": {
                    "type": "boolean"
                },
                "description": {
                    "type": "string"
                },
                "discount": {
                    "type": "number"
                },
                "expression_labels": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.ExpressionLabel"
                    }
                },
                "extra_pricing_infos": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.PricingInfo"
                    }
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "tenant_max_binded_times": {
                    "type": "integer"
                },
                "unit_prices": {
                    "$ref": "#/definitions/forms.UnitPrices"
                }
            }
        },
        "forms.PaymentMethod": {
            "type": "object",
            "properties": {
                "payable": {
                    "type": "boolean"
                },
                "payment_code": {
                    "type": "string"
                },
                "payment_method_id": {
                    "type": "integer"
                },
                "payment_type": {
                    "type": "string"
                },
                "tenant_id": {
                    "type": "integer"
                }
            }
        },
        "forms.PaymentMethodInput": {
            "type": "object",
            "properties": {
                "payment_type": {
                    "type": "string"
                }
            }
        },
        "forms.Price": {
            "type": "object",
            "properties": {
                "cost_price": {
                    "type": "number"
                },
                "raw_price": {
                    "type": "number"
                }
            }
        },
        "forms.PricingInfo": {
            "type": "object",
            "properties": {
                "discount": {
                    "type": "number"
                },
                "expression_labels": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/forms.ExpressionLabel"
                    }
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "unit_prices": {
                    "$ref": "#/definitions/forms.UnitPrices"
                }
            }
        },
        "forms.SetupIntent": {
            "type": "object",
            "properties": {
                "client_secret": {
                    "type": "string"
                },
                "public_key": {
                    "type": "string"
                }
            }
        },
        "forms.StripeCustomerInfo": {
            "type": "object",
            "properties": {
                "address": {
                    "$ref": "#/definitions/forms.Address"
                },
                "dbaas_id": {
                    "type": "string"
                },
                "default_source": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "email": {
                    "type": "string"
                },
                "id": {
                    "type": "string"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "forms.StripeInvoice": {
            "type": "object",
            "properties": {
                "amount_due": {
                    "type": "string",
                    "example": "0"
                },
                "amount_paid": {
                    "type": "string",
                    "example": "0"
                },
                "created": {
                    "type": "string",
                    "example": "0"
                },
                "credit_used": {
                    "type": "string",
                    "example": "0"
                },
                "currency": {
                    "type": "string"
                },
                "due_date": {
                    "type": "string",
                    "example": "0"
                },
                "id": {
                    "type": "string"
                },
                "invoice_pdf": {
                    "type": "string"
                },
                "number": {
                    "type": "string"
                },
                "paid": {
                    "type": "boolean"
                },
                "status": {
                    "type": "string"
                },
                "total": {
                    "type": "string",
                    "example": "0"
                }
            }
        },
        "forms.StripePaymentMethod": {
            "type": "object",
            "properties": {
                "billing_details": {
                    "$ref": "#/definitions/forms.BillingDetails"
                },
                "card": {
                    "$ref": "#/definitions/forms.Card"
                },
                "id": {
                    "type": "string"
                }
            }
        },
        "forms.Subscription": {
            "type": "object",
            "properties": {
                "accepted_date": {
                    "type": "string"
                },
                "accepted_user": {
                    "type": "string"
                },
                "contract_email": {
                    "type": "string"
                },
                "file_path": {
                    "type": "string"
                },
                "rejected_date": {
                    "type": "string"
                },
                "rejected_user": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "subscription_id": {
                    "type": "integer"
                },
                "tenant_id": {
                    "type": "integer"
                }
            }
        },
        "forms.SubscriptionChange": {
            "type": "object",
            "properties": {
                "change_user": {
                    "type": "string"
                }
            }
        },
        "forms.SubscriptionInput": {
            "type": "object",
            "properties": {
                "contract_email": {
                    "type": "string"
                },
                "file_path": {
                    "type": "string"
                }
            }
        },
        "forms.UnitCosts": {
            "type": "object",
            "properties": {
                "binded_package_id": {
                    "type": "integer"
                },
                "consumed_source": {
                    "type": "string"
                },
                "cost": {
                    "type": "integer"
                },
                "cost_id": {
                    "type": "string"
                },
                "cost_time_stamp": {
                    "type": "integer"
                },
                "invoice_id": {
                    "type": "integer"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "package_id": {
                    "type": "integer"
                },
                "package_version": {
                    "type": "integer"
                },
                "price": {
                    "type": "number"
                },
                "raw_price": {
                    "type": "number"
                },
                "unit": {
                    "type": "string"
                }
            }
        },
        "forms.UnitCostsInput": {
            "type": "object",
            "properties": {
                "cost": {
                    "type": "integer"
                },
                "cost_id": {
                    "description": "optional",
                    "type": "string"
                },
                "cost_time_stamp": {
                    "type": "integer"
                },
                "labels": {
                    "type": "object",
                    "additionalProperties": {
                        "type": "string"
                    }
                },
                "unit": {
                    "type": "string"
                }
            }
        },
        "forms.UnitInfo": {
            "type": "object",
            "properties": {
                "category": {
                    "description": "optional",
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "unit": {
                    "type": "string",
                    "minLength": 1
                }
            }
        },
        "forms.UnitPrice": {
            "type": "object",
            "properties": {
                "multiple_factor_label": {
                    "type": "string"
                },
                "multiple_factor_threshold": {
                    "type": "integer"
                },
                "price": {
                    "type": "number"
                },
                "unit": {
                    "type": "string"
                }
            }
        },
        "forms.UnitPrices": {
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/forms.UnitPrice"
            }
        }
    }
}