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