openapi: 3.0.0
info:
  title: Hosted-Pages
  description: Zoho Billing provides a hosted payment page to integrate with your websites. You can securely integrate with Zoho Billing for collecting your customer's sensitive card information through the hosted page. These Hosted Pages will expire within one hour.
  contact: {}
  version: 1.0.0
servers:
  - url: https://www.zohoapis.com/billing/v1
    description: API Endpoint
tags:
  - name: hosted-pages
    description: Hosted-Pages Module
paths:
  /hostedpages/{hostedpage_id}:
    get:
      tags:
        - hosted-pages
      operationId: get_hosted_page
      summary: Retrieve a hosted page
      description: Details of a specific hosted page. The <code>data</code> field will be populated with the subscription details in case of successfull subscription via Hostedpage. In case of fresh hosted pages the <code>data</code> field will be empty.
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/retrieve-a-hosted-page-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.READ
    parameters:
      - name: hostedpage_id
        in: path
        required: true
        description: Unique identifier of the hosted page.
        schema:
          type: string
        example: 8c589071e7e26a8d28e8af081c373fb00bd6dc5366fd129eefd5c61c569da526
      - $ref: '#/components/parameters/organization_id'
  /hostedpages:
    get:
      tags:
        - hosted-pages
      operationId: list_hosted_pages
      summary: List of HostedPages
      description: Retrieve the list of all hosted pages.
      parameters:
        - name: page
          in: query
          description: Page number to be fetched. Default value is 1.
          required: false
          schema:
            type: integer
            default: 1
          example: 1
        - name: per_page
          in: query
          description: Number of records to be fetched per page. Default value is 200.
          required: false
          schema:
            type: integer
            default: 200
          example: 200
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/list-of-hostedpages-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.READ
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/newsubscription:
    post:
      tags:
        - hosted-pages
      operationId: create_subscription_hosted_page
      summary: Create a subscription
      description: Create a hosted page for a new subscription. To create a subscription for a new customer, you have to pass the customer object. To create a subscription for a existing customer pass the customer_id of that customer.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/create-a-subscription-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-a-subscription-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/updatesubscription:
    post:
      tags:
        - hosted-pages
      operationId: update_subscription_hosted_page
      summary: Update a subscription
      description: Create a hosted page for a updating a subscription.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-a-subscription-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-a-subscription-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/updatecard:
    post:
      tags:
        - hosted-pages
      operationId: update_card_hosted_page
      summary: Update card for a subscription
      description: Create hosted page for updating card information for a subscription.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-card-for-a-subscription-request'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-card-for-a-subscription-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/buyonetimeaddon:
    post:
      tags:
        - hosted-pages
      operationId: buy_onetime_addon_hosted_page
      summary: Buy one-time addon for a subscription
      description: Create hosted page for buying a one-time addon for a subscription.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/buy-one-time-addon-for-a-subscription-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/buy-one-time-addon-for-a-subscription-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/addpaymentmethod:
    post:
      tags:
        - hosted-pages
      operationId: add_payment_method_hosted_page
      summary: Associate a Payment method for a customer
      description: Add payment method for a customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/add-payment-method-for-a-customer-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/add-payment-method-for-a-customer-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/invoicepayment:
    post:
      tags:
        - hosted-pages
      operationId: create_invoice_payment_hosted_page
      summary: Record a Invoice Payment
      description: Create a Hosted page for recording a Invoice payment for a subscription
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/record-invoice-payment-for-a-subscription-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/record-invoice-payment-for-a-subscription-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
    parameters:
      - $ref: '#/components/parameters/organization_id'
  /hostedpages/updatepaymentmethod:
    post:
      tags:
        - hosted-pages
      operationId: update_payment_method_hosted_page
      summary: Update customer payment details
      description: Create a Hosted Payment Page to update customers card, bank account (ACH) or PayPal details
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/update-payment-method-request'
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-payment-method-response'
      deprecated: false
      security:
        - Zoho_Auth:
            - ZohoSubscriptions.hostedpages.CREATE
      parameters:
        - $ref: '#/components/parameters/organization_id'
components:
  parameters:
    organization_id:
      name: X-com-zoho-subscriptions-organizationid
      description: ID of the organization
      in: header
      required: true
      schema:
        type: string
      example: '10234695'
  schemas:
    invoice_url:
      description: Url which corresponds to the invoice.
      type: string
      example: ''
    creditnote_id:
      description: Unique ID denoting the credit note.
      type: string
      example: '9030000079876'
    creditnotes_number:
      description: Reference number for the credit note.
      type: string
      example: CN-26
    credited_date:
      description: Date on which the credit were applied
      type: string
      example: '2016-06-15'
    credited_amount:
      description: Credited amount for the invoice
      type: string
      example: 15
    coupon_name:
      description: Name of the coupon applied to the subscription.
      type: string
      example: Flat 10
    hostedpage_id:
      description: Unique ID generated by the server. This is used to identify the generated hosted page.
      type: string
      example: 8c589071e7e26a8d28e8af081c373fb00bd6dc5366fd129eefd5c61c569da526
    status:
      description: Status of the hosted page generated. This can be <code>fresh</code>, <code>read</code>, <code>success</code>, <code>failed</code>, <code>cancelled</code> or <code>force_cancelled</code>.
      type: string
      example: success
    url:
      description: The URL of the hosted page generated.
      type: string
      example: https://billing.zoho.com/hostedpage/2-8c589071e7e26a8d28e8af081c373fb00bd6dc5366fd129eefd5c61c569da526/checkout
    action:
      description: Action that needs to be performed using the hosted page. This can be <code>new_subscription</code>, <code>update_subscription</code>, <code>update_card</code> or <code>one_time_addon</code>.
      type: string
      example: new_subscription
    redirect_url:
      description: It specifies the url to which the customer will be redirected after successful transaction.
      type: string
      example: http://www.zillum.com/products/piperhost
    expiring_time:
      description: The time at which the hosted page will expire.
      type: string
      example: 2016-06-05T00:11:16-0700
    created_time:
      description: The time at which the hosted page was created.
      type: string
      example: 2016-06-05T23:10:16-0700
    billing_address_id:
      description: ' ID of the respective billing address'
      type: string
      example: 3002000001806
    shipping_address_id:
      description: ' ID of the respective Shipping address'
      type: string
      example: 3002000001806
    branch_id:
      description: ' branch under which this transaction will fall under'
      type: string
      example: 3002000001806
    code:
      description: code for the response received.
      type: string
      example: '0'
    message:
      description: message for the response received.
      type: string
      example: success
    subscription_id:
      description: Unique ID generated for a subscription.
      type: string
      example: '9030000079200'
    name:
      description: Name generated by concatenation of the product name and the selected plan.
      type: string
      example: GatorHost-Basic
    customer_id:
      description: Customer ID of the customer for whom a subscription needs to be created.
      type: string
      example: '903000000000099'
    place_of_contact:
      type: string
      example: TN
      x-node_available_in:
        - India GST
      x-node_unavailable_in: []
      x-required_info: for non composite scheme indian GST registered organization
    account_id:
      description: Account ID of the bank account from which payment is made by the customer.
      type: string
      example: '9030000079200'
      x-required_info: if <code>auto_collect</code> node is true and any other payment method is not specified
    bank_account:
      description: Customer's bank account object. This contains <code>payment_gateway</code>, <code>account_number</code>, <code>account_type</code>, <code>routing_number</code>, <code>accept_license</code>, <code>first_name</code> and <code>last_name</code>.
      type: object
    customer_name:
      description: Name of the customer.
      type: string
      example: Benjamin
    customer:
      description: Customer object of the customer for whom you want to create a subscription. Each object contains <code>display_name</code>, <code>company_name</code>, <code>first_name</code>, <code>last_name</code>, <code>email</code>, <code>fax</code>, <code>currency_code</code> and <code>billing_address</code>.
      type: object
      properties:
        first_name:
          $ref: '#/components/schemas/first_name'
        last_name:
          $ref: '#/components/schemas/last_name'
        display_name:
          $ref: '#/components/schemas/display_name'
        email:
          $ref: '#/components/schemas/email'
        company_name:
          $ref: '#/components/schemas/company_name'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        phone:
          $ref: '#/components/schemas/phone'
        mobile:
          $ref: '#/components/schemas/mobile'
        place_of_contact:
          $ref: '#/components/schemas/place_of_contact'
    salutation:
      description: Salutation of the customer.
      type: string
      example: Mr.
    display_name:
      description: This will be name which will be displayed in the interface and invoices.
      type: string
      example: Bowman Furniture
    first_name:
      description: First name of the customer.
      type: string
      example: Benjamin
    last_name:
      description: Last name of the customer.
      type: string
      example: George
    email:
      description: Email address of the customer.
      type: string
      example: benjamin.george@bowmanfurniture.com
    company_name:
      description: Registered name of the company the customer represents.
      type: string
      example: Bowman Furniture
    currency_code:
      description: Currency code of the currency in which the customer wants to pay. If <code>currency_code</code> is not specified here, the currency chosen in your Zoho Billing organization will be used for billing. <code>currency_id</code> and <code>currency_symbol</code> are set automatically in accordance to the currency_code.
      type: string
      example: CAD
    currency_symbol:
      description: Currency symbol of the customer's currency.
      type: string
      example: $
    phone:
      description: Customer's landline or fixed-line number.
      type: string
      example: 23467278
    mobile:
      description: Customer's mobile phone number.
      type: string
      example: 938237475
    department:
      description: Customer's department.
      type: string
      example: Marketing
    designation:
      description: Customer's designation.
      type: string
      example: Evangelist
    tax_specification:
      description: Tax specification for the customer.
      type: string
      example: inter
      x-node_available_in:
        - India GST
      x-node_unavailable_in: []
    gst_no:
      description: GSTIN Number for the customer.
      type: string
      example: 33AAAAA0000A1Z5
      x-node_available_in:
        - India GST
      x-node_unavailable_in: []
    gst_treatment:
      description: 'GST Treatment for the customer.<br>Allowed values for <strong><code>gst_treatment</code></strong> : <br><code>business_gst</code>, <code>business_none</code>, <code>consumer</code>, <code>overseas</code><br> <code>business_gst</code> - For a GST Registered business owner. <br><code>business_none</code> - For a GST unregistered business owner. <br><code>consumer</code> - For a consumer. <br><code>overseas</code> - Customer for whom you export your goods/services.'
      type: string
      example: business_gst
      x-node_available_in:
        - India GST
      x-node_unavailable_in: []
    cfdi_usage:
      description: Choose CFDI Usage. Allowed values:</br><code>acquisition_of_merchandise</code>, <code>return_discount_bonus</code>, <code>general_expense</code>, <code>buildings</code>, <code>furniture_office_equipment</code>, <code>transport_equipment</code>, <code>computer_equipmentdye_molds_tools</code>, <code>telephone_communication</code>, <code>satellite_communication</code>, <code>other_machinery_equipment</code>, <code>hospital_expense</code>, <code>medical_expense_disability</code>, <code>funeral_expense</code>, <code>donation</code>, <code>interest_mortage_loans</code>, <code>contribution_sar</code>, <code>medical_expense_insurance_pormium</code>, <code>school_transportation_expense</code>, <code>deposit_saving_account</code>, <code>payment_educational_service</code>, <code>no_tax_effect</code>, <code>payment</code>, <code>payroll</code>.
      type: string
      example: acquisition_of_merchandise
      x-node_available_in:
        - mx
      x-node_unavailable_in: []
    zcrm_account_id:
      description: This is the Zoho CRM account id of the customer if the customer is synced with the accounts in Zoho CRM.
      type: string
      example: '9030000000069001'
    zcrm_contact_id:
      description: This is the Zoho CRM contact id of the customer if the customer is synced with the contacts in Zoho CRM.
      type: string
      example: '9030000000098214'
    website:
      description: Customer's website if any.
      type: string
      example: www.bowmanfurniture.com
    attention:
      description: Attention of the customer's billing address.
      type: string
      example: Benjamin George
    street:
      description: Street of the customer's billing address.
      type: string
      example: Harrington Bay Street
    city:
      description: City of the customer's billing address.
      type: string
      example: Salt Lake City
    state:
      description: State of the customer's billing address.
      type: string
      example: CA
    zip:
      description: Zip code of the customer's billing address.
      type: string
      example: '92612'
    country:
      description: Country name.
      type: string
      example: U.S.A
    fax:
      description: Fax number of the customer's billing address.
      type: string
      example: '4527389'
    billing_address:
      description: Customer's billing address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
      type: object
      properties:
        attention:
          $ref: '#/components/schemas/attention'
        street:
          $ref: '#/components/schemas/street'
        city:
          $ref: '#/components/schemas/city'
        state:
          $ref: '#/components/schemas/state'
        country:
          $ref: '#/components/schemas/country'
        zip:
          $ref: '#/components/schemas/zip'
        fax:
          $ref: '#/components/schemas/fax'
    shipping_address:
      description: Customer's shipping address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
      type: object
      properties:
        attention:
          description: Attention of the customer's shipping address.
          type: string
          example: Benjamin George
        street:
          description: Street of the customer's shipping address.
          type: string
          example: Harrington Bay Street
        city:
          description: City of the customer's shipping address.
          type: string
          example: Salt Lake City
        state:
          description: State of the customer's shipping address.
          type: string
          example: CA
        country:
          description: Country name.
          type: string
          example: U.S.A
        zip:
          description: Zip code of the customer's shipping address.
          type: string
          example: '92612'
        fax:
          description: Fax number of the customer's shipping address.
          type: string
          example: '4527389'
    contactpersons:
      description: List of contact person objects. Each object contains <code>contactperson_id</code> and <code>email</code>.
      type: array
      items:
        type: object
        properties:
          contactperson_id:
            $ref: '#/components/schemas/contactperson_id'
          email:
            description: Email ID of the contact person.
          phone:
            description: Contactperson's landline or fixed-line number.
          mobile:
            description: Contactperson's mobile phone number.
          zcrm_contact_id:
            description: This is the Zoho CRM contact id of the contactperson if the contactperson is synced with the contacts in Zoho CRM.
    contactperson_id:
      description: Contact person ID of the customer's contact person.
      type: string
      example: '903000000000099'
    amount:
      description: The amount that needs to be charged for the subscription.
      type: number
      format: double
      example: 186
    product_id:
      description: Product ID of the product to which the plan is associated with.
      type: string
      example: '9030000079065'
    product_name:
      description: Name of the product which the plan belongs to.
      type: string
      example: Bowman Furniture
    plan:
      description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
      type: object
      properties:
        plan_code:
          $ref: '#/components/schemas/plan_code'
        name:
          $ref: '#/components/schemas/name'
        quantity:
          $ref: '#/components/schemas/quantity'
        price:
          $ref: '#/components/schemas/price'
        tags:
          $ref: '#/components/schemas/tags'
        discount:
          $ref: '#/components/schemas/discount'
        sub_total:
          $ref: '#/components/schemas/sub_total'
        setup_fee:
          $ref: '#/components/schemas/setup_fee'
        description:
          $ref: '#/components/schemas/description'
        tax_id:
          $ref: '#/components/schemas/tax_id'
        exclude_trial:
          $ref: '#/components/schemas/exclude_trial'
        exclude_setup_fee:
          $ref: '#/components/schemas/exclude_setup_fee'
        trial_days:
          $ref: '#/components/schemas/trial_days'
    plan_name:
      description: Name of the plan.
      type: string
      example: Basic Monthly
    plan_description:
      description: Description of the plan exclusive to this subscription. This will be displayed in place of the plan name in invoices generated for this subscription.
      type: string
      example: Monthly Basic plan
    plan_code:
      description: Plan code of the plan that is to be subscribed to the customer.
      type: string
      example: basic-monthly
    quantity:
      description: Required quantity of the chosen plan.
      type: integer
      example: 1
    tags:
      type: array
      items:
        type: object
        properties:
          tag_id:
            $ref: '#/components/schemas/tag_id'
          tag_option_id:
            $ref: '#/components/schemas/tag_option_id'
    tag_id:
      description: ID of the Tag
      type: integer
      format: int64
    tag_option_id:
      description: Id of the Tag Option
      type: integer
      format: int64
    item_custom_fields:
      description: Custom fields for a item.
      type: array
      items:
        type: object
        properties:
          label:
            $ref: '#/components/schemas/label'
          value:
            $ref: '#/components/schemas/value'
    label:
      description: Label of the Custom Field
      type: string
    value:
      description: Value of the Custom Field
      type: string
    price:
      description: Price of a plan for a particular subscription. If a value is provided here, the plan's price for this subscription will be changed to the given value. If no value is provided, the plan's price would be the same as what it was when it was created.
      type: number
      format: double
      example: 20
    description:
      description: Description of the plan exclusive to this subscription. This will be displayed in place of the plan name in invoices generated for this subscription.
      type: string
      example: Monthly Basic plan.
    billing_cycles:
      description: <code>billing_cycles</code> specified at the time of creation of the plan would be the default value. If this needs to be overridden for this particular subscription, a value can be provided here.
      type: integer
      example: -1
    exclude_trial:
      description: This is set to true if the respective plan's trial period needs to be excluded for this subscription.
      type: boolean
      example: false
    exclude_setup_fee:
      description: This is set to true if the respective plan's setup fee needs to be excluded for this subscription.
      type: boolean
      example: false
    trial_days:
      description: Number of free trial days granted to a customer subscribed to this plan. Trial days for the subscription mentioned here will override the number of trial days provided at the time plan creation. This will be applicable even if exclude_trial=true.
      type: integer
      example: 0
      default: 0 only if <code>exclude_trial</code> is true
    tax_id:
      description: Unique ID of the tax or tax group that can be collected from the contact. Tax can be given only if <code>is_taxable</code> is <code>true</code>.
      type: string
      example: '90300000023123'
    setup_fee_tax_id:
      description: Unique ID for tax of setup fee. <code>setup_fee_tax_id</code> must be empty for applying tax Exemption.
      type: string
      example: '9030000123123'
    setup_fee_tax_exemption_id:
      description: Unique Tax Exemption ID that must be applied to setup fee.
      type: string
      example: '9030000123098'
      x-node_available_in:
        - Sales Tax
        - GST
      x-node_unavailable_in: []
    setup_fee_tax_exemption_code:
      description: Unique code of the tax exemption that must be applied to setup fee.
      type: string
      example: GST FREE
      x-node_available_in:
        - Sales Tax
        - GST
      x-node_unavailable_in: []
    discount:
      description: Discount amount applied for the plan.
      type: number
      format: double
      example: 20
    total:
      description: Total amount for the plan.
      type: number
      format: double
      example: 50
    setup_fee:
      description: Setup fee for the plan.
      type: number
      format: double
      example: 20
      default: 0 only if <code>exclude_setup_fee</code>  is true
    addons:
      description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
      type: array
      items:
        type: object
        properties:
          addon_code:
            $ref: '#/components/schemas/addon_code'
          name:
            description: Name of the addon.
            example: Monthly Addon
          description:
            $ref: '#/components/schemas/description'
          quantity:
            description: Required quantity of the chosen addon.
            type: integer
            example: 1
            default: 1
          tags:
            type: array
            items:
              type: object
              properties:
                tag_id:
                  $ref: '#/components/schemas/tag_id'
                tag_option_id:
                  $ref: '#/components/schemas/tag_option_id'
          item_custom_fields:
            description: Custom fields for a item.
            type: array
            items:
              type: object
              properties:
                label:
                  $ref: '#/components/schemas/label'
                value:
                  $ref: '#/components/schemas/value'
          price:
            description: A value can be provided here if the per unit addon price has to be overridden for this subscription.
            type: number
            format: double
            example: 0
            default: the price of the addon.
          discount:
            description: Discount applied for the addon.
          total:
            description: Total amount for the addon.
          tax_id:
            description: Unique ID of the tax applied for the addon.
    addon_code:
      description: Addon code of the addon.
      type: string
      example: Email-basic
    addon_description:
      description: Description of the addon exclusive to this subscription. This will be displayed in place of the addon name in invoices generated for this subscription.
      type: string
      example: Monthly addon.
    taxes:
      description: Details of the taxes associated with the subscription.
      type: array
      items:
        type: string
    payment_terms:
      description: Payment Due details for the invoices.
      type: integer
      example: 0
    payment_terms_label:
      description: Label for the paymet due details.
      type: string
      example: Due On Receipt
    can_add_bank_account:
      description: Set to true if Bank account can be added for the customer to perform ACH transactions.
      type: boolean
      example: true
    coupon_code:
      description: The coupon code of the coupon which is to be applied to the subscription.
      type: string
      example: Flat10
    coupon:
      description: The object containing the details of the added coupon. <code>coupon_code</code> and <code>discount_amount</code> applied to the invoice total.
      type: object
      properties:
        coupon_code:
          $ref: '#/components/schemas/coupon_code'
        discount_amount:
          $ref: '#/components/schemas/discount_amount'
    discount_amount:
      description: The discount amount included in an invoice on applying a coupon.
      type: number
      format: double
      example: 44
    reference_id:
      description: A string of your choice is required to easily identify and keep track of your subscriptions.
      type: string
      example: bowmanfurniture
    salesperson_id:
      description: Unique Id of the sales person assigned for the subscription.
      type: string
      example: '9877000000058001'
    salesperson_name:
      description: Name of tha sales person assigned for the subscription.
      type: string
      example: Franklin
    can_charge_setup_fee_immediately:
      description: If set to "true", a separate invoice will be raised for the setup fee as soon as the subscription's trial period starts. Set the value as "false", or remove this optional argument if you want the setup fee to be billed at the end of the trial period, along with the other subscription related charges.
      type: boolean
      example: false
    end_of_term:
      description: If there are any changes in the plan's subscriptions, those subscription changes can be made immediately if <code>end_of_term</code> is set to false. If <code>end_of_term</code> is set to true, the subscription changes take effect only after the current term of the subscription ends.
      type: boolean
      example: false
    exchange_rate:
      description: This will be the exchange rate provided for the organization's currency and the customer's currency. The subscription fee would be the multiplicative product of the original price and the exchange rate.
      type: number
      format: double
      example: 2
      default: the exchange rate provided in settings.
    starts_at:
      description: Generally the subscription will start on the day it is created. But, the date can also be a future  or past date depending upon your usecase. For future dates, the subscription status would be Future till the starts_at date. And for past dates, the subscription status can be Trial, Live or Expired depending on the subscription interval that you have selected.
      type: string
      example: '2016-06-05'
    card_id:
      description: Card ID of the card from which payment is about to made by the customer.
      type: string
      example: '90300000766098'
    card_id_edit:
      description: Card number associated to the customer.
      type: string
      example: '260400000102'
      x-node_available_in:
        - for card change
    account_id_edit:
      description: Bank account number associated to the customer for ACH payments.
      type: string
      example: '410200001308'
      x-node_available_in:
        - for ACH change
    paypal_id_edit:
      description: PayPal account number associated to the customer.
      type: string
      example: '300200001806'
      x-node_available_in:
        - for paypal change
    card:
      description: Customer's card object. This contains <code>payment_gateway</code>, <code>last_four_digits</code>, <code>expiry_month</code> and <code>expiry_year</code>.
      type: object
      properties:
        card_id:
          description: Customer's card ID.
          example: '90300000079226'
        last_four_digits:
          $ref: '#/components/schemas/last_four_digits'
        payment_gateway:
          $ref: '#/components/schemas/payment_gateway'
        expiry_month:
          $ref: '#/components/schemas/expiry_month'
        expiry_year:
          $ref: '#/components/schemas/expiry_year'
    payment_gateway:
      description: Payment gateway through which payment needs to be made.
      type: string
      example: payflow_pro
    last_four_digits:
      description: Last four digits of the customer's card.
      type: integer
      example: '2145'
    card_number:
      description: Customer's card number.
      type: string
      example: 4111111111112145
    cvv_number:
      description: CVV number of the customer's card.
      type: integer
      example: 234
    expiry_month:
      description: Expiry month of the customer's card.
      type: integer
      example: 9
    expiry_year:
      description: Expiry year of the customer's card.
      type: integer
      example: 2030
    child_invoice_id:
      description: Invoice ID of the most recent invoice to which the subscription is associated with.
      type: string
      example: '90300000079210'
    place_of_supply:
      description: Place of Supply for the customer's subscription.
      type: string
      example: TN
      x-node_available_in:
        - India GST
      x-node_unavailable_in: []
    pricebook_id:
      description: Unique ID of of pricebook.
      type: string
      example: '90300000070987'
    sub_total:
      description: Subtotal for the subscription without including taxes.
      type: number
      format: double
      example: 40
    interval:
      description: Indicates the number of intervals between each billing. If interval=2, the customer would be billed every two months or years depending on the value for interval_unit.
      type: string
      example: 1
    interval_unit:
      description: It can be either <code>months</code> or <code>years</code>. For interval=2 and interval_unit=months, the customer is billed every two months.
      type: string
      example: months
    current_term_starts_at:
      description: Date on which the current term of the subscription started.
      type: string
      example: '2016-06-01'
    current_term_ends_at:
      description: Date on which the current term of the subscription ends.
      type: string
      example: '2016-06-30'
    expires_at:
      description: This is applicable only when <code>billing_cycle</code> is set for a plan. A subscription expires on the last day of the last billing cycle.
      type: string
      example: '2015-06-01'
    last_billing_at:
      description: The date on which the customer was billed last.
      type: string
      example: '2016-06-01'
    next_billing_at:
      description: The date on which the customer will be billed next. This will also be the date on which the next term of the subscription starts.
      type: string
      example: '2016-06-30'
    cancelled_at:
      description: The date on which a subscription is cancelled. Customers can cancel a subscription themselves. It can also be cancelled if a customer's card couldn't be charged even after multiple attempts.
      type: string
      example: ''
    source:
      description: This is applicable only when a subscription is cancelled. It is set to <code>user</code> when customers cancel the subscription themselves. It is set to <code>scheduler</code> if it gets cancelled by the customer due to payment failures during renewal.
      type: string
      example: ''
    next_retry_at:
      description: If payment fails at the time of renewing a subscription, there will be another attempt made to process at a later *date* which is to be specified here.
      type: string
      example: ''
    notes:
      description: List of objects containing <code>note_id</code>, <code>description</code>, <code>commented_by</code> and <code>commented_time</code>
      type: array
      items:
        type: object
        properties:
          note_id:
            $ref: '#/components/schemas/note_id'
          description:
            description: Comments about the subscription made by the user.
          commented_by:
            $ref: '#/components/schemas/commented_by'
          commented_time:
            $ref: '#/components/schemas/commented_time'
    note_id:
      description: Unique ID generated for a note.
      type: string
      example: '90300006700232'
    commented_by:
      description: Name of the user who added the comment.
      type: string
      example: Benjamin
    commented_time:
      description: Time at which the comment was added.
      type: string
      example: 2016-06-11T17:57:13-0700
    updated_time:
      description: Time at which the subscription details were last updated.
      type: string
      example: 2016-07-04T16:44:15-0700
    renewal_at:
      description: Renewal date of the subscription.
      type: string
      example: true
    created_at:
      description: Date at which the subscription was created.
      type: string
      example: '2016-06-05'
    updated_at:
      description: Date at which the subscription was last updated.
      type: string
      example: '2016-06-06'
    activated_at:
      description: Date at which the subscription was activated.
      type: string
      example: '2016-06-05'
    payment_gateways:
      description: List of payment gateways configured for the customer.
      type: array
      items:
        type: object
        properties:
          payment_gateway:
            $ref: '#/components/schemas/payment_gateway'
    custom_fields:
      description: Additional fields for the Hosted pages.
      type: array
      items:
        type: object
        properties:
          label:
            $ref: '#/components/schemas/label'
          value:
            $ref: '#/components/schemas/value'
    index:
      description: Index of the custom field. It can hold any value from 1 to 10.
      type: integer
      example: 1
    data_type:
      description: Data type of the custom field
      type: string
      example: string
    show_in_all_pdf:
      description: Set to true if it must be displayed in pdf.
      type: string
      example: true
    customfield_id:
      description: Unique ID of custom field
      type: string
      example: '90300003002765'
    is_mandatory:
      description: Set to true if custom field is mandatory.
      type: string
      example: true
    is_active:
      description: True if the custom field is true
      type: string
      example: true
    ach_supported:
      description: Set to true if ACH payments is supported for the subscription.
      type: boolean
      example: true
    comments:
      description: Lists the comments added by the system or by user.
      type: array
      items:
        type: object
        properties:
          comment_id:
            $ref: '#/components/schemas/comment_id'
          description:
            description: Small description about the comment.
            example: Invoice has been marked as void
          commented_by_id:
            $ref: '#/components/schemas/commented_by_id'
          commented_by:
            $ref: '#/components/schemas/commented_by'
          comment_type:
            $ref: '#/components/schemas/comment_type'
          date:
            description: Date on which the comment was created.
          time:
            $ref: '#/components/schemas/time'
          operation_type:
            $ref: '#/components/schemas/operation_type'
          transaction_id:
            $ref: '#/components/schemas/transaction_id'
          transaction_type:
            description: Small description about the type of transaction.
            example: invoice
    comment_id:
      description: Unique Id to denote the comment fro the particular invoice.
      type: string
      example: '90300000003133'
    commented_by_id:
      description: Unique Id to denote who has commented.
      type: string
      example: '90300003002099'
    comment_type:
      description: It denotes whether user comment or system comment.
      type: string
      example: system
    reference_number:
      description: Reference number of the invoice for which payment is made.
      type: string
      example: INV-384
    payments:
      description: List of payment objects. Each object will contain <code>payment_id</code>, <code>payment_mode</code>, <code>invoice_payment_id</code>, <code>gateway_transaction_id</code>, <code>description</code>, <code>date</code>, <code>reference_number</code> and <code>amount</code>.
      type: array
      items:
        type: object
        properties:
          payment_id:
            $ref: '#/components/schemas/payment_id'
          payment_mode:
            $ref: '#/components/schemas/payment_mode'
          invoice_payment_id:
            $ref: '#/components/schemas/invoice_payment_id'
          gateway_transaction_id:
            $ref: '#/components/schemas/gateway_transaction_id'
          description:
            $ref: '#/components/schemas/description'
          date:
            $ref: '#/components/schemas/date'
          reference_number:
            $ref: '#/components/schemas/reference_number'
          amount:
            description: Total amount of the payment made.
          exchange_rate:
            $ref: '#/components/schemas/exchange_rate'
    payment_id:
      description: The payment ID of the payment made for the invoice.
      type: string
      example: '9030000079467'
    payment_mode:
      description: The mode in which payment is made for the invoice. This can be <code>check</code>, <code>cash</code>, <code>creditcard</code>, <code>banktransfer</code>, <code>bankremittance</code>, <code>autotransaction</code> or <code>others</code>.
      type: string
      example: autotransaction
    invoice_payment_id:
      description: Unique ID generated for an instalment of payment made for a particular invoice.
      type: string
      example: '90300000079469'
    gateway_transaction_id:
      description: Gateway transaction ID provided for the payment made to the invoice. This is applicable only if <code>payment_mode</code> is autotransaction.
      type: string
      example: B10E6E0F31BD
    invoice_items:
      description: The list of items which are all included in the invoice. Each item object will have <code>item_id</code>, <code>name</code>, <code>code</code>, <code>price</code>, <code>quantity</code> and <code>item_total</code>.
      type: array
      items:
        type: object
        properties:
          item_id:
            $ref: '#/components/schemas/item_id'
          name:
            description: Name which denotes the invoice.
            example: INV-384
          description:
            description: Small description about the Invoice item.
            example: Charges for this duration (from 16-April-2016 to 8-June-2016)
          code:
            $ref: '#/components/schemas/code'
          price:
            $ref: '#/components/schemas/price'
          quantity:
            $ref: '#/components/schemas/quantity'
          discount_amount:
            $ref: '#/components/schemas/discount_amount'
          item_total:
            $ref: '#/components/schemas/item_total'
          tax_id:
            $ref: '#/components/schemas/tax_id'
          tax_exemption_id:
            $ref: '#/components/schemas/tax_exemption_id'
          tax_exemption_code:
            $ref: '#/components/schemas/tax_exemption_code'
    item_id:
      description: The ID of the item included in the invoice.
      type: string
      example: '90300000079434'
    item_total:
      description: Cost of an item included in the invoice. This would be the product of quantity of the item included and the price of that item.
      type: integer
      example: 400
    invoice_id:
      description: Unique ID generated for an invoice.
      type: string
      example: '90300000079426'
    number:
      description: Unique number generated for the invoice.
      type: string
      example: INV-384
    invoice_date:
      description: Date in which the invoice was generated.
      type: string
      example: '2016-06-15'
    due_date:
      description: Date on which the payment is due for the invoice.
      type: string
      example: '2016-06-15'
    payment_expected_date:
      description: A date to specify the expected payment date.
      type: string
      example: 10-05-2013
    ach_payment_initiated:
      description: Set to true if ACH payment is initiated.
      type: boolean
      example: true
    payment_made:
      description: Payments can be made in multiple instalments. payment_made refers to the amount paid for the invoice in the respective instalment.
      type: number
      format: double
      example: 370
    balance:
      description: The unpaid amount of an invoice.
      type: number
      format: double
      example: 0
    credits_applied:
      description: Credits applied for the invoice.
      type: number
      format: double
      example: 0
    write_off_amount:
      description: The unpaid amount of an invoice that is written off.
      type: number
      format: double
      example: 0
    transaction_type:
      description: Small description about the type of transaction.
      type: string
      example: invoice
    date:
      description: Date at which the comment was commented.
      type: string
      example: '2016-06-05'
    time:
      description: Time at which the comment was commented.
      type: string
      example: 2016-06-11T17:57:13-0700
    operation_type:
      description: Type of operation performed on the invoice.
      type: string
      example: add
    transaction_id:
      description: Unique ID to denote the transaction.
      type: string
      example: '90300000079467'
    data:
      description: Returned data for the HostedPages
      type: object
      properties:
        subscription:
          description: details about the subscription
          type: object
          properties:
            subscription_id:
              $ref: '#/components/schemas/subscription_id'
            name:
              $ref: '#/components/schemas/name'
            status:
              $ref: '#/components/schemas/status'
            amount:
              $ref: '#/components/schemas/amount'
            created_at:
              $ref: '#/components/schemas/created_at'
            current_term_ends_at:
              $ref: '#/components/schemas/current_term_ends_at'
            last_billing_at:
              $ref: '#/components/schemas/last_billing_at'
            next_billing_at:
              $ref: '#/components/schemas/next_billing_at'
            expires_at:
              $ref: '#/components/schemas/expires_at'
            interval:
              $ref: '#/components/schemas/interval'
            interval_unit:
              $ref: '#/components/schemas/interval_unit'
            created_time:
              $ref: '#/components/schemas/created_time'
            updated_time:
              $ref: '#/components/schemas/updated_time'
            reference_id:
              $ref: '#/components/schemas/reference_id'
            salesperson_id:
              $ref: '#/components/schemas/salesperson_id'
            salesperson_name:
              $ref: '#/components/schemas/salesperson_name'
            child_invoice_id:
              $ref: '#/components/schemas/child_invoice_id'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            currency_symbol:
              $ref: '#/components/schemas/currency_symbol'
            end_of_term:
              $ref: '#/components/schemas/end_of_term'
            product_id:
              $ref: '#/components/schemas/product_id'
            product_name:
              $ref: '#/components/schemas/product_name'
            plan:
              description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
              type: object
              properties:
                plan_code:
                  $ref: '#/components/schemas/plan_code'
                name:
                  $ref: '#/components/schemas/name'
                quantity:
                  $ref: '#/components/schemas/quantity'
                price:
                  $ref: '#/components/schemas/price'
                discount:
                  $ref: '#/components/schemas/discount'
                total:
                  $ref: '#/components/schemas/total'
                setup_fee:
                  $ref: '#/components/schemas/setup_fee'
                description:
                  $ref: '#/components/schemas/description'
                tax_id:
                  $ref: '#/components/schemas/tax_id'
                exclude_trial:
                  $ref: '#/components/schemas/exclude_trial'
                exclude_setup_fee:
                  $ref: '#/components/schemas/exclude_setup_fee'
                trial_days:
                  $ref: '#/components/schemas/trial_days'
            addons:
              description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
              type: array
              items:
                type: object
                properties:
                  addon_code:
                    $ref: '#/components/schemas/addon_code'
                  name:
                    description: Name of the addon.
                    example: Monthly Addon
                  description:
                    $ref: '#/components/schemas/description'
                  quantity:
                    description: Required quantity of the chosen addon.
                    type: integer
                    example: 1
                  price:
                    description: A value can be provided here if the per unit addon price has to be overridden for this subscription.
                    type: number
                    format: double
                    example: 10
                  discount:
                    description: Discount applied for the addon.
                  total:
                    description: Total amount for the addon.
                  tax_id:
                    description: Unique ID of the tax applied for the addon.
            taxes:
              description: Taxes associated wit the subscription.
              type: array
              items:
                type: object
                properties:
                  tax_id:
                    $ref: '#/components/schemas/tax_id'
                  tax_name:
                    description: Name of the tax to which subscription is associated.
                    type: string
                    example: GST
                  tax_amount:
                    description: Tax amount applied to the subscription.
                    type: string
                    example: '2.50'
            coupon:
              description: The object containing the details of the added coupon. <code>coupon_code</code> and <code>discount_amount</code> applied to the invoice total.
              type: object
              properties:
                coupon_code:
                  $ref: '#/components/schemas/coupon_code'
                discount_amount:
                  $ref: '#/components/schemas/discount_amount'
            card:
              description: Customer's card object. This contains <code>payment_gateway</code>, <code>last_four_digits</code>, <code>expiry_month</code> and <code>expiry_year</code>.
              type: object
              properties:
                card_id:
                  description: Customer's card ID.
                  example: '9030000079226'
                last_four_digits:
                  $ref: '#/components/schemas/last_four_digits'
                payment_gateway:
                  $ref: '#/components/schemas/payment_gateway'
                expiry_month:
                  $ref: '#/components/schemas/expiry_month'
                expiry_year:
                  $ref: '#/components/schemas/expiry_year'
            payment_terms:
              $ref: '#/components/schemas/payment_terms'
            payment_terms_label:
              $ref: '#/components/schemas/payment_terms_label'
            can_add_bank_account:
              $ref: '#/components/schemas/can_add_bank_account'
            customer:
              description: Customer object of the customer for whom you want to create a subscription. Each object contains <code>display_name</code>, <code>company_name</code>, <code>first_name</code>, <code>last_name</code>, <code>email</code>, <code>fax</code>, <code>currency_code</code> and <code>billing_address</code>.
              type: object
              properties:
                customer_id:
                  description: A unique ID generated by the server. This can be used as an identifier.
                  example: '903000000000099'
                display_name:
                  $ref: '#/components/schemas/display_name'
                first_name:
                  $ref: '#/components/schemas/first_name'
                last_name:
                  $ref: '#/components/schemas/last_name'
                email:
                  $ref: '#/components/schemas/email'
                company_name:
                  $ref: '#/components/schemas/company_name'
                billing_address:
                  description: Customer's billing address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
                  type: object
                  properties:
                    street:
                      $ref: '#/components/schemas/street'
                    city:
                      $ref: '#/components/schemas/city'
                    state:
                      $ref: '#/components/schemas/state'
                    country:
                      $ref: '#/components/schemas/country'
                    zip:
                      $ref: '#/components/schemas/zip'
                    fax:
                      $ref: '#/components/schemas/fax'
                shipping_address:
                  $ref: '#/components/schemas/shipping_address'
                payment_terms:
                  $ref: '#/components/schemas/payment_terms'
                payment_terms_label:
                  $ref: '#/components/schemas/payment_terms_label'
            custom_fields:
              description: Additional fields for the Hosted pages.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  label:
                    $ref: '#/components/schemas/label'
                  value:
                    $ref: '#/components/schemas/value'
                  data_type:
                    $ref: '#/components/schemas/data_type'
            contactpersons:
              description: List of contact person objects. Each object contains <code>contactperson_id</code> and <code>email</code>.
              type: array
              items:
                type: object
                properties:
                  contactperson_id:
                    $ref: '#/components/schemas/contactperson_id'
            notes:
              description: List of objects containing <code>note_id</code>, <code>description</code>, <code>commented_by</code> and <code>commented_time</code>
              type: array
              items:
                type: object
                properties:
                  note_id:
                    $ref: '#/components/schemas/note_id'
                  description:
                    description: Comments about the subscription made by the user.
                    type: string
                    example: ''
                  commented_by:
                    $ref: '#/components/schemas/commented_by'
                  commented_time:
                    $ref: '#/components/schemas/commented_time'
            payment_gateways:
              description: List of payment gateways configured for the customer.
              type: array
              items:
                type: object
                properties:
                  payment_gateway:
                    $ref: '#/components/schemas/payment_gateway'
    subscription:
      description: details about the subscription
      type: object
      properties:
        subscription_id:
          $ref: '#/components/schemas/subscription_id'
        name:
          $ref: '#/components/schemas/name'
        status:
          $ref: '#/components/schemas/status'
        amount:
          $ref: '#/components/schemas/amount'
        created_at:
          $ref: '#/components/schemas/created_at'
        current_term_ends_at:
          $ref: '#/components/schemas/current_term_ends_at'
        last_billing_at:
          $ref: '#/components/schemas/last_billing_at'
        next_billing_at:
          $ref: '#/components/schemas/next_billing_at'
        expires_at:
          $ref: '#/components/schemas/expires_at'
        interval:
          $ref: '#/components/schemas/interval'
        interval_unit:
          $ref: '#/components/schemas/interval_unit'
        created_time:
          $ref: '#/components/schemas/created_time'
        updated_time:
          $ref: '#/components/schemas/updated_time'
        reference_id:
          $ref: '#/components/schemas/reference_id'
        salesperson_id:
          $ref: '#/components/schemas/salesperson_id'
        salesperson_name:
          $ref: '#/components/schemas/salesperson_name'
        child_invoice_id:
          $ref: '#/components/schemas/child_invoice_id'
        currency_code:
          $ref: '#/components/schemas/currency_code'
        currency_symbol:
          $ref: '#/components/schemas/currency_symbol'
        end_of_term:
          $ref: '#/components/schemas/end_of_term'
        product_id:
          $ref: '#/components/schemas/product_id'
        product_name:
          $ref: '#/components/schemas/product_name'
        plan:
          description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
          type: object
          properties:
            plan_code:
              $ref: '#/components/schemas/plan_code'
            name:
              $ref: '#/components/schemas/name'
            quantity:
              $ref: '#/components/schemas/quantity'
            price:
              $ref: '#/components/schemas/price'
            discount:
              $ref: '#/components/schemas/discount'
            total:
              $ref: '#/components/schemas/total'
            setup_fee:
              $ref: '#/components/schemas/setup_fee'
            description:
              $ref: '#/components/schemas/description'
            tax_id:
              $ref: '#/components/schemas/tax_id'
            exclude_trial:
              $ref: '#/components/schemas/exclude_trial'
            exclude_setup_fee:
              $ref: '#/components/schemas/exclude_setup_fee'
            trial_days:
              $ref: '#/components/schemas/trial_days'
        addons:
          description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
          type: array
          items:
            type: object
            properties:
              addon_code:
                $ref: '#/components/schemas/addon_code'
              name:
                description: Name of the addon.
                example: Monthly Addon
              description:
                $ref: '#/components/schemas/description'
              quantity:
                description: Required quantity of the chosen addon.
                type: integer
                example: 1
              price:
                description: A value can be provided here if the per unit addon price has to be overridden for this subscription.
                type: number
                format: double
                example: 10
              discount:
                description: Discount applied for the addon.
              total:
                description: Total amount for the addon.
              tax_id:
                description: Unique ID of the tax applied for the addon.
        taxes:
          $ref: '#/components/schemas/taxes'
        coupon:
          description: The object containing the details of the added coupon. <code>coupon_code</code> and <code>discount_amount</code> applied to the invoice total.
          type: object
          properties:
            coupon_code:
              $ref: '#/components/schemas/coupon_code'
            discount_amount:
              $ref: '#/components/schemas/discount_amount'
        card:
          description: Customer's card object. This contains <code>payment_gateway</code>, <code>last_four_digits</code>, <code>expiry_month</code> and <code>expiry_year</code>.
          type: object
          properties:
            card_id:
              description: Customer's card ID.
              example: '90300000079226'
            last_four_digits:
              $ref: '#/components/schemas/last_four_digits'
            payment_gateway:
              $ref: '#/components/schemas/payment_gateway'
            expiry_month:
              $ref: '#/components/schemas/expiry_month'
            expiry_year:
              $ref: '#/components/schemas/expiry_year'
        payment_terms:
          $ref: '#/components/schemas/payment_terms'
        payment_terms_label:
          $ref: '#/components/schemas/payment_terms_label'
        can_add_bank_account:
          $ref: '#/components/schemas/can_add_bank_account'
        customer:
          description: Customer object of the customer for whom you want to create a subscription. Each object contains <code>display_name</code>, <code>company_name</code>, <code>first_name</code>, <code>last_name</code>, <code>email</code>, <code>fax</code>, <code>currency_code</code> and <code>billing_address</code>.
          type: object
          properties:
            customer_id:
              description: A unique ID generated by the server. This can be used as an identifier.
              example: '903000000000099'
            display_name:
              $ref: '#/components/schemas/display_name'
            first_name:
              $ref: '#/components/schemas/first_name'
            last_name:
              $ref: '#/components/schemas/last_name'
            email:
              $ref: '#/components/schemas/email'
            company_name:
              $ref: '#/components/schemas/company_name'
            billing_address:
              description: Customer's billing address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
              type: object
              properties:
                street:
                  $ref: '#/components/schemas/street'
                city:
                  $ref: '#/components/schemas/city'
                state:
                  $ref: '#/components/schemas/state'
                country:
                  $ref: '#/components/schemas/country'
                zip:
                  $ref: '#/components/schemas/zip'
                fax:
                  $ref: '#/components/schemas/fax'
            shipping_address:
              $ref: '#/components/schemas/shipping_address'
            payment_terms:
              $ref: '#/components/schemas/payment_terms'
            payment_terms_label:
              $ref: '#/components/schemas/payment_terms_label'
        custom_fields:
          description: Additional fields for the Hosted pages.
          type: array
          items:
            type: object
            properties:
              index:
                $ref: '#/components/schemas/index'
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
              data_type:
                $ref: '#/components/schemas/data_type'
        contactpersons:
          description: List of contact person objects. Each object contains <code>contactperson_id</code> and <code>email</code>.
          type: array
          items:
            type: object
            properties:
              contactperson_id:
                $ref: '#/components/schemas/contactperson_id'
        notes:
          description: List of objects containing <code>note_id</code>, <code>description</code>, <code>commented_by</code> and <code>commented_time</code>
          type: array
          items:
            type: object
            properties:
              note_id:
                $ref: '#/components/schemas/note_id'
              description:
                description: Comments about the subscription made by the user.
                type: string
                example: ''
              commented_by:
                $ref: '#/components/schemas/commented_by'
              commented_time:
                $ref: '#/components/schemas/commented_time'
        payment_gateways:
          description: List of payment gateways configured for the customer.
          type: array
          items:
            type: object
            properties:
              payment_gateway:
                $ref: '#/components/schemas/payment_gateway'
    default_templates:
      description: Default templates associated with the customer.
      type: object
    invoice_template_id:
      description: Unique Id used to denote the invoice template.
      type: string
      example: '90300000311340'
    creditnote_template_id:
      description: Unique Id used to denote the credit note template.
      type: string
      example: '90300000232140'
    template_id:
      description: Unique Id used to denote the invoice template.
      type: integer
      format: int64
      example: 90300000311340
    vat_reg_no:
      description: VAT Registration number of a contact with VAT treatment as <code>eu_vat_registered</code>. Length should be between 2 and 12 characters. (This node is only available for EU VAT registered  customers.)
      type: string
      example: 51423456782
      x-node_available_in:
        - VAT
      x-node_unavailable_in: []
    country_code:
      description: Two letter country code of a contact with VAT treatment as <code>eu_vat_registered</code>. (This node is only available for EU VAT registered  customers.)
      type: string
      example: DE
      x-node_available_in:
        - VAT
      x-node_unavailable_in: []
    vat_treatment:
      description: VAT treatment for the credit-note. VAT treatment denotes the location of the customer, if the customer resides in UK then the VAT treatment is `uk`. If the customer is in a EU country & if he is VAT registered then his VAT treatment is `eu_vat_registered`, if he resides in EU & if he is not VAT registered then his VAT treatment is `eu_vat_not_registered` and if he resides outside the EU then his VAT treatment is `non_eu`.
      type: string
      example: non_eu
      x-node_available_in:
        - VAT
      x-node_unavailable_in: []
    product_type:
      description: Product type for UK Edition.
      type: string
      example: goods
      x-node_available_in:
        - VAT
      x-node_unavailable_in: []
    tax_authority_id:
      description: Unique ID of the tax authority. Tax authority depends on the location of the customer. For example, if the customer is located in NY, then the tax authority is NY tax authority.
      type: string
      example: '903000006345'
      x-node_available_in:
        - Sales Tax
      x-node_unavailable_in: []
    tax_authority_name:
      description: Unique name of the tax authority.
      type: string
      example: ATO
      x-node_available_in:
        - Sales Tax
      x-node_unavailable_in: []
    tax_exemption_id:
      description: Unique ID of the tax exemption.
      type: string
      example: '903000006345'
      x-node_available_in:
        - Sales Tax
        - GST
      x-node_unavailable_in: []
    tax_exemption_code:
      description: Unique code of the tax exemption.
      type: string
      example: GST FREE
      x-node_available_in:
        - Sales Tax
        - GST
      x-node_unavailable_in: []
    is_taxable:
      description: Set to true if customer's transactions must be tax inclusive.
      type: string
      example: true
      x-node_available_in:
        - Sales Tax
        - GST
      x-node_unavailable_in: []
    retrieve-a-hosted-page-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        hostedpage_id:
          $ref: '#/components/schemas/hostedpage_id'
        status:
          $ref: '#/components/schemas/status'
        url:
          $ref: '#/components/schemas/url'
        action:
          $ref: '#/components/schemas/action'
        expiring_time:
          $ref: '#/components/schemas/expiring_time'
        created_time:
          $ref: '#/components/schemas/created_time'
        custom_fields:
          description: Additional fields for the Hosted pages.
          type: array
          items:
            type: object
            properties:
              index:
                $ref: '#/components/schemas/index'
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
              data_type:
                $ref: '#/components/schemas/data_type'
        data:
          description: data
          type: object
          properties:
            subscription:
              description: details about the subscription
              type: object
              properties:
                subscription_id:
                  $ref: '#/components/schemas/subscription_id'
                name:
                  $ref: '#/components/schemas/name'
                status:
                  $ref: '#/components/schemas/status'
                amount:
                  $ref: '#/components/schemas/amount'
                created_at:
                  $ref: '#/components/schemas/created_at'
                current_term_starts_at:
                  $ref: '#/components/schemas/current_term_starts_at'
                current_term_ends_at:
                  $ref: '#/components/schemas/current_term_ends_at'
                next_billing_at:
                  $ref: '#/components/schemas/next_billing_at'
                expires_at:
                  $ref: '#/components/schemas/expires_at'
                interval:
                  $ref: '#/components/schemas/interval'
                interval_unit:
                  $ref: '#/components/schemas/interval_unit'
                created_time:
                  $ref: '#/components/schemas/created_time'
                updated_time:
                  $ref: '#/components/schemas/updated_time'
                reference_id:
                  $ref: '#/components/schemas/reference_id'
                salesperson_id:
                  $ref: '#/components/schemas/salesperson_id'
                salesperson_name:
                  $ref: '#/components/schemas/salesperson_name'
                child_invoice_id:
                  $ref: '#/components/schemas/child_invoice_id'
                pricebook_id:
                  $ref: '#/components/schemas/pricebook_id'
                currency_code:
                  $ref: '#/components/schemas/currency_code'
                currency_symbol:
                  $ref: '#/components/schemas/currency_symbol'
                end_of_term:
                  $ref: '#/components/schemas/end_of_term'
                product_id:
                  $ref: '#/components/schemas/product_id'
                product_name:
                  $ref: '#/components/schemas/product_name'
                plan:
                  description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
                  type: object
                  properties:
                    plan_code:
                      $ref: '#/components/schemas/plan_code'
                    name:
                      $ref: '#/components/schemas/name'
                    quantity:
                      $ref: '#/components/schemas/quantity'
                    price:
                      $ref: '#/components/schemas/price'
                    tags:
                      $ref: '#/components/schemas/tags'
                    item_custom_fields:
                      $ref: '#/components/schemas/item_custom_fields'
                    discount:
                      $ref: '#/components/schemas/discount'
                    total:
                      $ref: '#/components/schemas/total'
                    setup_fee:
                      $ref: '#/components/schemas/setup_fee'
                    description:
                      $ref: '#/components/schemas/description'
                    tax_id:
                      $ref: '#/components/schemas/tax_id'
                addons:
                  description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
                  type: array
                  items:
                    type: object
                    properties:
                      addon_code:
                        $ref: '#/components/schemas/addon_code'
                      name:
                        description: Name of the addon.
                        example: Monthly Addon
                      description:
                        $ref: '#/components/schemas/description'
                      quantity:
                        description: Required quantity of the chosen addon.
                        type: integer
                        example: 1
                      tags:
                        $ref: '#/components/schemas/tags'
                      item_custom_fields:
                        $ref: '#/components/schemas/item_custom_fields'
                      price:
                        description: A value can be provided here if the per unit addon price has to be overridden for this subscription.
                        type: number
                        format: double
                        example: 10
                      discount:
                        description: Discount applied for the addon.
                      total:
                        description: Total amount for the addon.
                      tax_id:
                        description: Unique ID of the tax applied for the addon.
                taxes:
                  $ref: '#/components/schemas/taxes'
                coupon:
                  description: The object containing the details of the added coupon. <code>coupon_code</code> and <code>discount_amount</code> applied to the invoice total.
                  type: object
                  properties:
                    coupon_code:
                      $ref: '#/components/schemas/coupon_code'
                    discount_amount:
                      $ref: '#/components/schemas/discount_amount'
                card:
                  description: Customer's card object. This contains <code>payment_gateway</code>, <code>last_four_digits</code>, <code>expiry_month</code> and <code>expiry_year</code>.
                  type: object
                  properties:
                    card_id:
                      description: Customer's card ID.
                      example: '9030000079226'
                    last_four_digits:
                      $ref: '#/components/schemas/last_four_digits'
                    payment_gateway:
                      $ref: '#/components/schemas/payment_gateway'
                    expiry_month:
                      $ref: '#/components/schemas/expiry_month'
                    expiry_year:
                      $ref: '#/components/schemas/expiry_year'
                payment_terms:
                  $ref: '#/components/schemas/payment_terms'
                payment_terms_label:
                  $ref: '#/components/schemas/payment_terms_label'
                can_add_bank_account:
                  $ref: '#/components/schemas/can_add_bank_account'
                customer:
                  description: Customer object of the customer for whom you want to create a subscription. Each object contains <code>display_name</code>, <code>company_name</code>, <code>first_name</code>, <code>last_name</code>, <code>email</code>, <code>fax</code>, <code>currency_code</code> and <code>billing_address</code>.
                  type: object
                  properties:
                    customer_id:
                      description: A unique ID generated by the server. This can be used as an identifier.
                      example: '903000000000099'
                    display_name:
                      $ref: '#/components/schemas/display_name'
                    first_name:
                      $ref: '#/components/schemas/first_name'
                    last_name:
                      $ref: '#/components/schemas/last_name'
                    email:
                      $ref: '#/components/schemas/email'
                    company_name:
                      $ref: '#/components/schemas/company_name'
                    billing_address:
                      description: Customer's billing address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
                      type: object
                      properties:
                        street:
                          $ref: '#/components/schemas/street'
                        city:
                          $ref: '#/components/schemas/city'
                        state:
                          $ref: '#/components/schemas/state'
                        country:
                          $ref: '#/components/schemas/country'
                        zip:
                          $ref: '#/components/schemas/zip'
                        fax:
                          $ref: '#/components/schemas/fax'
                    shipping_address:
                      $ref: '#/components/schemas/shipping_address'
                    is_taxable:
                      $ref: '#/components/schemas/is_taxable'
                    tax_authority_name:
                      $ref: '#/components/schemas/tax_authority_name'
                    tax_exemption_id:
                      $ref: '#/components/schemas/tax_exemption_id'
                    payment_terms:
                      $ref: '#/components/schemas/payment_terms'
                    payment_terms_label:
                      $ref: '#/components/schemas/payment_terms_label'
                custom_fields:
                  description: Additional fields for the Hosted pages.
                  type: array
                  items:
                    type: object
                    properties:
                      index:
                        $ref: '#/components/schemas/index'
                      label:
                        $ref: '#/components/schemas/label'
                      value:
                        $ref: '#/components/schemas/value'
                      data_type:
                        $ref: '#/components/schemas/data_type'
                contactpersons:
                  description: List of contact person objects. Each object contains <code>contactperson_id</code> and <code>email</code>.
                  type: array
                  items:
                    type: object
                    properties:
                      contactperson_id:
                        $ref: '#/components/schemas/contactperson_id'
                notes:
                  description: List of objects containing <code>note_id</code>, <code>description</code>, <code>commented_by</code> and <code>commented_time</code>
                  type: array
                  items:
                    type: object
                    properties:
                      note_id:
                        $ref: '#/components/schemas/note_id'
                      description:
                        description: Comments about the subscription made by the user.
                        type: string
                        example: ''
                      commented_by:
                        $ref: '#/components/schemas/commented_by'
                      commented_time:
                        $ref: '#/components/schemas/commented_time'
                payment_gateways:
                  description: List of payment gateways configured for the customer.
                  type: array
                  items:
                    type: object
                    properties:
                      payment_gateway:
                        $ref: '#/components/schemas/payment_gateway'
            invoice:
              type: object
              properties:
                invoice_id:
                  $ref: '#/components/schemas/invoice_id'
                number:
                  $ref: '#/components/schemas/number'
                status:
                  $ref: '#/components/schemas/status'
                invoice_date:
                  $ref: '#/components/schemas/invoice_date'
                due_date:
                  $ref: '#/components/schemas/due_date'
                payment_expected_date:
                  $ref: '#/components/schemas/payment_expected_date'
                ach_payment_initiated:
                  $ref: '#/components/schemas/ach_payment_initiated'
                transaction_type:
                  $ref: '#/components/schemas/transaction_type'
                customer_id:
                  $ref: '#/components/schemas/customer_id'
                customer_name:
                  $ref: '#/components/schemas/customer_name'
                email:
                  $ref: '#/components/schemas/email'
                invoice_items:
                  description: The list of items which are all included in the invoice. Each item object will have <code>item_id</code>, <code>name</code>, <code>code</code>, <code>price</code>, <code>quantity</code> and <code>item_total</code>.
                  type: array
                  items:
                    type: object
                    properties:
                      item_id:
                        $ref: '#/components/schemas/item_id'
                      name:
                        $ref: '#/components/schemas/name'
                      description:
                        description: Small description about the Invoice item.
                        example: Charges for this duration (from 16-April-2016 to 8-June-2016)
                      code:
                        $ref: '#/components/schemas/code'
                      price:
                        $ref: '#/components/schemas/price'
                      quantity:
                        $ref: '#/components/schemas/quantity'
                      discount_amount:
                        $ref: '#/components/schemas/discount_amount'
                      item_total:
                        $ref: '#/components/schemas/item_total'
                      tax_id:
                        $ref: '#/components/schemas/tax_id'
                      tax_exemption_id:
                        $ref: '#/components/schemas/tax_exemption_id'
                      tax_exemption_code:
                        $ref: '#/components/schemas/tax_exemption_code'
                coupon:
                  description: The object containing the details of the added coupon. <code>coupon_code</code> and <code>discount_amount</code> applied to the invoice total.
                  type: array
                  items:
                    type: object
                    properties:
                      coupon_code:
                        $ref: '#/components/schemas/coupon_code'
                      coupon_name:
                        $ref: '#/components/schemas/coupon_name'
                      discount_amount:
                        $ref: '#/components/schemas/discount_amount'
                credits:
                  type: array
                  items:
                    type: object
                    properties:
                      creditnote_id:
                        $ref: '#/components/schemas/creditnote_id'
                      creditnotes_number:
                        $ref: '#/components/schemas/creditnotes_number'
                      credited_date:
                        $ref: '#/components/schemas/credited_date'
                      credited_amount:
                        $ref: '#/components/schemas/credited_amount'
                total:
                  $ref: '#/components/schemas/total'
                payment_made:
                  $ref: '#/components/schemas/payment_made'
                balance:
                  $ref: '#/components/schemas/balance'
                credits_applied:
                  $ref: '#/components/schemas/credits_applied'
                write_off_amount:
                  $ref: '#/components/schemas/write_off_amount'
                payments:
                  description: List of payment objects. Each object will contain <code>payment_id</code>, <code>payment_mode</code>, <code>invoice_payment_id</code>, <code>gateway_transaction_id</code>, <code>description</code>, <code>date</code>, <code>reference_number</code> and <code>amount</code>.
                  type: array
                  items:
                    type: object
                    properties:
                      payment_id:
                        $ref: '#/components/schemas/payment_id'
                      payment_mode:
                        $ref: '#/components/schemas/payment_mode'
                      invoice_payment_id:
                        $ref: '#/components/schemas/invoice_payment_id'
                      gateway_transaction_id:
                        $ref: '#/components/schemas/gateway_transaction_id'
                      description:
                        $ref: '#/components/schemas/description'
                      date:
                        $ref: '#/components/schemas/date'
                      reference_number:
                        $ref: '#/components/schemas/reference_number'
                      amount:
                        $ref: '#/components/schemas/amount'
                      exchange_rate:
                        $ref: '#/components/schemas/exchange_rate'
                currency_code:
                  $ref: '#/components/schemas/currency_code'
                currency_symbol:
                  $ref: '#/components/schemas/currency_symbol'
                created_time:
                  $ref: '#/components/schemas/created_time'
                updated_time:
                  $ref: '#/components/schemas/updated_time'
                salesperson_id:
                  $ref: '#/components/schemas/salesperson_id'
                salesperson_name:
                  $ref: '#/components/schemas/salesperson_name'
                invoice_url:
                  $ref: '#/components/schemas/invoice_url'
                billing_address:
                  description: Customer's billing address object. It contains <code>attention</code>, <code>street</code>, <code>city</code>, <code>state</code>, <code>zip</code>, <code>country</code> and <code>fax</code>.
                  type: object
                  properties:
                    city:
                      $ref: '#/components/schemas/city'
                    state:
                      $ref: '#/components/schemas/state'
                    zip:
                      $ref: '#/components/schemas/zip'
                    country:
                      $ref: '#/components/schemas/country'
                    fax:
                      $ref: '#/components/schemas/fax'
                shipping_address:
                  $ref: '#/components/schemas/shipping_address'
                comments:
                  description: Lists the comments added by the system or by user.
                  type: array
                  items:
                    type: object
                    properties:
                      comment_id:
                        $ref: '#/components/schemas/comment_id'
                      description:
                        description: Small description about the comment.
                        example: Invoice has been marked as void
                      commented_by_id:
                        $ref: '#/components/schemas/commented_by_id'
                      commented_by:
                        $ref: '#/components/schemas/commented_by'
                      comment_type:
                        $ref: '#/components/schemas/comment_type'
                      date:
                        description: Date on which the comment was created.
                      time:
                        $ref: '#/components/schemas/time'
                      operation_type:
                        $ref: '#/components/schemas/operation_type'
                      transaction_id:
                        $ref: '#/components/schemas/transaction_id'
                      transaction_type:
                        description: Small description about the type of transaction.
                        example: invoice
                custom_fields:
                  description: Additional fields for the Hosted pages.
                  type: array
                  items:
                    type: object
                    properties:
                      index:
                        $ref: '#/components/schemas/index'
                      label:
                        $ref: '#/components/schemas/label'
                      value:
                        $ref: '#/components/schemas/value'
                      data_type:
                        $ref: '#/components/schemas/data_type'
    list-of-hostedpages-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: success
          readOnly: true
        hosted_pages:
          type: array
          items:
            type: object
            properties:
              hostedpage_id:
                $ref: '#/components/schemas/hostedpage_id'
              status:
                $ref: '#/components/schemas/status'
              url:
                $ref: '#/components/schemas/url'
              action:
                $ref: '#/components/schemas/action'
              expiring_time:
                $ref: '#/components/schemas/expiring_time'
              created_time:
                $ref: '#/components/schemas/created_time'
    create-a-subscription-request:
      required:
        - customer_id
        - customer
        - plan
      type: object
      properties:
        customer_id:
          description: Customer ID of the customer for whom a subscription needs to be created.
          x-required_info: for creating a hostedpage for existing customer.
        pricebook_id:
          description: A Pricebook that has currency same as that of the customer
          type: string
          example: '90300000070987'
        customer:
          description: Customer object of the customer for whom you want to create a subscription. Each object contains <code>display_name</code>, <code>company_name</code>, <code>first_name</code>, <code>last_name</code>, <code>email</code>, <code>fax</code>, <code>currency_code</code> and <code>billing_address</code>.
          type: object
          required:
            - display_name
            - email
            - tax_authority_id
            - tax_authority_name
          properties:
            display_name:
              $ref: '#/components/schemas/display_name'
            salutation:
              $ref: '#/components/schemas/salutation'
            first_name:
              $ref: '#/components/schemas/first_name'
            last_name:
              $ref: '#/components/schemas/last_name'
            email:
              $ref: '#/components/schemas/email'
            company_name:
              $ref: '#/components/schemas/company_name'
            billing_address:
              $ref: '#/components/schemas/billing_address'
            shipping_address:
              $ref: '#/components/schemas/shipping_address'
            pricebook_id:
              description: A Pricebook that has currency same as that of the customer
              type: string
              example: '90300000070967'
            payment_terms:
              $ref: '#/components/schemas/payment_terms'
            payment_terms_label:
              $ref: '#/components/schemas/payment_terms_label'
            exchange_rate:
              $ref: '#/components/schemas/exchange_rate'
            currency_code:
              $ref: '#/components/schemas/currency_code'
            vat_treatment:
              $ref: '#/components/schemas/vat_treatment'
            vat_reg_no:
              $ref: '#/components/schemas/vat_reg_no'
            country_code:
              $ref: '#/components/schemas/country_code'
            is_taxable:
              $ref: '#/components/schemas/is_taxable'
            tax_id:
              $ref: '#/components/schemas/tax_id'
            tax_authority_id:
              $ref: '#/components/schemas/tax_authority_id'
            tax_authority_name:
              $ref: '#/components/schemas/tax_authority_name'
            tax_exemption_id:
              $ref: '#/components/schemas/tax_exemption_id'
            tax_exemption_code:
              $ref: '#/components/schemas/tax_exemption_code'
            default_templates:
              description: Default templates associated with the customer.
              type: object
              properties:
                invoice_template_id:
                  $ref: '#/components/schemas/invoice_template_id'
                creditnote_template_id:
                  $ref: '#/components/schemas/creditnote_template_id'
            place_of_contact:
              $ref: '#/components/schemas/place_of_contact'
            gst_no:
              $ref: '#/components/schemas/gst_no'
            gst_treatment:
              $ref: '#/components/schemas/gst_treatment'
          x-required_info: for creating a subscription for new customer.
        contactpersons:
          description: List of contact person objects. Each object contains <code>contactperson_id</code> and <code>email</code>.
          type: array
          items:
            type: object
            required:
              - contactperson_id
            properties:
              contactperson_id:
                $ref: '#/components/schemas/contactperson_id'
        plan:
          description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
          type: object
          required:
            - plan_code
            - tax_id
          properties:
            plan_code:
              $ref: '#/components/schemas/plan_code'
            plan_description:
              $ref: '#/components/schemas/plan_description'
            price:
              $ref: '#/components/schemas/price'
            setup_fee:
              $ref: '#/components/schemas/setup_fee'
            setup_fee_tax_id:
              $ref: '#/components/schemas/setup_fee_tax_id'
            quantity:
              $ref: '#/components/schemas/quantity'
            tags:
              $ref: '#/components/schemas/tags'
            item_custom_fields:
              $ref: '#/components/schemas/item_custom_fields'
            tax_id:
              description: Unique ID of Tax or Tax Group that must be associated with the plan. <code>tax_id</code> must be empty for applying tax Exemption.
              x-required_info: for applying tax or tax exemption to a plan
            tax_exemption_id:
              $ref: '#/components/schemas/tax_exemption_id'
            tax_exemption_code:
              $ref: '#/components/schemas/tax_exemption_code'
            setup_fee_tax_exemption_id:
              $ref: '#/components/schemas/setup_fee_tax_exemption_id'
            setup_fee_tax_exemption_code:
              $ref: '#/components/schemas/setup_fee_tax_exemption_code'
            exclude_trial:
              $ref: '#/components/schemas/exclude_trial'
            exclude_setup_fee:
              $ref: '#/components/schemas/exclude_setup_fee'
            billing_cycles:
              $ref: '#/components/schemas/billing_cycles'
            trial_days:
              $ref: '#/components/schemas/trial_days'
        addons:
          description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
          type: array
          items:
            type: object
            required:
              - addon_code
            properties:
              addon_code:
                $ref: '#/components/schemas/addon_code'
              addon_description:
                $ref: '#/components/schemas/addon_description'
              price:
                $ref: '#/components/schemas/price'
              quantity:
                description: Required quantity of the chosen addon.
                type: integer
                example: 1
              tags:
                $ref: '#/components/schemas/tags'
              item_custom_fields:
                $ref: '#/components/schemas/item_custom_fields'
              tax_id:
                description: Unique ID of Tax or Tax Group that must be associated with the addon. <code>tax_id</code> must be empty for applying tax Exemption.
                x-required_info: for applying tax or tax exemption to a addon
              tax_exemption_id:
                $ref: '#/components/schemas/tax_exemption_id'
              tax_exemption_code:
                $ref: '#/components/schemas/tax_exemption_code'
        reference_id:
          $ref: '#/components/schemas/reference_id'
        starts_at:
          $ref: '#/components/schemas/starts_at'
        custom_fields:
          description: Additional fields for the Hosted pages.
          type: array
          items:
            type: object
            properties:
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
        coupon_code:
          $ref: '#/components/schemas/coupon_code'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
        salesperson_name:
          $ref: '#/components/schemas/salesperson_name'
        template_id:
          $ref: '#/components/schemas/template_id'
        can_charge_setup_fee_immediately:
          $ref: '#/components/schemas/can_charge_setup_fee_immediately'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
        billing_address_id:
          $ref: '#/components/schemas/billing_address_id'
        shipping_address_id:
          $ref: '#/components/schemas/shipping_address_id'
        branch_id:
          $ref: '#/components/schemas/branch_id'
    create-a-subscription-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              $ref: '#/components/schemas/action'
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
    update-a-subscription-request:
      required:
        - subscription_id
        - plan
      type: object
      properties:
        subscription_id:
          $ref: '#/components/schemas/subscription_id'
        plan:
          description: Plan object for which the subscription is to be created/updated. This contains <code>plan_code</code>, <code>name</code>, <code>price</code>, <code>exclude_setup_fee</code>, <code>quantity</code>, <code>exclude_setup_fee</code>, <code>exclude_trial</code>, <code>billing_cycles</code> and <code>trial_days</code>.
          type: object
          required:
            - plan_code
            - tax_id
          properties:
            plan_code:
              $ref: '#/components/schemas/plan_code'
            plan_description:
              $ref: '#/components/schemas/plan_description'
            price:
              $ref: '#/components/schemas/price'
            setup_fee:
              $ref: '#/components/schemas/setup_fee'
            quantity:
              $ref: '#/components/schemas/quantity'
            tags:
              $ref: '#/components/schemas/tags'
            item_custom_fields:
              $ref: '#/components/schemas/item_custom_fields'
            tax_id:
              description: Unique ID of Tax or Tax Group that must be associated with the plan. <code>tax_id</code> must be empty for applying tax Exemption.
              x-required_info: for applying tax or tax exemption to a plan
            tax_exemption_id:
              $ref: '#/components/schemas/tax_exemption_id'
            tax_exemption_code:
              $ref: '#/components/schemas/tax_exemption_code'
            setup_fee_tax_exemption_id:
              $ref: '#/components/schemas/setup_fee_tax_exemption_id'
            setup_fee_tax_exemption_code:
              $ref: '#/components/schemas/setup_fee_tax_exemption_code'
            exclude_trial:
              $ref: '#/components/schemas/exclude_trial'
            exclude_setup_fee:
              $ref: '#/components/schemas/exclude_setup_fee'
            billing_cycles:
              $ref: '#/components/schemas/billing_cycles'
            trial_days:
              $ref: '#/components/schemas/trial_days'
        addons:
          description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
          type: array
          items:
            type: object
            required:
              - addon_code
            properties:
              addon_code:
                $ref: '#/components/schemas/addon_code'
              addon_description:
                $ref: '#/components/schemas/addon_description'
              price:
                $ref: '#/components/schemas/price'
              quantity:
                description: Required quantity of the chosen addon.
                type: integer
                example: 1
              tags:
                $ref: '#/components/schemas/tags'
              item_custom_fields:
                $ref: '#/components/schemas/item_custom_fields'
              tax_id:
                description: Unique ID of Tax or Tax Group that must be associated with the addon. <code>tax_id</code> must be empty for applying tax Exemption.
                x-required_info: for applying tax or tax exemption to a addon
              tax_exemption_id:
                $ref: '#/components/schemas/tax_exemption_id'
              tax_exemption_code:
                $ref: '#/components/schemas/tax_exemption_code'
        reference_id:
          $ref: '#/components/schemas/reference_id'
        custom_fields:
          description: Additional fields for the Hosted pages.
          type: array
          items:
            type: object
            properties:
              label:
                $ref: '#/components/schemas/label'
              value:
                $ref: '#/components/schemas/value'
        coupon_code:
          $ref: '#/components/schemas/coupon_code'
        salesperson_name:
          $ref: '#/components/schemas/salesperson_name'
        can_charge_setup_fee_immediately:
          $ref: '#/components/schemas/can_charge_setup_fee_immediately'
        gst_treatment:
          $ref: '#/components/schemas/gst_treatment'
        gst_no:
          $ref: '#/components/schemas/gst_no'
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        place_of_supply:
          $ref: '#/components/schemas/place_of_supply'
        billing_address_id:
          $ref: '#/components/schemas/billing_address_id'
        shipping_address_id:
          $ref: '#/components/schemas/shipping_address_id'
        branch_id:
          $ref: '#/components/schemas/branch_id'
        template_id:
          $ref: '#/components/schemas/template_id'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
    update-a-subscription-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: Update subscription
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
    update-card-for-a-subscription-request:
      required:
        - subscription_id
      type: object
      properties:
        subscription_id:
          $ref: '#/components/schemas/subscription_id'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
    update-card-for-a-subscription-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: Update Card
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
    buy-one-time-addon-for-a-subscription-request:
      required:
        - subscription_id
        - addons
      type: object
      properties:
        subscription_id:
          $ref: '#/components/schemas/subscription_id'
        addons:
          description: List of addon objects which are to be included in the subscription. Each object contains <code>addon_code</code>, <code>name</code>, <code>price</code> and <code>quantity</code>.
          type: array
          items:
            type: object
            required:
              - addon_code
              - tax_id
            properties:
              addon_code:
                $ref: '#/components/schemas/addon_code'
              quantity:
                $ref: '#/components/schemas/quantity'
              tags:
                $ref: '#/components/schemas/tags'
              item_custom_fields:
                $ref: '#/components/schemas/item_custom_fields'
              price:
                $ref: '#/components/schemas/price'
              tax_id:
                description: Unique ID of Tax or Tax Group that must be associated with the addon. <code>tax_id</code> must be empty for applying tax Exemption.
                x-required_info: for applying tax or tax exemption to a addon
              tax_exemption_id:
                $ref: '#/components/schemas/tax_exemption_id'
              tax_exemption_code:
                $ref: '#/components/schemas/tax_exemption_code'
              product_type:
                $ref: '#/components/schemas/product_type'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
        coupon_code:
          description: The coupon code of the coupon which is to be applied to the one-time addon.
          type: string
          example: COUPON-50-OFF
        cfdi_usage:
          $ref: '#/components/schemas/cfdi_usage'
        exchange_rate:
          $ref: '#/components/schemas/exchange_rate'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
    buy-one-time-addon-for-a-subscription-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: One time addon
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
            custom_fields:
              description: Additional fields for the Hosted pages.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  value:
                    $ref: '#/components/schemas/value'
                  label:
                    $ref: '#/components/schemas/label'
                  data_type:
                    $ref: '#/components/schemas/data_type'
    add-payment-method-for-a-customer-request:
      required:
        - customer_id
      type: object
      properties:
        customer_id:
          description: Customer ID of the customer for whom a subscription needs to be created
          type: string
          example: '903000000000099'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
    add-payment-method-for-a-customer-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: Update payment method
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
            custom_fields:
              description: Additional fields for the Hosted pages.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  value:
                    $ref: '#/components/schemas/value'
                  label:
                    $ref: '#/components/schemas/label'
                  data_type:
                    $ref: '#/components/schemas/data_type'
    record-invoice-payment-for-a-subscription-request:
      required:
        - invoice_id
      type: object
      properties:
        invoice_id:
          $ref: '#/components/schemas/invoice_id'
        redirect_url:
          $ref: '#/components/schemas/redirect_url'
        hostedpage_settings_id:
          description: Hostedpage Template ID for the Subscriptions
          type: string
          example: '90300000079469'
        payment_gateways:
          $ref: '#/components/schemas/payment_gateways'
    record-invoice-payment-for-a-subscription-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: Invoice payment
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
            custom_fields:
              description: Additional fields for the Hosted pages.
              type: array
              items:
                type: object
                properties:
                  index:
                    $ref: '#/components/schemas/index'
                  value:
                    $ref: '#/components/schemas/value'
                  label:
                    $ref: '#/components/schemas/label'
                  data_type:
                    $ref: '#/components/schemas/data_type'
    update-payment-method-request:
      required:
        - card_id
        - account_id
        - paypal_id
      type: object
      properties:
        card_id:
          $ref: '#/components/schemas/card_id_edit'
        account_id:
          $ref: '#/components/schemas/account_id_edit'
        paypal_id:
          $ref: '#/components/schemas/paypal_id_edit'
    update-payment-method-response:
      type: object
      properties:
        code:
          type: integer
          example: 0
          readOnly: true
        message:
          type: string
          example: Hosted page has been created successfully.
          readOnly: true
        hostedpage:
          type: object
          properties:
            hostedpage_id:
              $ref: '#/components/schemas/hostedpage_id'
            status:
              $ref: '#/components/schemas/status'
            url:
              $ref: '#/components/schemas/url'
            action:
              example: Update payment method
            expiring_time:
              $ref: '#/components/schemas/expiring_time'
            created_time:
              $ref: '#/components/schemas/created_time'
  securitySchemes:
    Zoho_Auth:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.zoho.com/oauth/v2/auth
          scopes:
            ZohoSubscriptions.hostedpages.READ: Read Hostedpages
            ZohoSubscriptions.hostedpages.CREATE: Create Hostedpages
