# Nusii API v2 — OpenAPI schema.
#
# Generated from the request specs in spec/requests/api/v2. Regenerate with:
#
#   OPENAPI=1 bundle exec rspec spec/requests/api/v2
#
# Manual edits to descriptions are preserved on regeneration; schema shapes
# are not — change the request specs (or serializers) instead.
---
openapi: 3.1.0
info:
  title: Nusii API v2
  version: '2.0'
  description: 'The Nusii proposal API. Authenticate with an API key (`Authorization:
    Token token=YOUR_API_KEY`) or an OAuth 2.0 bearer token. Narrative documentation
    lives at https://developer.nusii.com.'
servers:
- url: https://app.nusii.com
security:
- TokenAuth: []
- OAuthBearer: []
paths:
  "/api/v2/account/me":
    get:
      summary: me
      tags:
      - Api::V2::Account
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          email:
                            type: string
                          name:
                            type: string
                          subdomain:
                            type: string
                          web:
                            type: string
                          currency:
                            type: string
                          address:
                            type: 'null'
                          address_state:
                            type: 'null'
                          postcode:
                            type: 'null'
                          city:
                            type: 'null'
                          country:
                            type: object
                            properties:
                              data:
                                type: object
                                properties:
                                  alpha2:
                                    type: string
                                  name:
                                    type: string
                                  eu_member:
                                    type: boolean
                                  continent:
                                    type: string
                                  currency_code:
                                    type: string
                                required:
                                - alpha2
                                - name
                                - eu_member
                                - continent
                                - currency_code
                            required:
                            - data
                          country_name:
                            type: string
                          telephone:
                            type: string
                        required:
                        - email
                        - name
                        - subdomain
                        - web
                        - currency
                        - address
                        - address_state
                        - postcode
                        - city
                        - country
                        - country_name
                        - telephone
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
  "/api/v2/clients":
    get:
      summary: index
      tags:
      - Api::V2::Client
      parameters:
      - name: email
        in: query
        required: false
        schema:
          type: string
      - name: emails
        in: query
        required: false
        schema:
          type: string
      - name: query
        in: query
        required: false
        schema:
          type: string
      - name: query[nested]
        in: query
        required: false
        schema:
          type: string
      responses:
        '200':
          description: still serves active, inactive and suspicious accounts
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            email:
                              type: string
                            name:
                              type: string
                            surname:
                              type: string
                            full_name:
                              type: string
                            business:
                              type: string
                            web:
                              type: 'null'
                            currency:
                              type: string
                            locale:
                              type: string
                            time_zone:
                              type: 'null'
                            pdf_page_size:
                              type: string
                            notes:
                              type: 'null'
                            client_role:
                              type: 'null'
                            telephone:
                              type: 'null'
                            address:
                              type: 'null'
                            city:
                              type: 'null'
                            postcode:
                              type: 'null'
                            country:
                              type: 'null'
                            state:
                              type: 'null'
                            created_at:
                              type: string
                          required:
                          - email
                          - name
                          - surname
                          - full_name
                          - business
                          - web
                          - currency
                          - locale
                          - time_zone
                          - pdf_page_size
                          - notes
                          - client_role
                          - telephone
                          - address
                          - city
                          - postcode
                          - country
                          - state
                          - created_at
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
        '400':
          description: returns bad request for a non-string filter
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '403':
          description: still rejects a session without an Authorization header
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                - message
    post:
      summary: create
      tags:
      - Api::V2::Client
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                client:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      type: string
                    web:
                      type: string
                  required:
                  - name
                  - email
              required:
              - client
      responses:
        '201':
          description: allows POST requests
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          email:
                            type: string
                          name:
                            type: string
                          surname:
                            type: 'null'
                          full_name:
                            type: string
                          business:
                            type: 'null'
                          web:
                            type:
                            - string
                            - 'null'
                          currency:
                            type: string
                          locale:
                            type: string
                          time_zone:
                            type: 'null'
                          pdf_page_size:
                            type: string
                          notes:
                            type: 'null'
                          client_role:
                            type: 'null'
                          telephone:
                            type: 'null'
                          address:
                            type: 'null'
                          city:
                            type: 'null'
                          postcode:
                            type: 'null'
                          country:
                            type: 'null'
                          state:
                            type: 'null'
                          created_at:
                            type: string
                        required:
                        - email
                        - name
                        - surname
                        - full_name
                        - business
                        - web
                        - currency
                        - locale
                        - time_zone
                        - pdf_page_size
                        - notes
                        - client_role
                        - telephone
                        - address
                        - city
                        - postcode
                        - country
                        - state
                        - created_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '403':
          description: rejects POST requests with insufficient_scope
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
  "/api/v2/clients/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::Client
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: allows DELETE requests
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          email:
                            type: string
                          name:
                            type: string
                          surname:
                            type: string
                          full_name:
                            type: string
                          business:
                            type: string
                          web:
                            type: 'null'
                          currency:
                            type: string
                          locale:
                            type: string
                          time_zone:
                            type: 'null'
                          pdf_page_size:
                            type: string
                          notes:
                            type: 'null'
                          client_role:
                            type: 'null'
                          telephone:
                            type: 'null'
                          address:
                            type: 'null'
                          city:
                            type: 'null'
                          postcode:
                            type: 'null'
                          country:
                            type: 'null'
                          state:
                            type: 'null'
                          created_at:
                            type: string
                        required:
                        - email
                        - name
                        - surname
                        - full_name
                        - business
                        - web
                        - currency
                        - locale
                        - time_zone
                        - pdf_page_size
                        - notes
                        - client_role
                        - telephone
                        - address
                        - city
                        - postcode
                        - country
                        - state
                        - created_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
    get:
      summary: show
      tags:
      - Api::V2::Client
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          email:
                            type: string
                          name:
                            type: string
                          surname:
                            type: string
                          full_name:
                            type: string
                          business:
                            type: string
                          web:
                            type: 'null'
                          currency:
                            type: string
                          locale:
                            type: string
                          time_zone:
                            type: 'null'
                          pdf_page_size:
                            type: string
                          notes:
                            type: 'null'
                          client_role:
                            type: 'null'
                          telephone:
                            type: 'null'
                          address:
                            type: 'null'
                          city:
                            type: 'null'
                          postcode:
                            type: 'null'
                          country:
                            type: 'null'
                          state:
                            type: 'null'
                          created_at:
                            type: string
                        required:
                        - email
                        - name
                        - surname
                        - full_name
                        - business
                        - web
                        - currency
                        - locale
                        - time_zone
                        - pdf_page_size
                        - notes
                        - client_role
                        - telephone
                        - address
                        - city
                        - postcode
                        - country
                        - state
                        - created_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns http not found when client isn't there
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
    put:
      summary: update
      tags:
      - Api::V2::Client
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: allows PUT requests
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          email:
                            type: string
                          name:
                            type: string
                          surname:
                            type: string
                          full_name:
                            type: string
                          business:
                            type: string
                          web:
                            type: 'null'
                          currency:
                            type: string
                          locale:
                            type: string
                          time_zone:
                            type: 'null'
                          pdf_page_size:
                            type: string
                          notes:
                            type: 'null'
                          client_role:
                            type: 'null'
                          telephone:
                            type: 'null'
                          address:
                            type: 'null'
                          city:
                            type: 'null'
                          postcode:
                            type: 'null'
                          country:
                            type: 'null'
                          state:
                            type: 'null'
                          created_at:
                            type: string
                        required:
                        - email
                        - name
                        - surname
                        - full_name
                        - business
                        - web
                        - currency
                        - locale
                        - time_zone
                        - pdf_page_size
                        - notes
                        - client_role
                        - telephone
                        - address
                        - city
                        - postcode
                        - country
                        - state
                        - created_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                client:
                  type: object
                  properties:
                    name:
                      type: string
                    email:
                      type: string
                  required:
                  - name
              required:
              - client
  "/api/v2/currencies":
    get:
      summary: index
      tags:
      - Api::V2::Currency
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    iso_code:
                      type: string
                    name:
                      type: string
                  required:
                  - id
                  - iso_code
                  - name
  "/api/v2/integrations/less_annoying_crm_installations":
    post:
      summary: create
      tags:
      - Api::V2::Integrations::LessAnnoyingCrmInstallation
      responses:
        '201':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                        required:
                        - name
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable content
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                less_annoying_crm_installation:
                  type: object
                  properties:
                    name:
                      type: string
                    token:
                      type: string
                    user_code:
                      type: string
                  required:
                  - name
                  - token
                  - user_code
              required:
              - less_annoying_crm_installation
  "/api/v2/integrations/one_page_crm_installations":
    post:
      summary: create
      tags:
      - Api::V2::Integrations::OnePageCrmInstallation
      responses:
        '201':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                        required:
                        - name
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                one_page_crm_installation:
                  type: object
                  properties:
                    name:
                      type: string
                    api_key:
                      type: string
                    api_secret:
                      type: string
                  required:
                  - name
                  - api_key
                  - api_secret
              required:
              - one_page_crm_installation
  "/api/v2/line_items/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::LineItem
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          section_id:
                            type: integer
                          name:
                            type: string
                          position:
                            type: integer
                          cost_type:
                            type: string
                          recurring_type:
                            type: 'null'
                          per_type:
                            type: 'null'
                          choice_type:
                            type: string
                          quantity:
                            type: 'null'
                          updated_at:
                            type: string
                          created_at:
                            type: string
                          currency:
                            type: string
                          amount:
                            type: integer
                          amount_formatted:
                            type: string
                          amount_in_cents:
                            type: integer
                          maximum_amount_in_cents:
                            type: 'null'
                          maximum_amount_formatted:
                            type: 'null'
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                        required:
                        - section_id
                        - name
                        - position
                        - cost_type
                        - recurring_type
                        - per_type
                        - choice_type
                        - quantity
                        - updated_at
                        - created_at
                        - currency
                        - amount
                        - amount_formatted
                        - amount_in_cents
                        - maximum_amount_in_cents
                        - maximum_amount_formatted
                        - total_in_cents
                        - total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns not found on destroy
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
                - message
    get:
      summary: show
      tags:
      - Api::V2::LineItem
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: section_id
        in: query
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          section_id:
                            type: integer
                          name:
                            type: string
                          position:
                            type: integer
                          cost_type:
                            type: string
                          recurring_type:
                            type: 'null'
                          per_type:
                            type: 'null'
                          choice_type:
                            type: string
                          quantity:
                            type: 'null'
                          updated_at:
                            type: string
                          created_at:
                            type: string
                          currency:
                            type: string
                          amount:
                            type: integer
                          amount_formatted:
                            type: string
                          amount_in_cents:
                            type: integer
                          maximum_amount_in_cents:
                            type: 'null'
                          maximum_amount_formatted:
                            type: 'null'
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                        required:
                        - section_id
                        - name
                        - position
                        - cost_type
                        - recurring_type
                        - per_type
                        - choice_type
                        - quantity
                        - updated_at
                        - created_at
                        - currency
                        - amount
                        - amount_formatted
                        - amount_in_cents
                        - maximum_amount_in_cents
                        - maximum_amount_formatted
                        - total_in_cents
                        - total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns not found on show
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
    put:
      summary: update
      tags:
      - Api::V2::LineItem
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          section_id:
                            type: integer
                          name:
                            type: string
                          position:
                            type: integer
                          cost_type:
                            type: string
                          recurring_type:
                            type: 'null'
                          per_type:
                            type: 'null'
                          choice_type:
                            type: string
                          quantity:
                            type: 'null'
                          updated_at:
                            type: string
                          created_at:
                            type: string
                          currency:
                            type: string
                          amount:
                            type: integer
                          amount_formatted:
                            type: string
                          amount_in_cents:
                            type: integer
                          maximum_amount_in_cents:
                            type: 'null'
                          maximum_amount_formatted:
                            type: 'null'
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                        required:
                        - section_id
                        - name
                        - position
                        - cost_type
                        - recurring_type
                        - per_type
                        - choice_type
                        - quantity
                        - updated_at
                        - created_at
                        - currency
                        - amount
                        - amount_formatted
                        - amount_in_cents
                        - maximum_amount_in_cents
                        - maximum_amount_formatted
                        - total_in_cents
                        - total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns not found on update
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                  error:
                    type: string
                  message:
                    type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                line_item:
                  type: object
                  properties:
                    choice_type:
                      type: string
                    maximum_amount:
                      type: string
                    cost_type:
                      type: string
                    name:
                      type: string
              required:
              - line_item
  "/api/v2/locales":
    get:
      summary: index
      tags:
      - Api::V2::Locale
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    code:
                      type: string
                    name:
                      type: string
                  required:
                  - id
                  - code
                  - name
  "/api/v2/pdf_page_sizes":
    get:
      summary: index
      tags:
      - Api::V2::PdfPageSize
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                  - id
                  - name
  "/api/v2/proposal_activities":
    get:
      summary: index
      tags:
      - Api::V2::ProposalActivity
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            activity_type:
                              type: string
                            ip_address:
                              type: 'null'
                            additional_fields:
                              type: object
                              properties: {}
                            proposal_title:
                              type: string
                            proposal_created_at:
                              type: string
                            proposal_sent_at:
                              type: 'null'
                            proposal_status:
                              type: string
                            proposal_public_id:
                              type: string
                            proposal_expires_at:
                              type: 'null'
                            client_name:
                              type:
                              - string
                              - 'null'
                            client_email:
                              type:
                              - string
                              - 'null'
                            client_surname:
                              type:
                              - string
                              - 'null'
                            client_full_name:
                              type:
                              - string
                              - 'null'
                            client_business:
                              type:
                              - string
                              - 'null'
                            client_telephone:
                              type: 'null'
                            client_locale:
                              type:
                              - string
                              - 'null'
                            client_address:
                              type: 'null'
                            client_postcode:
                              type: 'null'
                            client_country:
                              type: 'null'
                            client_city:
                              type: 'null'
                            client_state:
                              type: 'null'
                            client_web:
                              type: 'null'
                          required:
                          - activity_type
                          - ip_address
                          - additional_fields
                          - proposal_title
                          - proposal_created_at
                          - proposal_sent_at
                          - proposal_status
                          - proposal_public_id
                          - proposal_expires_at
                          - client_name
                          - client_email
                          - client_surname
                          - client_full_name
                          - client_business
                          - client_telephone
                          - client_locale
                          - client_address
                          - client_postcode
                          - client_country
                          - client_city
                          - client_state
                          - client_web
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
      parameters:
      - name: client_id
        in: query
        required: false
        schema:
          type: integer
      - name: proposal_id
        in: query
        required: false
        schema:
          type: integer
  "/api/v2/proposal_activities/{id}":
    get:
      summary: show
      tags:
      - Api::V2::ProposalActivity
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          activity_type:
                            type: string
                          ip_address:
                            type: 'null'
                          additional_fields:
                            type: object
                            properties: {}
                          proposal_title:
                            type: string
                          proposal_created_at:
                            type: string
                          proposal_sent_at:
                            type: 'null'
                          proposal_status:
                            type: string
                          proposal_public_id:
                            type: string
                          proposal_expires_at:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                        required:
                        - activity_type
                        - ip_address
                        - additional_fields
                        - proposal_title
                        - proposal_created_at
                        - proposal_sent_at
                        - proposal_status
                        - proposal_public_id
                        - proposal_expires_at
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_locale
                        - client_address
                        - client_postcode
                        - client_country
                        - client_city
                        - client_state
                        - client_web
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
  "/api/v2/proposals":
    get:
      summary: index
      tags:
      - Api::V2::Proposal
      responses:
        '200':
          description: returns only expired proposals
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            title:
                              type: string
                            account_id:
                              type: integer
                            status:
                              type: string
                            public_id:
                              type: string
                            document_number:
                              type: 'null'
                            prepared_by_id:
                              type: 'null'
                            client_id:
                              type: 'null'
                            sender_id:
                              type: 'null'
                            created_at:
                              type: string
                            updated_at:
                              type: string
                            sent_at:
                              type: 'null'
                            document_section_title:
                              type: 'null'
                            signed_at:
                              type: 'null'
                            accepted_at:
                              type: 'null'
                            force_signature:
                              type: boolean
                            expires_at:
                              type:
                              - string
                              - 'null'
                            report:
                              type: boolean
                            exclude_total:
                              type: boolean
                            exclude_total_in_pdf:
                              type: boolean
                            display_date:
                              type: 'null'
                            present_date:
                              type: string
                            present_email:
                              type: string
                            archived_at:
                              type: 'null'
                            currency:
                              type: string
                            theme:
                              type: string
                            cover_image_url:
                              type: 'null'
                            empty_cover_image:
                              type: boolean
                            cover_opacity:
                              type: integer
                            cover_overlay_color:
                              type: 'null'
                            cover_overlay_dynamic_color:
                              type: 'null'
                            sender_name:
                              type: 'null'
                            source:
                              type: string
                            table_of_contents:
                              type: boolean
                            last_viewed_at:
                              type: 'null'
                            accepted_total_in_cents:
                              type: 'null'
                            accepted_total_formatted:
                              type: 'null'
                            payment_percentage:
                              type: integer
                            client_role:
                              type: 'null'
                            client_locale:
                              type: 'null'
                            pdf_url:
                              type: string
                            account_name:
                              type: string
                            account_web:
                              type: string
                            account_email:
                              type: string
                            account_telephone:
                              type: string
                            account_address:
                              type: 'null'
                            account_address_state:
                              type: 'null'
                            client_name:
                              type: 'null'
                            client_email:
                              type: 'null'
                            client_surname:
                              type: 'null'
                            client_full_name:
                              type: 'null'
                            client_business:
                              type: 'null'
                            client_telephone:
                              type: 'null'
                            client_address:
                              type: 'null'
                            client_city:
                              type: 'null'
                            client_postcode:
                              type: 'null'
                            client_country:
                              type: 'null'
                            client_state:
                              type: 'null'
                            client_web:
                              type: 'null'
                            client_notes:
                              type: 'null'
                          required:
                          - title
                          - account_id
                          - status
                          - public_id
                          - document_number
                          - prepared_by_id
                          - client_id
                          - sender_id
                          - created_at
                          - updated_at
                          - sent_at
                          - document_section_title
                          - signed_at
                          - accepted_at
                          - force_signature
                          - expires_at
                          - report
                          - exclude_total
                          - exclude_total_in_pdf
                          - display_date
                          - present_date
                          - present_email
                          - archived_at
                          - currency
                          - theme
                          - cover_image_url
                          - empty_cover_image
                          - cover_opacity
                          - cover_overlay_color
                          - cover_overlay_dynamic_color
                          - sender_name
                          - source
                          - table_of_contents
                          - last_viewed_at
                          - accepted_total_in_cents
                          - accepted_total_formatted
                          - payment_percentage
                          - client_role
                          - client_locale
                          - pdf_url
                          - account_name
                          - account_web
                          - account_email
                          - account_telephone
                          - account_address
                          - account_address_state
                          - client_name
                          - client_email
                          - client_surname
                          - client_full_name
                          - client_business
                          - client_telephone
                          - client_address
                          - client_city
                          - client_postcode
                          - client_country
                          - client_state
                          - client_web
                          - client_notes
                        relationships:
                          type: object
                          properties:
                            sections:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items: {}
                              required:
                              - data
                            recipients:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                    - id
                                    - type
                              required:
                              - data
                          required:
                          - sections
                          - recipients
                      required:
                      - id
                      - type
                      - attributes
                      - relationships
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type:
                        - string
                        - 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type:
                        - integer
                        - 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
        '400':
          description: returns bad request when per is a hash instead of a number
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '406':
          description: returns not acceptable for unsupported Accept header
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      parameters:
      - name: expires_at_after
        in: query
        required: false
        schema:
          type: string
      - name: page
        in: query
        required: false
        schema:
          type: integer
      - name: page[number]
        in: query
        required: false
        schema:
          type: integer
      - name: per
        in: query
        required: false
        schema:
          type: integer
      - name: per[size]
        in: query
        required: false
        schema:
          type: integer
      - name: recipient_email[0]
        in: query
        required: false
        schema:
          type: string
      - name: recipient_emails
        in: query
        required: false
        schema:
          type: string
      - name: status
        in: query
        required: false
        schema:
          type: string
    post:
      summary: create
      tags:
      - Api::V2::Proposal
      responses:
        '200':
          description: accepts numeric page and per params sent as JSON integers
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            title:
                              type: string
                            account_id:
                              type: integer
                            status:
                              type: string
                            public_id:
                              type: string
                            document_number:
                              type: 'null'
                            prepared_by_id:
                              type: 'null'
                            client_id:
                              type: 'null'
                            sender_id:
                              type: 'null'
                            created_at:
                              type: string
                            updated_at:
                              type: string
                            sent_at:
                              type: 'null'
                            document_section_title:
                              type: 'null'
                            signed_at:
                              type: 'null'
                            accepted_at:
                              type: 'null'
                            force_signature:
                              type: boolean
                            expires_at:
                              type: 'null'
                            report:
                              type: boolean
                            exclude_total:
                              type: boolean
                            exclude_total_in_pdf:
                              type: boolean
                            display_date:
                              type: 'null'
                            present_date:
                              type: string
                            present_email:
                              type: string
                            archived_at:
                              type:
                              - string
                              - 'null'
                            currency:
                              type: string
                            theme:
                              type: string
                            cover_image_url:
                              type: 'null'
                            empty_cover_image:
                              type: boolean
                            cover_opacity:
                              type: integer
                            cover_overlay_color:
                              type: 'null'
                            cover_overlay_dynamic_color:
                              type: 'null'
                            sender_name:
                              type: 'null'
                            source:
                              type: string
                            table_of_contents:
                              type: boolean
                            last_viewed_at:
                              type: 'null'
                            accepted_total_in_cents:
                              type: 'null'
                            accepted_total_formatted:
                              type: 'null'
                            payment_percentage:
                              type: integer
                            client_role:
                              type: 'null'
                            client_locale:
                              type: 'null'
                            pdf_url:
                              type: string
                            account_name:
                              type: string
                            account_web:
                              type: string
                            account_email:
                              type: string
                            account_telephone:
                              type: string
                            account_address:
                              type: 'null'
                            account_address_state:
                              type: 'null'
                            client_name:
                              type: 'null'
                            client_email:
                              type: 'null'
                            client_surname:
                              type: 'null'
                            client_full_name:
                              type: 'null'
                            client_business:
                              type: 'null'
                            client_telephone:
                              type: 'null'
                            client_address:
                              type: 'null'
                            client_city:
                              type: 'null'
                            client_postcode:
                              type: 'null'
                            client_country:
                              type: 'null'
                            client_state:
                              type: 'null'
                            client_web:
                              type: 'null'
                            client_notes:
                              type: 'null'
                          required:
                          - title
                          - account_id
                          - status
                          - public_id
                          - document_number
                          - prepared_by_id
                          - client_id
                          - sender_id
                          - created_at
                          - updated_at
                          - sent_at
                          - document_section_title
                          - signed_at
                          - accepted_at
                          - force_signature
                          - expires_at
                          - report
                          - exclude_total
                          - exclude_total_in_pdf
                          - display_date
                          - present_date
                          - present_email
                          - archived_at
                          - currency
                          - theme
                          - cover_image_url
                          - empty_cover_image
                          - cover_opacity
                          - cover_overlay_color
                          - cover_overlay_dynamic_color
                          - sender_name
                          - source
                          - table_of_contents
                          - last_viewed_at
                          - accepted_total_in_cents
                          - accepted_total_formatted
                          - payment_percentage
                          - client_role
                          - client_locale
                          - pdf_url
                          - account_name
                          - account_web
                          - account_email
                          - account_telephone
                          - account_address
                          - account_address_state
                          - client_name
                          - client_email
                          - client_surname
                          - client_full_name
                          - client_business
                          - client_telephone
                          - client_address
                          - client_city
                          - client_postcode
                          - client_country
                          - client_state
                          - client_web
                          - client_notes
                        relationships:
                          type: object
                          properties:
                            sections:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items: {}
                              required:
                              - data
                            recipients:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items: {}
                              required:
                              - data
                          required:
                          - sections
                          - recipients
                      required:
                      - id
                      - type
                      - attributes
                      - relationships
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type:
                        - string
                        - 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type:
                        - integer
                        - 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
        '201':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          title:
                            type:
                            - string
                            - 'null'
                          account_id:
                            type: integer
                          status:
                            type: string
                          public_id:
                            type: string
                          document_number:
                            type: string
                          prepared_by_id:
                            type:
                            - integer
                            - 'null'
                          client_id:
                            type: 'null'
                          sender_id:
                            type: 'null'
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          sent_at:
                            type: 'null'
                          document_section_title:
                            type: 'null'
                          signed_at:
                            type: 'null'
                          accepted_at:
                            type: 'null'
                          force_signature:
                            type: boolean
                          expires_at:
                            type: 'null'
                          report:
                            type: boolean
                          exclude_total:
                            type: boolean
                          exclude_total_in_pdf:
                            type: boolean
                          display_date:
                            type: 'null'
                          present_date:
                            type: string
                          present_email:
                            type: string
                          archived_at:
                            type: 'null'
                          currency:
                            type: string
                          theme:
                            type: string
                          cover_image_url:
                            type: 'null'
                          empty_cover_image:
                            type: boolean
                          cover_opacity:
                            type: integer
                          cover_overlay_color:
                            type: 'null'
                          cover_overlay_dynamic_color:
                            type: 'null'
                          sender_name:
                            type: 'null'
                          source:
                            type: string
                          table_of_contents:
                            type: boolean
                          last_viewed_at:
                            type: 'null'
                          accepted_total_in_cents:
                            type: 'null'
                          accepted_total_formatted:
                            type: 'null'
                          payment_percentage:
                            type: integer
                          client_role:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          pdf_url:
                            type: string
                          account_name:
                            type: string
                          account_web:
                            type: string
                          account_email:
                            type: string
                          account_telephone:
                            type: string
                          account_address:
                            type: 'null'
                          account_address_state:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                          client_notes:
                            type: 'null'
                        required:
                        - title
                        - account_id
                        - status
                        - public_id
                        - document_number
                        - prepared_by_id
                        - client_id
                        - sender_id
                        - created_at
                        - updated_at
                        - sent_at
                        - document_section_title
                        - signed_at
                        - accepted_at
                        - force_signature
                        - expires_at
                        - report
                        - exclude_total
                        - exclude_total_in_pdf
                        - display_date
                        - present_date
                        - present_email
                        - archived_at
                        - currency
                        - theme
                        - cover_image_url
                        - empty_cover_image
                        - cover_opacity
                        - cover_overlay_color
                        - cover_overlay_dynamic_color
                        - sender_name
                        - source
                        - table_of_contents
                        - last_viewed_at
                        - accepted_total_in_cents
                        - accepted_total_formatted
                        - payment_percentage
                        - client_role
                        - client_locale
                        - pdf_url
                        - account_name
                        - account_web
                        - account_email
                        - account_telephone
                        - account_address
                        - account_address_state
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_address
                        - client_city
                        - client_postcode
                        - client_country
                        - client_state
                        - client_web
                        - client_notes
                      relationships:
                        type: object
                        properties:
                          sections:
                            type: object
                            properties:
                              data:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                  - id
                                  - type
                            required:
                            - data
                          recipients:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                        required:
                        - sections
                        - recipients
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                required:
                - data
        '403':
          description: blocks POST 'create'
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
        '404':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
        '422':
          description: returns unprocessable content with error message
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                proposal:
                  type: object
                  properties:
                    title:
                      type: string
                    payment_percentage:
                      type: string
                    template_id:
                      type: string
                    prepared_by_id:
                      type: string
              required:
              - proposal
          application/json:
            schema:
              type: object
              properties:
                archived:
                  type: boolean
                page:
                  type: integer
                per:
                  type: integer
  "/api/v2/proposals/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::Proposal
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          title:
                            type: string
                          account_id:
                            type: integer
                          status:
                            type: string
                          public_id:
                            type: string
                          document_number:
                            type: 'null'
                          prepared_by_id:
                            type: 'null'
                          client_id:
                            type: 'null'
                          sender_id:
                            type: 'null'
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          sent_at:
                            type: 'null'
                          document_section_title:
                            type: 'null'
                          signed_at:
                            type: 'null'
                          accepted_at:
                            type: 'null'
                          force_signature:
                            type: boolean
                          expires_at:
                            type: 'null'
                          report:
                            type: boolean
                          exclude_total:
                            type: boolean
                          exclude_total_in_pdf:
                            type: boolean
                          display_date:
                            type: 'null'
                          present_date:
                            type: string
                          present_email:
                            type: string
                          archived_at:
                            type: 'null'
                          currency:
                            type: string
                          theme:
                            type: string
                          cover_image_url:
                            type: 'null'
                          empty_cover_image:
                            type: boolean
                          cover_opacity:
                            type: integer
                          cover_overlay_color:
                            type: 'null'
                          cover_overlay_dynamic_color:
                            type: 'null'
                          sender_name:
                            type: 'null'
                          source:
                            type: string
                          table_of_contents:
                            type: boolean
                          last_viewed_at:
                            type: 'null'
                          accepted_total_in_cents:
                            type: 'null'
                          accepted_total_formatted:
                            type: 'null'
                          payment_percentage:
                            type: integer
                          client_role:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          pdf_url:
                            type: string
                          account_name:
                            type: string
                          account_web:
                            type: string
                          account_email:
                            type: string
                          account_telephone:
                            type: string
                          account_address:
                            type: 'null'
                          account_address_state:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                          client_notes:
                            type: 'null'
                        required:
                        - title
                        - account_id
                        - status
                        - public_id
                        - document_number
                        - prepared_by_id
                        - client_id
                        - sender_id
                        - created_at
                        - updated_at
                        - sent_at
                        - document_section_title
                        - signed_at
                        - accepted_at
                        - force_signature
                        - expires_at
                        - report
                        - exclude_total
                        - exclude_total_in_pdf
                        - display_date
                        - present_date
                        - present_email
                        - archived_at
                        - currency
                        - theme
                        - cover_image_url
                        - empty_cover_image
                        - cover_opacity
                        - cover_overlay_color
                        - cover_overlay_dynamic_color
                        - sender_name
                        - source
                        - table_of_contents
                        - last_viewed_at
                        - accepted_total_in_cents
                        - accepted_total_formatted
                        - payment_percentage
                        - client_role
                        - client_locale
                        - pdf_url
                        - account_name
                        - account_web
                        - account_email
                        - account_telephone
                        - account_address
                        - account_address_state
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_address
                        - client_city
                        - client_postcode
                        - client_country
                        - client_state
                        - client_web
                        - client_notes
                      relationships:
                        type: object
                        properties:
                          sections:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                          recipients:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                        required:
                        - sections
                        - recipients
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                required:
                - data
    get:
      summary: show
      tags:
      - Api::V2::Proposal
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: includes recipients in the response
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          title:
                            type: string
                          account_id:
                            type: integer
                          status:
                            type: string
                          public_id:
                            type: string
                          document_number:
                            type: 'null'
                          prepared_by_id:
                            type: 'null'
                          client_id:
                            type: 'null'
                          sender_id:
                            type: 'null'
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          sent_at:
                            type: 'null'
                          document_section_title:
                            type: 'null'
                          signed_at:
                            type: 'null'
                          accepted_at:
                            type: 'null'
                          force_signature:
                            type: boolean
                          expires_at:
                            type: 'null'
                          report:
                            type: boolean
                          exclude_total:
                            type: boolean
                          exclude_total_in_pdf:
                            type: boolean
                          display_date:
                            type: 'null'
                          present_date:
                            type: string
                          present_email:
                            type: string
                          archived_at:
                            type: 'null'
                          currency:
                            type: string
                          theme:
                            type: string
                          cover_image_url:
                            type: 'null'
                          empty_cover_image:
                            type: boolean
                          cover_opacity:
                            type: integer
                          cover_overlay_color:
                            type: 'null'
                          cover_overlay_dynamic_color:
                            type: 'null'
                          sender_name:
                            type: 'null'
                          source:
                            type: string
                          table_of_contents:
                            type: boolean
                          last_viewed_at:
                            type: 'null'
                          accepted_total_in_cents:
                            type: 'null'
                          accepted_total_formatted:
                            type: 'null'
                          payment_percentage:
                            type: integer
                          client_role:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          pdf_url:
                            type: string
                          account_name:
                            type: string
                          account_web:
                            type: string
                          account_email:
                            type: string
                          account_telephone:
                            type: string
                          account_address:
                            type: 'null'
                          account_address_state:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                          client_notes:
                            type: 'null'
                        required:
                        - title
                        - account_id
                        - status
                        - public_id
                        - document_number
                        - prepared_by_id
                        - client_id
                        - sender_id
                        - created_at
                        - updated_at
                        - sent_at
                        - document_section_title
                        - signed_at
                        - accepted_at
                        - force_signature
                        - expires_at
                        - report
                        - exclude_total
                        - exclude_total_in_pdf
                        - display_date
                        - present_date
                        - present_email
                        - archived_at
                        - currency
                        - theme
                        - cover_image_url
                        - empty_cover_image
                        - cover_opacity
                        - cover_overlay_color
                        - cover_overlay_dynamic_color
                        - sender_name
                        - source
                        - table_of_contents
                        - last_viewed_at
                        - accepted_total_in_cents
                        - accepted_total_formatted
                        - payment_percentage
                        - client_role
                        - client_locale
                        - pdf_url
                        - account_name
                        - account_web
                        - account_email
                        - account_telephone
                        - account_address
                        - account_address_state
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_address
                        - client_city
                        - client_postcode
                        - client_country
                        - client_state
                        - client_web
                        - client_notes
                      relationships:
                        type: object
                        properties:
                          sections:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                          recipients:
                            type: object
                            properties:
                              data:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                  - id
                                  - type
                            required:
                            - data
                        required:
                        - sections
                        - recipients
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                required:
                - data
        '404':
          description: returns http not found when proposal is deleted
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
    put:
      summary: update
      tags:
      - Api::V2::Proposal
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          title:
                            type: string
                          account_id:
                            type: integer
                          status:
                            type: string
                          public_id:
                            type: string
                          document_number:
                            type: 'null'
                          prepared_by_id:
                            type: 'null'
                          client_id:
                            type: 'null'
                          sender_id:
                            type: 'null'
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          sent_at:
                            type: 'null'
                          document_section_title:
                            type: 'null'
                          signed_at:
                            type: 'null'
                          accepted_at:
                            type: 'null'
                          force_signature:
                            type: boolean
                          expires_at:
                            type: 'null'
                          report:
                            type: boolean
                          exclude_total:
                            type: boolean
                          exclude_total_in_pdf:
                            type: boolean
                          display_date:
                            type: 'null'
                          present_date:
                            type: string
                          present_email:
                            type: string
                          archived_at:
                            type: 'null'
                          currency:
                            type: string
                          theme:
                            type: string
                          cover_image_url:
                            type: 'null'
                          empty_cover_image:
                            type: boolean
                          cover_opacity:
                            type: integer
                          cover_overlay_color:
                            type: 'null'
                          cover_overlay_dynamic_color:
                            type: 'null'
                          sender_name:
                            type: 'null'
                          source:
                            type: string
                          table_of_contents:
                            type: boolean
                          last_viewed_at:
                            type: 'null'
                          accepted_total_in_cents:
                            type: 'null'
                          accepted_total_formatted:
                            type: 'null'
                          payment_percentage:
                            type: integer
                          client_role:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          pdf_url:
                            type: string
                          account_name:
                            type: string
                          account_web:
                            type: string
                          account_email:
                            type: string
                          account_telephone:
                            type: string
                          account_address:
                            type: 'null'
                          account_address_state:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                          client_notes:
                            type: 'null'
                        required:
                        - title
                        - account_id
                        - status
                        - public_id
                        - document_number
                        - prepared_by_id
                        - client_id
                        - sender_id
                        - created_at
                        - updated_at
                        - sent_at
                        - document_section_title
                        - signed_at
                        - accepted_at
                        - force_signature
                        - expires_at
                        - report
                        - exclude_total
                        - exclude_total_in_pdf
                        - display_date
                        - present_date
                        - present_email
                        - archived_at
                        - currency
                        - theme
                        - cover_image_url
                        - empty_cover_image
                        - cover_opacity
                        - cover_overlay_color
                        - cover_overlay_dynamic_color
                        - sender_name
                        - source
                        - table_of_contents
                        - last_viewed_at
                        - accepted_total_in_cents
                        - accepted_total_formatted
                        - payment_percentage
                        - client_role
                        - client_locale
                        - pdf_url
                        - account_name
                        - account_web
                        - account_email
                        - account_telephone
                        - account_address
                        - account_address_state
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_address
                        - client_city
                        - client_postcode
                        - client_country
                        - client_state
                        - client_web
                        - client_notes
                      relationships:
                        type: object
                        properties:
                          sections:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                          recipients:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                        required:
                        - sections
                        - recipients
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                required:
                - data
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                proposal:
                  type: object
                  properties:
                    title:
                      type: string
                  required:
                  - title
              required:
              - proposal
  "/api/v2/proposals/{id}/archive":
    put:
      summary: archive
      tags:
      - Api::V2::Proposal
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties: {}
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          title:
                            type: string
                          account_id:
                            type: integer
                          status:
                            type: string
                          public_id:
                            type: string
                          document_number:
                            type: 'null'
                          prepared_by_id:
                            type: 'null'
                          client_id:
                            type: 'null'
                          sender_id:
                            type: 'null'
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          sent_at:
                            type: 'null'
                          document_section_title:
                            type: 'null'
                          signed_at:
                            type: 'null'
                          accepted_at:
                            type: 'null'
                          force_signature:
                            type: boolean
                          expires_at:
                            type: 'null'
                          report:
                            type: boolean
                          exclude_total:
                            type: boolean
                          exclude_total_in_pdf:
                            type: boolean
                          display_date:
                            type: 'null'
                          present_date:
                            type: string
                          present_email:
                            type: string
                          archived_at:
                            type: string
                          currency:
                            type: string
                          theme:
                            type: string
                          cover_image_url:
                            type: 'null'
                          empty_cover_image:
                            type: boolean
                          cover_opacity:
                            type: integer
                          cover_overlay_color:
                            type: 'null'
                          cover_overlay_dynamic_color:
                            type: 'null'
                          sender_name:
                            type: 'null'
                          source:
                            type: string
                          table_of_contents:
                            type: boolean
                          last_viewed_at:
                            type: 'null'
                          accepted_total_in_cents:
                            type: 'null'
                          accepted_total_formatted:
                            type: 'null'
                          payment_percentage:
                            type: integer
                          client_role:
                            type: 'null'
                          client_locale:
                            type: 'null'
                          pdf_url:
                            type: string
                          account_name:
                            type: string
                          account_web:
                            type: string
                          account_email:
                            type: string
                          account_telephone:
                            type: string
                          account_address:
                            type: 'null'
                          account_address_state:
                            type: 'null'
                          client_name:
                            type: 'null'
                          client_email:
                            type: 'null'
                          client_surname:
                            type: 'null'
                          client_full_name:
                            type: 'null'
                          client_business:
                            type: 'null'
                          client_telephone:
                            type: 'null'
                          client_address:
                            type: 'null'
                          client_city:
                            type: 'null'
                          client_postcode:
                            type: 'null'
                          client_country:
                            type: 'null'
                          client_state:
                            type: 'null'
                          client_web:
                            type: 'null'
                          client_notes:
                            type: 'null'
                        required:
                        - title
                        - account_id
                        - status
                        - public_id
                        - document_number
                        - prepared_by_id
                        - client_id
                        - sender_id
                        - created_at
                        - updated_at
                        - sent_at
                        - document_section_title
                        - signed_at
                        - accepted_at
                        - force_signature
                        - expires_at
                        - report
                        - exclude_total
                        - exclude_total_in_pdf
                        - display_date
                        - present_date
                        - present_email
                        - archived_at
                        - currency
                        - theme
                        - cover_image_url
                        - empty_cover_image
                        - cover_opacity
                        - cover_overlay_color
                        - cover_overlay_dynamic_color
                        - sender_name
                        - source
                        - table_of_contents
                        - last_viewed_at
                        - accepted_total_in_cents
                        - accepted_total_formatted
                        - payment_percentage
                        - client_role
                        - client_locale
                        - pdf_url
                        - account_name
                        - account_web
                        - account_email
                        - account_telephone
                        - account_address
                        - account_address_state
                        - client_name
                        - client_email
                        - client_surname
                        - client_full_name
                        - client_business
                        - client_telephone
                        - client_address
                        - client_city
                        - client_postcode
                        - client_country
                        - client_state
                        - client_web
                        - client_notes
                      relationships:
                        type: object
                        properties:
                          sections:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                          recipients:
                            type: object
                            properties:
                              data:
                                type: array
                                items: {}
                            required:
                            - data
                        required:
                        - sections
                        - recipients
                    required:
                    - id
                    - type
                    - attributes
                    - relationships
                required:
                - data
  "/api/v2/proposals/{id}/send_proposal":
    put:
      summary: send_proposal
      tags:
      - Api::V2::Proposal
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                sender_email:
                  type: string
                subject:
                  type: string
                email:
                  type: string
                message:
                  type: string
              required:
              - subject
              - email
          application/json:
            schema:
              type: object
              properties:
                sender_email:
                  type: string
                subject:
                  type: string
                message:
                  type: string
                recipients:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      email:
                        type: string
                      eligible_to_sign:
                        type: boolean
                    required:
                    - name
                    - email
                    - eligible_to_sign
              required:
              - sender_email
              - subject
              - message
              - recipients
      responses:
        '200':
          description: sends normally, even when a sibling proposal is at the limit
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  sent_at:
                    type: string
                  sender_id:
                    type: integer
                  sender_name:
                    type: string
                required:
                - status
                - sent_at
                - sender_id
                - sender_name
        '402':
          description: returns forbidden when active proposal limit is reached
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '403':
          description: marks the account suspicious and notifies the customer and
            the spam alert address
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '422':
          description: does not suspend
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
  "/api/v2/proposals/{proposal_id}/taxations":
    get:
      summary: index
      tags:
      - Api::V2::Taxation
      parameters:
      - name: proposal_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            name:
                              type: string
                            percentage:
                              type: string
                            created_at:
                              type: string
                            updated_at:
                              type: string
                          required:
                          - name
                          - percentage
                          - created_at
                          - updated_at
                      required:
                      - id
                      - type
                      - attributes
                required:
                - data
    post:
      summary: create
      tags:
      - Api::V2::Taxation
      parameters:
      - name: proposal_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                percentage:
                  type: string
                name:
                  type: string
              required:
              - percentage
              - name
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                          percentage:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                        required:
                        - name
                        - percentage
                        - created_at
                        - updated_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
  "/api/v2/proposals/{proposal_id}/taxations/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::Taxation
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: proposal_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                          percentage:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                        required:
                        - name
                        - percentage
                        - created_at
                        - updated_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
    put:
      summary: update
      tags:
      - Api::V2::Taxation
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: proposal_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                          percentage:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                        required:
                        - name
                        - percentage
                        - created_at
                        - updated_at
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                percentage:
                  type: string
                name:
                  type: string
              required:
              - percentage
              - name
  "/api/v2/sections":
    get:
      summary: index
      tags:
      - Api::V2::Section
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            currency:
                              type: string
                            account_id:
                              type: integer
                            proposal_id:
                              type:
                              - integer
                              - 'null'
                            template_id:
                              type:
                              - integer
                              - 'null'
                            title:
                              type: string
                            name:
                              type: string
                            body:
                              type: string
                            position:
                              type: integer
                            reusable:
                              type: boolean
                            section_type:
                              type: string
                            created_at:
                              type: string
                            updated_at:
                              type: string
                            page_break:
                              type: boolean
                            optional:
                              type: boolean
                            selected:
                              type: boolean
                            include_total:
                              type: boolean
                            total_in_cents:
                              type: integer
                            total_formatted:
                              type: string
                            maximum_total_in_cents:
                              type: 'null'
                            maximum_total_formatted:
                              type: 'null'
                          required:
                          - currency
                          - account_id
                          - proposal_id
                          - template_id
                          - title
                          - name
                          - body
                          - position
                          - reusable
                          - section_type
                          - created_at
                          - updated_at
                          - page_break
                          - optional
                          - selected
                          - include_total
                          - total_in_cents
                          - total_formatted
                          - maximum_total_in_cents
                          - maximum_total_formatted
                        relationships:
                          type: object
                          properties:
                            line_items:
                              type: object
                              properties:
                                data:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                    - id
                                    - type
                              required:
                              - data
                          required:
                          - line_items
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                  included:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            section_id:
                              type: integer
                            name:
                              type: string
                            position:
                              type: integer
                            cost_type:
                              type: string
                            recurring_type:
                              type: 'null'
                            per_type:
                              type: 'null'
                            choice_type:
                              type: string
                            quantity:
                              type: 'null'
                            updated_at:
                              type: string
                            created_at:
                              type: string
                            currency:
                              type: string
                            amount:
                              type: integer
                            amount_formatted:
                              type: string
                            amount_in_cents:
                              type: integer
                            maximum_amount_in_cents:
                              type: 'null'
                            maximum_amount_formatted:
                              type: 'null'
                            total_in_cents:
                              type: integer
                            total_formatted:
                              type: string
                          required:
                          - section_id
                          - name
                          - position
                          - cost_type
                          - recurring_type
                          - per_type
                          - choice_type
                          - quantity
                          - updated_at
                          - created_at
                          - currency
                          - amount
                          - amount_formatted
                          - amount_in_cents
                          - maximum_amount_in_cents
                          - maximum_amount_formatted
                          - total_in_cents
                          - total_formatted
                      required:
                      - id
                      - type
                      - attributes
                required:
                - data
                - links
                - meta
      parameters:
      - name: proposal_id
        in: query
        required: false
        schema:
          type: integer
      - name: template_id
        in: query
        required: false
        schema:
          type: integer
    post:
      summary: create
      tags:
      - Api::V2::Section
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                section:
                  type: object
                  properties:
                    title:
                      type: string
                    template_id:
                      type: string
                    proposal_id:
                      type: string
                    name:
                      type: string
                section_id:
                  type: string
      responses:
        '201':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          currency:
                            type: string
                          account_id:
                            type: integer
                          proposal_id:
                            type:
                            - integer
                            - 'null'
                          template_id:
                            type:
                            - integer
                            - 'null'
                          title:
                            type: string
                          name:
                            type: string
                          body:
                            type:
                            - string
                            - 'null'
                          position:
                            type: integer
                          reusable:
                            type: boolean
                          section_type:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          page_break:
                            type: boolean
                          optional:
                            type: boolean
                          selected:
                            type: boolean
                          include_total:
                            type: boolean
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                          maximum_total_in_cents:
                            type: 'null'
                          maximum_total_formatted:
                            type: 'null'
                        required:
                        - currency
                        - account_id
                        - proposal_id
                        - template_id
                        - title
                        - name
                        - body
                        - position
                        - reusable
                        - section_type
                        - created_at
                        - updated_at
                        - page_break
                        - optional
                        - selected
                        - include_total
                        - total_in_cents
                        - total_formatted
                        - maximum_total_in_cents
                        - maximum_total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                  error:
                    type: string
                  message:
                    type: string
  "/api/v2/sections/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::Section
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          currency:
                            type: string
                          account_id:
                            type: integer
                          proposal_id:
                            type: 'null'
                          template_id:
                            type: 'null'
                          title:
                            type: string
                          name:
                            type: string
                          body:
                            type: string
                          position:
                            type: integer
                          reusable:
                            type: boolean
                          section_type:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          page_break:
                            type: boolean
                          optional:
                            type: boolean
                          selected:
                            type: boolean
                          include_total:
                            type: boolean
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                          maximum_total_in_cents:
                            type: 'null'
                          maximum_total_formatted:
                            type: 'null'
                        required:
                        - currency
                        - account_id
                        - proposal_id
                        - template_id
                        - title
                        - name
                        - body
                        - position
                        - reusable
                        - section_type
                        - created_at
                        - updated_at
                        - page_break
                        - optional
                        - selected
                        - include_total
                        - total_in_cents
                        - total_formatted
                        - maximum_total_in_cents
                        - maximum_total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '410':
          description: returns gone with error message
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                required:
                - error
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                required:
                - error
                - message
    get:
      summary: show
      tags:
      - Api::V2::Section
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: serializes a nil maximum total when the total is not a range
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          currency:
                            type: string
                          account_id:
                            type: integer
                          proposal_id:
                            type: 'null'
                          template_id:
                            type: 'null'
                          title:
                            type: string
                          name:
                            type: string
                          body:
                            type: string
                          position:
                            type: integer
                          reusable:
                            type: boolean
                          section_type:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          page_break:
                            type: boolean
                          optional:
                            type: boolean
                          selected:
                            type: boolean
                          include_total:
                            type: boolean
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                          maximum_total_in_cents:
                            type:
                            - integer
                            - 'null'
                          maximum_total_formatted:
                            type:
                            - string
                            - 'null'
                        required:
                        - currency
                        - account_id
                        - proposal_id
                        - template_id
                        - title
                        - name
                        - body
                        - position
                        - reusable
                        - section_type
                        - created_at
                        - updated_at
                        - page_break
                        - optional
                        - selected
                        - include_total
                        - total_in_cents
                        - total_formatted
                        - maximum_total_in_cents
                        - maximum_total_formatted
                      relationships:
                        type: object
                        properties:
                          line_items:
                            type: object
                            properties:
                              data:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    id:
                                      type: string
                                    type:
                                      type: string
                                  required:
                                  - id
                                  - type
                            required:
                            - data
                        required:
                        - line_items
                    required:
                    - id
                    - type
                    - attributes
                  included:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            section_id:
                              type: integer
                            name:
                              type: string
                            position:
                              type: integer
                            cost_type:
                              type: string
                            recurring_type:
                              type: 'null'
                            per_type:
                              type: 'null'
                            choice_type:
                              type: string
                            quantity:
                              type: 'null'
                            updated_at:
                              type: string
                            created_at:
                              type: string
                            currency:
                              type: string
                            amount:
                              type: integer
                            amount_formatted:
                              type: string
                            amount_in_cents:
                              type: integer
                            maximum_amount_in_cents:
                              type:
                              - integer
                              - 'null'
                            maximum_amount_formatted:
                              type:
                              - string
                              - 'null'
                            total_in_cents:
                              type: integer
                            total_formatted:
                              type: string
                          required:
                          - section_id
                          - name
                          - position
                          - cost_type
                          - recurring_type
                          - per_type
                          - choice_type
                          - quantity
                          - updated_at
                          - created_at
                          - currency
                          - amount
                          - amount_formatted
                          - amount_in_cents
                          - maximum_amount_in_cents
                          - maximum_amount_formatted
                          - total_in_cents
                          - total_formatted
                      required:
                      - id
                      - type
                      - attributes
                required:
                - data
        '404':
          description: returns not found when section belongs to another account
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
    put:
      summary: update
      tags:
      - Api::V2::Section
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          currency:
                            type: string
                          account_id:
                            type: integer
                          proposal_id:
                            type: 'null'
                          template_id:
                            type: 'null'
                          title:
                            type: string
                          name:
                            type: string
                          body:
                            type: string
                          position:
                            type: integer
                          reusable:
                            type: boolean
                          section_type:
                            type: string
                          created_at:
                            type: string
                          updated_at:
                            type: string
                          page_break:
                            type: boolean
                          optional:
                            type: boolean
                          selected:
                            type: boolean
                          include_total:
                            type: boolean
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                          maximum_total_in_cents:
                            type: 'null'
                          maximum_total_formatted:
                            type: 'null'
                        required:
                        - currency
                        - account_id
                        - proposal_id
                        - template_id
                        - title
                        - name
                        - body
                        - position
                        - reusable
                        - section_type
                        - created_at
                        - updated_at
                        - page_break
                        - optional
                        - selected
                        - include_total
                        - total_in_cents
                        - total_formatted
                        - maximum_total_in_cents
                        - maximum_total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                  error:
                    type: string
                  message:
                    type: string
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                section:
                  type: object
                  properties:
                    title:
                      type: string
                  required:
                  - title
              required:
              - section
  "/api/v2/sections/{section_id}/line_items":
    get:
      summary: index
      tags:
      - Api::V2::LineItem
      parameters:
      - name: section_id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            section_id:
                              type: integer
                            name:
                              type: string
                            position:
                              type: integer
                            cost_type:
                              type: string
                            recurring_type:
                              type: 'null'
                            per_type:
                              type: 'null'
                            choice_type:
                              type: string
                            quantity:
                              type: 'null'
                            updated_at:
                              type: string
                            created_at:
                              type: string
                            currency:
                              type: string
                            amount:
                              type: integer
                            amount_formatted:
                              type: string
                            amount_in_cents:
                              type: integer
                            maximum_amount_in_cents:
                              type: 'null'
                            maximum_amount_formatted:
                              type: 'null'
                            total_in_cents:
                              type: integer
                            total_formatted:
                              type: string
                          required:
                          - section_id
                          - name
                          - position
                          - cost_type
                          - recurring_type
                          - per_type
                          - choice_type
                          - quantity
                          - updated_at
                          - created_at
                          - currency
                          - amount
                          - amount_formatted
                          - amount_in_cents
                          - maximum_amount_in_cents
                          - maximum_amount_formatted
                          - total_in_cents
                          - total_formatted
                      required:
                      - id
                      - type
                      - attributes
                required:
                - data
    post:
      summary: create
      tags:
      - Api::V2::LineItem
      parameters:
      - name: section_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                line_item:
                  type: object
                  properties:
                    name:
                      type: string
                    maximum_amount:
                      type: string
                    cost_type:
                      type: string
                    amount:
                      type: string
                  required:
                  - name
              required:
              - line_item
      responses:
        '201':
          description: ignores the maximum amount
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          section_id:
                            type: integer
                          name:
                            type: string
                          position:
                            type: integer
                          cost_type:
                            type: string
                          recurring_type:
                            type: 'null'
                          per_type:
                            type: 'null'
                          choice_type:
                            type: string
                          quantity:
                            type: 'null'
                          updated_at:
                            type: string
                          created_at:
                            type: string
                          currency:
                            type: string
                          amount:
                            type: integer
                          amount_formatted:
                            type: string
                          amount_in_cents:
                            type: integer
                          maximum_amount_in_cents:
                            type:
                            - integer
                            - 'null'
                          maximum_amount_formatted:
                            type:
                            - string
                            - 'null'
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                        required:
                        - section_id
                        - name
                        - position
                        - cost_type
                        - recurring_type
                        - per_type
                        - choice_type
                        - quantity
                        - updated_at
                        - created_at
                        - currency
                        - amount
                        - amount_formatted
                        - amount_in_cents
                        - maximum_amount_in_cents
                        - maximum_amount_formatted
                        - total_in_cents
                        - total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns proposal locked error
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  message:
                    type: string
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
  "/api/v2/sections/{section_id}/line_items/{id}":
    put:
      summary: update
      tags:
      - Api::V2::LineItem
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - name: section_id
        in: path
        required: true
        schema:
          type: integer
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                line_item:
                  type: object
                  properties:
                    name:
                      type: string
                  required:
                  - name
              required:
              - line_item
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          section_id:
                            type: integer
                          name:
                            type: string
                          position:
                            type: integer
                          cost_type:
                            type: string
                          recurring_type:
                            type: 'null'
                          per_type:
                            type: 'null'
                          choice_type:
                            type: string
                          quantity:
                            type: 'null'
                          updated_at:
                            type: string
                          created_at:
                            type: string
                          currency:
                            type: string
                          amount:
                            type: integer
                          amount_formatted:
                            type: string
                          amount_in_cents:
                            type: integer
                          maximum_amount_in_cents:
                            type: 'null'
                          maximum_amount_formatted:
                            type: 'null'
                          total_in_cents:
                            type: integer
                          total_formatted:
                            type: string
                        required:
                        - section_id
                        - name
                        - position
                        - cost_type
                        - recurring_type
                        - per_type
                        - choice_type
                        - quantity
                        - updated_at
                        - created_at
                        - currency
                        - amount
                        - amount_formatted
                        - amount_in_cents
                        - maximum_amount_in_cents
                        - maximum_amount_formatted
                        - total_in_cents
                        - total_formatted
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
  "/api/v2/templates":
    get:
      summary: index
      tags:
      - Api::V2::Template
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            name:
                              type: string
                            created_at:
                              type: string
                            public_template:
                              type: boolean
                          required:
                          - name
                          - created_at
                          - public_template
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
      parameters:
      - name: public_templates
        in: query
        required: false
        schema:
          type: boolean
  "/api/v2/templates/{id}":
    get:
      summary: show
      tags:
      - Api::V2::Template
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          name:
                            type: string
                          account_id:
                            type: integer
                          created_at:
                            type: string
                          public_template:
                            type: boolean
                          dummy_template:
                            type: boolean
                        required:
                        - name
                        - account_id
                        - created_at
                        - public_template
                        - dummy_template
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns http not found when proposal is deleted
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
  "/api/v2/themes":
    get:
      summary: index
      tags:
      - Api::V2::Theme
      responses:
        '200':
          description: returns http success
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: string
                    name:
                      type: string
                  required:
                  - id
                  - name
  "/api/v2/users":
    get:
      summary: index
      tags:
      - Api::V2::User
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            email:
                              type: string
                            name:
                              type: string
                          required:
                          - email
                          - name
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
  "/api/v2/webhook_endpoints":
    get:
      summary: index
      tags:
      - Api::V2::Webhook::Endpoint
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                        type:
                          type: string
                        attributes:
                          type: object
                          properties:
                            events:
                              type: array
                              items:
                                type: string
                            target_url:
                              type: string
                          required:
                          - events
                          - target_url
                      required:
                      - id
                      - type
                      - attributes
                  links:
                    type: object
                    properties:
                      self:
                        type: string
                      first:
                        type: string
                      prev:
                        type: 'null'
                      next:
                        type: 'null'
                      last:
                        type: string
                    required:
                    - self
                    - first
                    - prev
                    - next
                    - last
                  meta:
                    type: object
                    properties:
                      current_page:
                        type: integer
                      next_page:
                        type: 'null'
                      prev_page:
                        type: 'null'
                      total_pages:
                        type: integer
                      total_count:
                        type: integer
                    required:
                    - current_page
                    - next_page
                    - prev_page
                    - total_pages
                    - total_count
                required:
                - data
                - links
                - meta
    post:
      summary: create
      tags:
      - Api::V2::Webhook::Endpoint
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                webhook_endpoint:
                  type: object
                  properties:
                    target_url:
                      type: string
                    events:
                      type: array
                      items:
                        type: string
                  required:
                  - target_url
                  - events
              required:
              - webhook_endpoint
      responses:
        '201':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          events:
                            type: array
                            items:
                              type: string
                          target_url:
                            type: string
                        required:
                        - events
                        - target_url
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '422':
          description: returns http unprocessable entity
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
  "/api/v2/webhook_endpoints/{id}":
    delete:
      summary: destroy
      tags:
      - Api::V2::Webhook::Endpoint
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          events:
                            type: array
                            items:
                              type: string
                          target_url:
                            type: string
                        required:
                        - events
                        - target_url
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
    get:
      summary: show
      tags:
      - Api::V2::Webhook::Endpoint
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      responses:
        '200':
          description: returns http success
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                      attributes:
                        type: object
                        properties:
                          events:
                            type: array
                            items:
                              type: string
                          target_url:
                            type: string
                        required:
                        - events
                        - target_url
                    required:
                    - id
                    - type
                    - attributes
                required:
                - data
        '404':
          description: returns http not found when proposal isn't there
          content:
            application/vnd.api+json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    items:
                      type: object
                      properties:
                        source:
                          type: object
                          properties:
                            pointer:
                              type: string
                          required:
                          - pointer
                        detail:
                          type: string
                      required:
                      - source
                      - detail
                required:
                - errors
components:
  securitySchemes:
    TokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key authentication: `Authorization: Token token=YOUR_API_KEY`'
    OAuthBearer:
      type: http
      scheme: bearer
      description: OAuth 2.0 access token
