openapi: 3.1.0
info:
  title: Fincome API
  version: v1
  description: >
    # Introduction


    Welcome to Fincome's API documentation! This API allows you to import and
    manage the data of your Fincome account.


    ## Authentication

    First, go to your account settings, tab "Developers", and click on "Create a
    secret key".


    ## Base API URL

    The base API URL is `https://api2.fincome.co/product`.


    ## Pagination


    The `list` endpoints (e.g. `GET /v1/import/invoicing/subscription`) are

    **cursor-paginated**. Each response is an envelope:


    ```json

    {
      "data": [ /* up to `limit` records */ ],
      "next_cursor": "eyJ...",
      "has_more": true
    }

    ```


    Start a listing without a cursor, then pass the returned `next_cursor` back
    as

    the `cursor` query parameter to fetch the following page. Keep going until

    `has_more` is `false` (at which point `next_cursor` is `null`).


    | Parameter | Description |

    |-----------|-------------|

    | `limit` | Page size. Default `100`, maximum `1000`. |

    | `cursor` | Opaque cursor from the previous page's `next_cursor`. Omit for
    the first page. |

    | `order_by` | Sort column: `created_at` (default) or `updated_at`. |

    | `order` | Sort direction: `desc` (default) or `asc`. |

    | `created_since`, `created_before` | Restrict to a `created_at` window
    (inclusive, UTC ISO‑8601). |

    | `updated_since`, `updated_before` | Restrict to an `updated_at` window
    (inclusive, UTC ISO‑8601). Combine `updated_since` with
    `order_by=updated_at` for incremental sync. |


    The cursor encodes the active sort, so changing `order_by`/`order`
    mid-pagination

    is rejected — restart the listing (omit `cursor`) when you change the sort.


    Some resources expose additional filters; for example `subscription` accepts

    `customer_id` (the related customer's external id) and `status`

    (comma-separate to match several, e.g. `status=active,trialing`). See each

    endpoint for the filters it supports.
paths:
  /v1/import/invoicing/customer:
    get:
      summary: List customers
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of customers. It
        uses [cursor-based pagination](#pagination): start without a `cursor`,
        then pass the returned `next_cursor` to fetch the next page until
        `has_more` is `false`.
      operationId: List_customers_v1_import_invoicing_customer_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Customers
    post:
      summary: Create a new customer
      description: >-
        Use this endpoint to create a new customer. Custom properties are
        supported and can be set in the `custom_properties` (dictionary) inside
        the request body.
      operationId: Create_a_new_customer_v1_import_invoicing_customer_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerCreate'
              description: The customer to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Customers
  /v1/import/invoicing/customer/{id}:
    get:
      summary: Retrieve a customer by id
      description: Use this endpoint to retrieve a customer by providing its id.
      operationId: Retrieve_a_customer_by_id_v1_import_invoicing_customer__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the customer to retrieve
            title: Id
          description: The id of the customer to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Customers
    patch:
      summary: Update a customer by id
      description: >-
        Use this endpoint to update a customer by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_a_customer_by_id_v1_import_invoicing_customer__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the customer to update
            title: Id
          description: The id of the customer to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdate'
              description: The customer to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Customers
    delete:
      summary: Delete a customer by id
      description: Use this endpoint to delete a customer by providing its id.
      operationId: Delete_a_customer_by_id_v1_import_invoicing_customer__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the customer to delete
            title: Id
          description: The id of the customer to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Customers
  /v1/import/invoicing/product:
    get:
      summary: List products
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of products. It
        uses [cursor-based pagination](#pagination): start without a `cursor`,
        then pass the returned `next_cursor` to fetch the next page until
        `has_more` is `false`.
      operationId: List_products_v1_import_invoicing_product_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Products
    post:
      summary: Create a new product
      description: >-
        Use this endpoint to create a new product. Custom properties are
        supported and can be set in the `custom_properties` (dictionary) inside
        the request body.
      operationId: Create_a_new_product_v1_import_invoicing_product_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductCreate'
              description: The product to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Products
  /v1/import/invoicing/product/{id}:
    get:
      summary: Retrieve a product by id
      description: Use this endpoint to retrieve a product by providing its id.
      operationId: Retrieve_a_product_by_id_v1_import_invoicing_product__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the product to retrieve
            title: Id
          description: The id of the product to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Products
    patch:
      summary: Update a product by id
      description: >-
        Use this endpoint to update a product by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_a_product_by_id_v1_import_invoicing_product__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the product to update
            title: Id
          description: The id of the product to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductUpdate'
              description: The product to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Products
    delete:
      summary: Delete a product by id
      description: Use this endpoint to delete a product by providing its id.
      operationId: Delete_a_product_by_id_v1_import_invoicing_product__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the product to delete
            title: Id
          description: The id of the product to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Products
  /v1/import/invoicing/price:
    get:
      summary: List prices
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of prices. It uses
        [cursor-based pagination](#pagination): start without a `cursor`, then
        pass the returned `next_cursor` to fetch the next page until `has_more`
        is `false`.
      operationId: List_prices_v1_import_invoicing_price_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Prices
    post:
      summary: Create a new price
      description: >-
        Use this endpoint to create a new price. Custom properties are supported
        and can be set in the `custom_properties` (dictionary) inside the
        request body.
      operationId: Create_a_new_price_v1_import_invoicing_price_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceCreate'
              description: The price to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Prices
  /v1/import/invoicing/price/{id}:
    get:
      summary: Retrieve a price by id
      description: Use this endpoint to retrieve a price by providing its id.
      operationId: Retrieve_a_price_by_id_v1_import_invoicing_price__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the price to retrieve
            title: Id
          description: The id of the price to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Prices
    patch:
      summary: Update a price by id
      description: >-
        Use this endpoint to update a price by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_a_price_by_id_v1_import_invoicing_price__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the price to update
            title: Id
          description: The id of the price to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PriceUpdate'
              description: The price to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Prices
    delete:
      summary: Delete a price by id
      description: Use this endpoint to delete a price by providing its id.
      operationId: Delete_a_price_by_id_v1_import_invoicing_price__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the price to delete
            title: Id
          description: The id of the price to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Prices
  /v1/import/invoicing/invoice:
    get:
      summary: List invoices
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of invoices. It
        uses [cursor-based pagination](#pagination): start without a `cursor`,
        then pass the returned `next_cursor` to fetch the next page until
        `has_more` is `false`.
      operationId: List_invoices_v1_import_invoicing_invoice_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoices
    post:
      summary: Create a new invoice
      description: >-
        Use this endpoint to create a new invoice. Custom properties are
        supported and can be set in the `custom_properties` (dictionary) inside
        the request body.
      operationId: Create_a_new_invoice_v1_import_invoicing_invoice_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceCreate'
              description: The invoice to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoices
  /v1/import/invoicing/invoice/{id}:
    get:
      summary: Retrieve an invoice by id
      description: Use this endpoint to retrieve an invoice by providing its id.
      operationId: Retrieve_an_invoice_by_id_v1_import_invoicing_invoice__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice to retrieve
            title: Id
          description: The id of the invoice to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoices
    patch:
      summary: Update an invoice by id
      description: >-
        Use this endpoint to update an invoice by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_an_invoice_by_id_v1_import_invoicing_invoice__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice to update
            title: Id
          description: The id of the invoice to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceUpdate'
              description: The invoice to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoices
    delete:
      summary: Delete an invoice by id
      description: Use this endpoint to delete an invoice by providing its id.
      operationId: Delete_an_invoice_by_id_v1_import_invoicing_invoice__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice to delete
            title: Id
          description: The id of the invoice to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoices
  /v1/import/invoicing/credit_note:
    get:
      summary: List credit notes
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of credit notes.
        It uses [cursor-based pagination](#pagination): start without a
        `cursor`, then pass the returned `next_cursor` to fetch the next page
        until `has_more` is `false`.
      operationId: List_credit_notes_v1_import_invoicing_credit_note_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Notes
    post:
      summary: Create a new credit note
      description: >-
        Use this endpoint to create a new credit note. Custom properties are
        supported and can be set in the `custom_properties` (dictionary) inside
        the request body.
      operationId: Create_a_new_credit_note_v1_import_invoicing_credit_note_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditNoteCreate'
              description: The credit note to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Notes
  /v1/import/invoicing/credit_note/{id}:
    get:
      summary: Retrieve a credit note by id
      description: Use this endpoint to retrieve a credit note by providing its id.
      operationId: Retrieve_a_credit_note_by_id_v1_import_invoicing_credit_note__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note to retrieve
            title: Id
          description: The id of the credit note to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Notes
    patch:
      summary: Update a credit note by id
      description: >-
        Use this endpoint to update a credit note by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_a_credit_note_by_id_v1_import_invoicing_credit_note__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note to update
            title: Id
          description: The id of the credit note to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditNoteUpdate'
              description: The credit note to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Notes
    delete:
      summary: Delete a credit note by id
      description: Use this endpoint to delete a credit note by providing its id.
      operationId: Delete_a_credit_note_by_id_v1_import_invoicing_credit_note__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note to delete
            title: Id
          description: The id of the credit note to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Notes
  /v1/import/invoicing/subscription:
    get:
      summary: List subscriptions
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of subscriptions.
        It uses [cursor-based pagination](#pagination): start without a
        `cursor`, then pass the returned `next_cursor` to fetch the next page
        until `has_more` is `false`.
      operationId: List_subscriptions_v1_import_invoicing_subscription_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by customer_id (the related object's external id).
            title: Customer Id
          description: Filter by customer_id (the related object's external id).
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by status; comma-separate to match any. One of: active,
              canceled, paused, trialing, unpaid.
            title: Status
          description: >-
            Filter by status; comma-separate to match any. One of: active,
            canceled, paused, trialing, unpaid.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Subscriptions
    post:
      summary: Create a new subscription
      description: >-
        Use this endpoint to create a new subscription. Custom properties are
        supported and can be set in the `custom_properties` (dictionary) inside
        the request body.
      operationId: Create_a_new_subscription_v1_import_invoicing_subscription_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionCreate'
              description: The subscription to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Subscriptions
  /v1/import/invoicing/subscription/{id}:
    get:
      summary: Retrieve a subscription by id
      description: Use this endpoint to retrieve a subscription by providing its id.
      operationId: Retrieve_a_subscription_by_id_v1_import_invoicing_subscription__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the subscription to retrieve
            title: Id
          description: The id of the subscription to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Subscriptions
    patch:
      summary: Update a subscription by id
      description: >-
        Use this endpoint to update a subscription by id. Partial updates are
        supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: Update_a_subscription_by_id_v1_import_invoicing_subscription__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the subscription to update
            title: Id
          description: The id of the subscription to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubscriptionUpdate'
              description: The subscription to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Subscriptions
    delete:
      summary: Delete a subscription by id
      description: Use this endpoint to delete a subscription by providing its id.
      operationId: Delete_a_subscription_by_id_v1_import_invoicing_subscription__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the subscription to delete
            title: Id
          description: The id of the subscription to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Subscriptions
  /v1/import/invoicing/invoice_line_item:
    get:
      summary: List invoice line items
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of invoice line
        items. It uses [cursor-based pagination](#pagination): start without a
        `cursor`, then pass the returned `next_cursor` to fetch the next page
        until `has_more` is `false`.
      operationId: List_invoice_line_items_v1_import_invoicing_invoice_line_item_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceLineItemListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoice Line Items
    post:
      summary: Create a new invoice line item
      description: >-
        Use this endpoint to create a new invoice line item. Custom properties
        are supported and can be set in the `custom_properties` (dictionary)
        inside the request body.
      operationId: >-
        Create_a_new_invoice_line_item_v1_import_invoicing_invoice_line_item_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceLineItemCreate'
              description: The invoice line item to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceLineItemRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoice Line Items
  /v1/import/invoicing/invoice_line_item/{id}:
    get:
      summary: Retrieve an invoice line item by id
      description: Use this endpoint to retrieve an invoice line item by providing its id.
      operationId: >-
        Retrieve_an_invoice_line_item_by_id_v1_import_invoicing_invoice_line_item__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice line item to retrieve
            title: Id
          description: The id of the invoice line item to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceLineItemRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoice Line Items
    patch:
      summary: Update an invoice line item by id
      description: >-
        Use this endpoint to update an invoice line item by id. Partial updates
        are supported: only the fields specified in the request body will be
        updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: >-
        Update_an_invoice_line_item_by_id_v1_import_invoicing_invoice_line_item__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice line item to update
            title: Id
          description: The id of the invoice line item to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InvoiceLineItemUpdate'
              description: The invoice line item to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvoiceLineItemRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoice Line Items
    delete:
      summary: Delete an invoice line item by id
      description: Use this endpoint to delete an invoice line item by providing its id.
      operationId: >-
        Delete_an_invoice_line_item_by_id_v1_import_invoicing_invoice_line_item__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the invoice line item to delete
            title: Id
          description: The id of the invoice line item to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Invoice Line Items
  /v1/import/invoicing/credit_note_line_item:
    get:
      summary: List credit note line items
      description: >-
        Use this endpoint to retrieve a cursor-paginated list of credit note
        line items. It uses [cursor-based pagination](#pagination): start
        without a `cursor`, then pass the returned `next_cursor` to fetch the
        next page until `has_more` is `false`.
      operationId: >-
        List_credit_note_line_items_v1_import_invoicing_credit_note_line_item_get
      security:
        - APIKey: []
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 1000
            minimum: 1
            description: Page size (default 100, max 1000).
            default: 100
            title: Limit
          description: Page size (default 100, max 1000).
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Opaque cursor from a previous page's `next_cursor`. Omit for the
              first page.
            title: Cursor
          description: >-
            Opaque cursor from a previous page's `next_cursor`. Omit for the
            first page.
        - name: order_by
          in: query
          required: false
          schema:
            type: string
            description: 'Sort column. One of: created_at, updated_at.'
            default: created_at
            title: Order By
          description: 'Sort column. One of: created_at, updated_at.'
        - name: order
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction. One of: asc, desc.'
            default: desc
            title: Order
          description: 'Sort direction. One of: asc, desc.'
        - name: created_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or after this UTC timestamp (inclusive).
            title: Created Since
          description: Only records created at or after this UTC timestamp (inclusive).
        - name: created_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records created at or before this UTC timestamp (inclusive).
            title: Created Before
          description: Only records created at or before this UTC timestamp (inclusive).
        - name: updated_since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: >-
              Only records updated at or after this UTC timestamp (inclusive).
              Pair with `order_by=updated_at` for incremental sync.
            title: Updated Since
          description: >-
            Only records updated at or after this UTC timestamp (inclusive).
            Pair with `order_by=updated_at` for incremental sync.
        - name: updated_before
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only records updated at or before this UTC timestamp (inclusive).
            title: Updated Before
          description: Only records updated at or before this UTC timestamp (inclusive).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteLineItemListPage'
          message: Success
        '400':
          message: Bad request
          description: Bad Request
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Note Line Items
    post:
      summary: Create a new credit note line item
      description: >-
        Use this endpoint to create a new credit note line item. Custom
        properties are supported and can be set in the `custom_properties`
        (dictionary) inside the request body.
      operationId: >-
        Create_a_new_credit_note_line_item_v1_import_invoicing_credit_note_line_item_post
      security:
        - APIKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditNoteLineItemCreate'
              description: The credit note line item to create
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteLineItemRead'
          message: Object successfully created
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Note Line Items
  /v1/import/invoicing/credit_note_line_item/{id}:
    get:
      summary: Retrieve a credit note line item by id
      description: >-
        Use this endpoint to retrieve a credit note line item by providing its
        id.
      operationId: >-
        Retrieve_a_credit_note_line_item_by_id_v1_import_invoicing_credit_note_line_item__id__get
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note line item to retrieve
            title: Id
          description: The id of the credit note line item to retrieve
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteLineItemRead'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Note Line Items
    patch:
      summary: Update a credit note line item by id
      description: >-
        Use this endpoint to update a credit note line item by id. Partial
        updates are supported: only the fields specified in the request body
        will be updated. Custom properties are supported and can be set in the
        `custom_properties` (dictionary) inside the request body.
      operationId: >-
        Update_a_credit_note_line_item_by_id_v1_import_invoicing_credit_note_line_item__id__patch
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note line item to update
            title: Id
          description: The id of the credit note line item to update
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditNoteLineItemUpdate'
              description: The credit note line item to update
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditNoteLineItemRead'
          message: Object successfully updated
        '400':
          message: Bad request
          description: Bad Request
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Note Line Items
    delete:
      summary: Delete a credit note line item by id
      description: Use this endpoint to delete a credit note line item by providing its id.
      operationId: >-
        Delete_a_credit_note_line_item_by_id_v1_import_invoicing_credit_note_line_item__id__delete
      security:
        - APIKey: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            description: The id of the credit note line item to delete
            title: Id
          description: The id of the credit note line item to delete
      responses:
        '204':
          description: Successful Response
          message: Object successfully deleted
        '404':
          message: Object not found
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      tags:
        - Credit Note Line Items
  /v1/import/sources/invoicing/excel/initiate_upload:
    post:
      tags:
        - Import an Excel dataset
      summary: Initiate invoicing Excel upload
      description: >-
        Start the three-step invoicing Excel onboarding workflow.


        1. Call this endpoint to receive an `upload_id`, a presigned S3
        `upload.url`, and the form `upload.fields`.

        2. Upload the Excel workbook directly to S3 using the provided form
        fields.

        3. Invoke `/confirm_upload` with the same `upload_id` to validate the
        workbook and create the source.


        Requires API key with write permission on all invoicing tables.
      operationId: >-
        Initiate_invoicing_Excel_dataset_upload_v1_import_sources_invoicing_excel_initiate_upload_post
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExcelUploadResponse'
              example: &ref_1
                upload_id: 42
                upload: &ref_2
                  url: https://s3.eu-west-1.amazonaws.com/fincome-customer-uploads
                  fields:
                    key: customer_raw_data/123/tmp/csv_batches/42/excel.xlsx
                    policy: BASE64_ENCODED_POLICY
                    x-amz-algorithm: AWS4-HMAC-SHA256
                    x-amz-credential: AKIAIOSFODNN7EXAMPLE/20251028/eu-west-1/s3/aws4_request
                    x-amz-date: 20251028T120000Z
                    x-amz-signature: c7e6cbb9183eexample
                max_file_size: 1500000000
      security:
        - APIKey: []
  /v1/import/sources/invoicing/excel/confirm_upload:
    post:
      tags:
        - Import an Excel dataset
      summary: Confirm invoicing Excel upload
      description: >-
        Confirm that the Excel workbook has been uploaded to S3 and create the
        invoicing source.


        - Provide the `upload_id` returned by `/initiate_upload`.

        - Optionally include `freshness_date` to reflect the latest invoice date
        represented in the dataset.

        - The response returns the new source with a status such as `Pending
        connection` while ingestion is starting.


        Requires API key with write permission on all invoicing tables.
      operationId: >-
        Confirm_invoicing_Excel_dataset_upload_v1_import_sources_invoicing_excel_confirm_upload_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExcelConfirmRequest'
            example: &ref_0
              upload_id: 42
              name: January invoicing export
              freshness_date: '2025-01-15'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SourceSummary'
              example: &ref_3
                id: 987
                created_at: '2025-01-28T12:05:00Z'
                name: January invoicing export
                status: Pending connection
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKey: []
  /v1/export/metrics:
    get:
      tags:
        - Export API
      summary: List available metrics
      description: >-
        List the metrics available to your company, grouped into report families
        (one-level hierarchy). Address an individual metric by its `slug`.
      operationId: List_available_metrics_v1_export_metrics_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/MetricFamily'
                type: array
                title: Response List Available Metrics V1 Export Metrics Get
      security:
        - APIKey: []
  /v1/export/metrics/{slug}:
    get:
      tags:
        - Export API
      summary: Get a metric series
      description: >-
        Compute a single metric for the caller's company over an **inclusive
        period range** at the given grain. A date selects the whole period it
        falls in; the result spans every period from the one containing
        `date_start` through the one containing `date_end` (e.g. monthly
        `2024-05-01`→`2024-05-31` = May; `2024-05-01`→`2024-06-01` = May **and**
        June). Returns a UI-free `MetricResult` (`kind`, `series`, per-point
        `period_start`/`period_end`/`as_of`).
      operationId: Get_a_metric_series_v1_export_metrics__slug__get
      security:
        - APIKey: []
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: date_start
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO date (YYYY-MM-DD). Selects the period it falls in (inclusive).
              Defaults to one year before date_end.
            title: Date Start
          description: >-
            ISO date (YYYY-MM-DD). Selects the period it falls in (inclusive).
            Defaults to one year before date_end.
        - name: date_end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              ISO date (YYYY-MM-DD). Selects the period it falls in (inclusive —
              end within a month to exclude the next one). Defaults to the
              company freshness date (current period included).
            title: Date End
          description: >-
            ISO date (YYYY-MM-DD). Selects the period it falls in (inclusive —
            end within a month to exclude the next one). Defaults to the company
            freshness date (current period included).
        - name: date_step
          in: query
          required: false
          schema:
            type: string
            description: 'Time grain. One of: month, quarter, year.'
            default: month
            title: Date Step
          description: 'Time grain. One of: month, quarter, year.'
        - name: dimension
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Break the result into one series per dimension value. Either a
              dimension **id** from `GET /metrics/{slug}/dimensions` (e.g.
              `product`) or its human **name** (e.g. a custom axis's
              `Vertical`). The mrr-growth metrics advertise `mrr_movement_type`
              as their natural breakdown — each period's net change split by
              movement type (new, expansion, contraction, lost, reactivated).
              With no `dimension` the result is the flat total per period; pass
              `mrr_movement_type` for the split, or another dimension for the
              net variation broken down by that axis. The movement-type
              components are computed within each period, so they are
              grain-dependent: a finer `date_step` (month) reports more gross
              movement than a coarser one (year) because intra-period reversals
              (expand-then-contract, churn-then-reactivate) net out at the
              coarser grain. The net always reconciles to the metric's delta at
              every grain; the components do not sum across grains.
            title: Dimension
          description: >-
            Break the result into one series per dimension value. Either a
            dimension **id** from `GET /metrics/{slug}/dimensions` (e.g.
            `product`) or its human **name** (e.g. a custom axis's `Vertical`).
            The mrr-growth metrics advertise `mrr_movement_type` as their
            natural breakdown — each period's net change split by movement type
            (new, expansion, contraction, lost, reactivated). With no
            `dimension` the result is the flat total per period; pass
            `mrr_movement_type` for the split, or another dimension for the net
            variation broken down by that axis. The movement-type components are
            computed within each period, so they are grain-dependent: a finer
            `date_step` (month) reports more gross movement than a coarser one
            (year) because intra-period reversals (expand-then-contract,
            churn-then-reactivate) net out at the coarser grain. The net always
            reconciles to the metric's delta at every grain; the components do
            not sum across grains.
        - name: filters
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              JSON array of `{field, op, value}` narrowing the data (op ∈ eq,
              neq, in, not_in, gt, gte, lt, lte, contains, between). The
              comparison ops (neq/gt/gte/lt/lte/between) are numeric — use
              `in`/`not_in` to match or exclude text values. `field` must be an
              available dimension. Example: `[{"field": "invoice/status", "op":
              "in", "value": ["paid"]}]`. For the mrr-growth metrics, filtering
              `mrr_movement_type` to one value focuses that single movement
              (e.g. net-new MRR), optionally combined with a breakdown
              `dimension` (net-new MRR by that axis).
            title: Filters
          description: >-
            JSON array of `{field, op, value}` narrowing the data (op ∈ eq, neq,
            in, not_in, gt, gte, lt, lte, contains, between). The comparison ops
            (neq/gt/gte/lt/lte/between) are numeric — use `in`/`not_in` to match
            or exclude text values. `field` must be an available dimension.
            Example: `[{"field": "invoice/status", "op": "in", "value":
            ["paid"]}]`. For the mrr-growth metrics, filtering
            `mrr_movement_type` to one value focuses that single movement (e.g.
            net-new MRR), optionally combined with a breakdown `dimension`
            (net-new MRR by that axis).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/export/metrics/{slug}/dimensions:
    get:
      tags:
        - Export API
      summary: List a metric's dimensions
      description: >-
        List the breakdown/filter dimensions available for this metric on your
        company (incl. your custom axes). `filter_only` dimensions may be used
        in `filters` but not as a breakdown `dimension`.
      operationId: List_a_metric_s_dimensions_v1_export_metrics__slug__dimensions_get
      security:
        - APIKey: []
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DimensionRef'
                title: >-
                  Response List A Metric S Dimensions V1 Export Metrics  Slug 
                  Dimensions Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/export/views:
    get:
      tags:
        - Export API
      summary: List available views
      description: >-
        List the row-level views available to your company. Columns are returned
        by the describe endpoint, not here.
      operationId: List_available_views_v1_export_views_get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ViewDescriptor'
                type: array
                title: Response List Available Views V1 Export Views Get
      security:
        - APIKey: []
  /v1/export/views/{slug}/columns:
    get:
      tags:
        - Export API
      summary: Describe a view
      description: >-
        Describe a view — its label and **columns** (name + type) — without
        reading any rows. The metadata counterpart to the query endpoint.
      operationId: Describe_a_view_v1_export_views__slug__columns_get
      security:
        - APIKey: []
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ViewDescriptor'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/export/views/{slug}:
    get:
      tags:
        - Export API
      summary: Query a view
      description: >-
        Read rows from a view for your company. Supports structured `filters`
        (`{field, op, value}`; no raw SQL), `order_by`/`order_dir`, and bounded
        pagination (`limit` ≤ 1000, `offset`).
      operationId: Query_a_view_v1_export_views__slug__get
      security:
        - APIKey: []
      parameters:
        - name: slug
          in: path
          required: true
          schema:
            type: string
            title: Slug
        - name: filters
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              JSON array of `{field, op, value}` (op ∈ eq, neq, in, not_in, gt,
              gte, lt, lte, contains, between). `field` is a view column.
              `contains` is a case-insensitive substring match where SQL `LIKE`
              wildcards in the value are honored — `%` matches any run of
              characters and `_` any single character (e.g. `ab%` is a prefix
              match).
            title: Filters
          description: >-
            JSON array of `{field, op, value}` (op ∈ eq, neq, in, not_in, gt,
            gte, lt, lte, contains, between). `field` is a view column.
            `contains` is a case-insensitive substring match where SQL `LIKE`
            wildcards in the value are honored — `%` matches any run of
            characters and `_` any single character (e.g. `ab%` is a prefix
            match).
        - name: order_by
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Column to sort by. Defaults to the view's sort.
            title: Order By
          description: Column to sort by. Defaults to the view's sort.
        - name: order_dir
          in: query
          required: false
          schema:
            type: string
            description: 'Sort direction: `asc` or `desc`.'
            default: asc
            title: Order Dir
          description: 'Sort direction: `asc` or `desc`.'
        - name: limit
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Page size (default 100, max 1000).
            title: Limit
          description: Page size (default 100, max 1000).
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Row offset for pagination.
            default: 0
            title: Offset
          description: Row offset for pagination.
        - name: date_step
          in: query
          required: false
          schema:
            type: string
            description: 'Grain. One of: month, quarter, year.'
            default: month
            title: Date Step
          description: 'Grain. One of: month, quarter, year.'
        - name: date_start
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by time (ISO `YYYY-MM-DD`): inclusive start of the period
              window. Selects whole periods like the metrics API — a date picks
              the period it falls in. Filter time with these, not the output
              `period_start`/`period_end`/`as_of_date` columns.
            title: Date Start
          description: >-
            Filter by time (ISO `YYYY-MM-DD`): inclusive start of the period
            window. Selects whole periods like the metrics API — a date picks
            the period it falls in. Filter time with these, not the output
            `period_start`/`period_end`/`as_of_date` columns.
        - name: date_end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Filter by time (ISO `YYYY-MM-DD`): inclusive end of the period
              window.
            title: Date End
          description: >-
            Filter by time (ISO `YYYY-MM-DD`): inclusive end of the period
            window.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ViewQueryResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /v1/utils/refresh:
    post:
      tags:
        - Refresh dashboard
      summary: Force the dashboard to refresh
      description: |-
        Launches a process to refresh the dashboard.
                            Once the refresh is done, the dashboard will be updated with the new data.
                            A notification will be sent to the user's email.
      operationId: Force_the_dashboard_to_refresh_v1_utils_refresh_post
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
      security:
        - APIKey: []
components:
  schemas:
    CreditNoteCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note.
        invoice_id:
          type: string
          title: Invoice Id
          description: Identifier of the invoice to which this credit note is attached
        date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Date
          description: Issue date of the credit note
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: 'Status of the invoice. Possible values: refunded, refund_due'
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
        credit_note_line_items:
          anyOf:
            - items:
                $ref: '#/components/schemas/CreditNoteLineItemNestedCreate'
              type: array
            - type: 'null'
          title: Credit Note Line Items
          description: List of credit note line items belonging to this credit note
          default: []
      additionalProperties: false
      type: object
      required:
        - id
        - invoice_id
      title: CreditNoteCreate
    CreditNoteLineItemCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note line item.
        credit_note_id:
          type: string
          title: Credit Note Id
          description: >-
            Identifier of the credit note to which the credit note line item
            belongs
        invoice_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Line Item Id
          description: >-
            Identifier of the invoice line item to which the credit note line
            item is attached
        amount:
          type: number
          title: Amount
          description: Amount of the credit note line item
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount of the credit note line item
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount amount of the credit note line item
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the credit note line item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the credit note line item
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
        - credit_note_id
        - amount
        - currency_code
      title: CreditNoteLineItemCreate
    CreditNoteLineItemListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CreditNoteLineItemRead'
          type: array
          title: Data
          description: A page of credit note line items.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: CreditNoteLineItemListPage
    CreditNoteLineItemNestedCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note line item.
        invoice_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Line Item Id
          description: >-
            Identifier of the invoice line item to which the credit note line
            item is attached
        amount:
          type: number
          title: Amount
          description: Amount of the credit note line item
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount of the credit note line item
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount amount of the credit note line item
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the credit note line item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the credit note line item
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      type: object
      required:
        - id
        - amount
        - currency_code
      title: CreditNoteLineItemNestedCreate
    CreditNoteLineItemNestedRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note line item.
        invoice_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Line Item Id
          description: >-
            Identifier of the invoice line item to which the credit note line
            item is attached
        amount:
          type: number
          title: Amount
          description: Amount of the credit note line item
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount of the credit note line item
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount amount of the credit note line item
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the credit note line item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the credit note line item
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      type: object
      required:
        - id
        - amount
        - currency_code
      title: CreditNoteLineItemNestedRead
    CreditNoteLineItemRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note line item.
        credit_note_id:
          type: string
          title: Credit Note Id
          description: >-
            Identifier of the credit note to which the credit note line item
            belongs
        invoice_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Line Item Id
          description: >-
            Identifier of the invoice line item to which the credit note line
            item is attached
        amount:
          type: number
          title: Amount
          description: Amount of the credit note line item
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount of the credit note line item
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount amount of the credit note line item
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the credit note line item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the credit note line item
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
        - credit_note_id
        - amount
        - currency_code
      title: CreditNoteLineItemRead
    CreditNoteLineItemUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the credit note line item.
        credit_note_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Credit Note Id
          description: >-
            Identifier of the credit note to which the credit note line item
            belongs
        invoice_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Line Item Id
          description: >-
            Identifier of the invoice line item to which the credit note line
            item is attached
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Amount of the credit note line item
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount of the credit note line item
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount amount of the credit note line item
          default: 0
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code of the credit note line item
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the credit note line item
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: CreditNoteLineItemUpdate
    CreditNoteListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CreditNoteRead'
          type: array
          title: Data
          description: A page of credit notes.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: CreditNoteListPage
    CreditNoteRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the credit note.
        invoice_id:
          type: string
          title: Invoice Id
          description: Identifier of the invoice to which this credit note is attached
        date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Date
          description: Issue date of the credit note
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: 'Status of the invoice. Possible values: refunded, refund_due'
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
        credit_note_line_items:
          anyOf:
            - items:
                $ref: '#/components/schemas/CreditNoteLineItemNestedRead'
              type: array
            - type: 'null'
          title: Credit Note Line Items
          description: List of credit note line items belonging to this credit note
          default: []
      additionalProperties: false
      type: object
      required:
        - id
        - invoice_id
      title: CreditNoteRead
    CreditNoteUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the credit note.
        invoice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Id
          description: Identifier of the invoice to which this credit note is attached
        date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Date
          description: Issue date of the credit note
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: 'Status of the invoice. Possible values: refunded, refund_due'
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: CreditNoteUpdate
    CustomerCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the customer.
        root_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Parent Id
          description: Id of the parent (if any)
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the customer
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Email of the customer
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country of the customer
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
          description: Zip code of the customer
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: CustomerCreate
    CustomerListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/CustomerRead'
          type: array
          title: Data
          description: A page of customers.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: CustomerListPage
    CustomerRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the customer.
        root_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Parent Id
          description: Id of the parent (if any)
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the customer
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Email of the customer
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country of the customer
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
          description: Zip code of the customer
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: CustomerRead
    CustomerUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the customer.
        root_parent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Root Parent Id
          description: Id of the parent (if any)
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the customer
        email:
          anyOf:
            - type: string
            - type: 'null'
          title: Email
          description: Email of the customer
        country:
          anyOf:
            - type: string
            - type: 'null'
          title: Country
          description: Country of the customer
        zip_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Zip Code
          description: Zip code of the customer
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: CustomerUpdate
    DimensionRef:
      properties:
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
        filter_only:
          type: boolean
          title: Filter Only
          default: false
      type: object
      required:
        - id
        - label
      title: DimensionRef
    ExcelConfirmRequest:
      properties:
        upload_id:
          type: integer
          title: Upload Id
          description: Identifier received during initiate step.
        name:
          type: string
          title: Name
          description: Display name assigned to the source.
        freshness_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Freshness Date
          description: >-
            Optional date representing the last update contained in the
            workbook.
      type: object
      required:
        - upload_id
        - name
      title: ExcelConfirmRequest
      example: *ref_0
    ExcelUploadResponse:
      properties:
        upload_id:
          type: integer
          title: Upload Id
          description: Identifier to reference when confirming the upload.
        upload:
          $ref: '#/components/schemas/PresignedPostPayload'
          description: Presigned target configuration for the Excel upload.
        max_file_size:
          type: integer
          title: Max File Size
          description: Maximum allowed workbook size in bytes for this upload.
      type: object
      required:
        - upload_id
        - upload
        - max_file_size
      title: ExcelUploadResponse
      example: *ref_1
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    InvoiceCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice.
        customer_id:
          type: string
          title: Customer Id
          description: Identifier of the customer to whom the invoice belongs
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Invoice number
        date:
          type: string
          format: date-time
          title: Date
          description: Issue date of the invoice
        status:
          type: string
          title: Status
          description: >-
            Status of the invoice. Possible values: open, pending, paid, unpaid,
            void
        is_renew:
          anyOf:
            - type: string
            - type: 'null'
          title: Is Renew
          description: >-
            Flag indicating if the invoice is originated from the renewal of a
            subscription
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
        invoice_line_items:
          anyOf:
            - items:
                $ref: '#/components/schemas/InvoiceLineItemNestedCreate'
              type: array
            - type: 'null'
          title: Invoice Line Items
          description: List of invoice line items belonging to this invoice
          default: []
      additionalProperties: false
      type: object
      required:
        - id
        - customer_id
        - date
        - status
      title: InvoiceCreate
    InvoiceLineItemCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice line item.
        invoice_id:
          type: string
          title: Invoice Id
          description: Identifier of the invoice to which this line item belongs
        subscription_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Id
          description: Identifier of the subscription to which this line item is related
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: Identifier of the price to which this line item is related
        type:
          type: string
          title: Type
          description: >-
            Type of the invoice line item. Possible values: `subscription`,
            `one_off`
        amount_excluding_tax_after_discount:
          type: number
          title: Amount Excluding Tax After Discount
          description: Amount of the invoice line item (excluding tax and after discount)
        tax_amount:
          type: number
          title: Tax Amount
          description: Tax amount
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount_amount
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the invoice line item
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity of bought items
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the invoice line item
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        proration_target_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proration Target Line Item Id
          description: >-
            In case this line item is a proration line item, the identifier of
            the original (positive) line item it applies on
        is_proration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Proration
          description: >-
            Whether this line item is a proration adjustment (e.g. a mid-cycle
            upgrade/cancellation credit or charge). Sourced from Stripe's
            `proration` flag; left NULL by connectors that don't expose the
            signal.
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
        - invoice_id
        - type
        - amount_excluding_tax_after_discount
        - tax_amount
        - currency_code
      title: InvoiceLineItemCreate
    InvoiceLineItemListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/InvoiceLineItemRead'
          type: array
          title: Data
          description: A page of invoice line items.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: InvoiceLineItemListPage
    InvoiceLineItemNestedCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice line item.
        subscription_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Id
          description: Identifier of the subscription to which this line item is related
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: Identifier of the price to which this line item is related
        type:
          type: string
          title: Type
          description: >-
            Type of the invoice line item. Possible values: `subscription`,
            `one_off`
        amount_excluding_tax_after_discount:
          type: number
          title: Amount Excluding Tax After Discount
          description: Amount of the invoice line item (excluding tax and after discount)
        tax_amount:
          type: number
          title: Tax Amount
          description: Tax amount
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount_amount
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the invoice line item
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity of bought items
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the invoice line item
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        proration_target_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proration Target Line Item Id
          description: >-
            In case this line item is a proration line item, the identifier of
            the original (positive) line item it applies on
        is_proration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Proration
          description: >-
            Whether this line item is a proration adjustment (e.g. a mid-cycle
            upgrade/cancellation credit or charge). Sourced from Stripe's
            `proration` flag; left NULL by connectors that don't expose the
            signal.
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      type: object
      required:
        - id
        - type
        - amount_excluding_tax_after_discount
        - tax_amount
        - currency_code
      title: InvoiceLineItemNestedCreate
    InvoiceLineItemNestedRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice line item.
        subscription_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Id
          description: Identifier of the subscription to which this line item is related
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: Identifier of the price to which this line item is related
        type:
          type: string
          title: Type
          description: >-
            Type of the invoice line item. Possible values: `subscription`,
            `one_off`
        amount_excluding_tax_after_discount:
          type: number
          title: Amount Excluding Tax After Discount
          description: Amount of the invoice line item (excluding tax and after discount)
        tax_amount:
          type: number
          title: Tax Amount
          description: Tax amount
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount_amount
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the invoice line item
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity of bought items
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the invoice line item
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        proration_target_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proration Target Line Item Id
          description: >-
            In case this line item is a proration line item, the identifier of
            the original (positive) line item it applies on
        is_proration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Proration
          description: >-
            Whether this line item is a proration adjustment (e.g. a mid-cycle
            upgrade/cancellation credit or charge). Sourced from Stripe's
            `proration` flag; left NULL by connectors that don't expose the
            signal.
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      type: object
      required:
        - id
        - type
        - amount_excluding_tax_after_discount
        - tax_amount
        - currency_code
      title: InvoiceLineItemNestedRead
    InvoiceLineItemRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice line item.
        invoice_id:
          type: string
          title: Invoice Id
          description: Identifier of the invoice to which this line item belongs
        subscription_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Id
          description: Identifier of the subscription to which this line item is related
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: Identifier of the price to which this line item is related
        type:
          type: string
          title: Type
          description: >-
            Type of the invoice line item. Possible values: `subscription`,
            `one_off`
        amount_excluding_tax_after_discount:
          type: number
          title: Amount Excluding Tax After Discount
          description: Amount of the invoice line item (excluding tax and after discount)
        tax_amount:
          type: number
          title: Tax Amount
          description: Tax amount
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount_amount
          default: 0
        currency_code:
          type: string
          title: Currency Code
          description: Currency code of the invoice line item
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity of bought items
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the invoice line item
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        proration_target_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proration Target Line Item Id
          description: >-
            In case this line item is a proration line item, the identifier of
            the original (positive) line item it applies on
        is_proration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Proration
          description: >-
            Whether this line item is a proration adjustment (e.g. a mid-cycle
            upgrade/cancellation credit or charge). Sourced from Stripe's
            `proration` flag; left NULL by connectors that don't expose the
            signal.
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
        - invoice_id
        - type
        - amount_excluding_tax_after_discount
        - tax_amount
        - currency_code
      title: InvoiceLineItemRead
    InvoiceLineItemUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the invoice line item.
        invoice_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Id
          description: Identifier of the invoice to which this line item belongs
        subscription_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Id
          description: Identifier of the subscription to which this line item is related
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: Identifier of the price to which this line item is related
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: >-
            Type of the invoice line item. Possible values: `subscription`,
            `one_off`
        amount_excluding_tax_after_discount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount Excluding Tax After Discount
          description: Amount of the invoice line item (excluding tax and after discount)
        tax_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Tax Amount
          description: Tax amount
        discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Discount Amount
          description: Permanent discount amount
          default: 0
        temporary_discount_amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Temporary Discount Amount
          description: Temporary discount_amount
          default: 0
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code of the invoice line item
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
          description: Quantity of bought items
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Description of the invoice line item
        period_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period Start
          description: >-
            Start date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        period_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Period End
          description: >-
            End date (UTC) of the subscription period billed by this line item
            (only for `subscription` type)
        proration_target_line_item_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Proration Target Line Item Id
          description: >-
            In case this line item is a proration line item, the identifier of
            the original (positive) line item it applies on
        is_proration:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Proration
          description: >-
            Whether this line item is a proration adjustment (e.g. a mid-cycle
            upgrade/cancellation credit or charge). Sourced from Stripe's
            `proration` flag; left NULL by connectors that don't expose the
            signal.
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: InvoiceLineItemUpdate
    InvoiceListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/InvoiceRead'
          type: array
          title: Data
          description: A page of invoices.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: InvoiceListPage
    InvoiceRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the invoice.
        customer_id:
          type: string
          title: Customer Id
          description: Identifier of the customer to whom the invoice belongs
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Invoice number
        date:
          type: string
          format: date-time
          title: Date
          description: Issue date of the invoice
        status:
          type: string
          title: Status
          description: >-
            Status of the invoice. Possible values: open, pending, paid, unpaid,
            void
        is_renew:
          anyOf:
            - type: string
            - type: 'null'
          title: Is Renew
          description: >-
            Flag indicating if the invoice is originated from the renewal of a
            subscription
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
        invoice_line_items:
          anyOf:
            - items:
                $ref: '#/components/schemas/InvoiceLineItemNestedRead'
              type: array
            - type: 'null'
          title: Invoice Line Items
          description: List of invoice line items belonging to this invoice
          default: []
      additionalProperties: false
      type: object
      required:
        - id
        - customer_id
        - date
        - status
      title: InvoiceRead
    InvoiceUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the invoice.
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
          description: Identifier of the customer to whom the invoice belongs
        invoice_number:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Number
          description: Invoice number
        date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Date
          description: Issue date of the invoice
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: >-
            Status of the invoice. Possible values: open, pending, paid, unpaid,
            void
        is_renew:
          anyOf:
            - type: string
            - type: 'null'
          title: Is Renew
          description: >-
            Flag indicating if the invoice is originated from the renewal of a
            subscription
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: InvoiceUpdate
    MetricDescriptor:
      properties:
        slug:
          type: string
          title: Slug
        label:
          type: string
          title: Label
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        unit:
          type: string
          title: Unit
        kind:
          $ref: '#/components/schemas/MetricKind'
        dimensions:
          items:
            $ref: '#/components/schemas/DimensionRef'
          type: array
          title: Dimensions
        natural_dimension:
          anyOf:
            - type: string
            - type: 'null'
          title: Natural Dimension
      type: object
      required:
        - slug
        - label
        - unit
        - kind
      title: MetricDescriptor
    MetricFamily:
      properties:
        id:
          type: string
          title: Id
        label:
          type: string
          title: Label
        metrics:
          items:
            $ref: '#/components/schemas/MetricDescriptor'
          type: array
          title: Metrics
      type: object
      required:
        - id
        - label
      title: MetricFamily
      description: >-
        A report (one ``ChartRouter``) grouping related metrics — the one-level
        catalog hierarchy.


        ``id`` is the report key (the ``ChartRouter`` path, e.g. ``"mrr"``,
        ``"arpa_and_acv"``); members

        are addressed individually by their stable ``slug`` (kpi_name).
    MetricKind:
      type: string
      enum:
        - point_in_time
        - periodic
      title: MetricKind
    MetricMeta:
      properties:
        company_id:
          type: integer
          title: Company Id
        computed_at:
          type: string
          format: date-time
          title: Computed At
        min_available_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Min Available Date
        freshness_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Freshness Date
        series_total:
          anyOf:
            - type: integer
            - type: 'null'
          title: Series Total
        series_returned:
          anyOf:
            - type: integer
            - type: 'null'
          title: Series Returned
      type: object
      required:
        - company_id
        - computed_at
      title: MetricMeta
    MetricPoint:
      properties:
        period_start:
          type: string
          format: date
          title: Period Start
        period_end:
          type: string
          format: date
          title: Period End
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
        as_of:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: As Of
      type: object
      required:
        - period_start
        - period_end
      title: MetricPoint
    MetricResult:
      properties:
        slug:
          type: string
          title: Slug
        label:
          type: string
          title: Label
        unit:
          type: string
          title: Unit
        currency:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency
        kind:
          $ref: '#/components/schemas/MetricKind'
        timegrain:
          type: string
          title: Timegrain
        dimensions:
          items:
            type: string
          type: array
          title: Dimensions
        series:
          items:
            $ref: '#/components/schemas/MetricSeries'
          type: array
          title: Series
        meta:
          $ref: '#/components/schemas/MetricMeta'
      type: object
      required:
        - slug
        - label
        - unit
        - kind
        - timegrain
        - meta
      title: MetricResult
    MetricSeries:
      properties:
        keys:
          additionalProperties:
            type: string
          type: object
          title: Keys
        label:
          type: string
          title: Label
        points:
          items:
            $ref: '#/components/schemas/MetricPoint'
          type: array
          title: Points
      type: object
      required:
        - label
        - points
      title: MetricSeries
    Page:
      properties:
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
        returned:
          type: integer
          title: Returned
        has_more:
          type: boolean
          title: Has More
      type: object
      required:
        - limit
        - offset
        - returned
        - has_more
      title: Page
    PresignedPostPayload:
      properties:
        url:
          type: string
          title: Url
          description: Presigned S3 POST URL for the Excel upload.
        fields:
          additionalProperties:
            type: string
          type: object
          title: Fields
          description: Form fields required when uploading the file to S3.
      type: object
      required:
        - url
        - fields
      title: PresignedPostPayload
      example: *ref_2
    PriceCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the price.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the price item
        period_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Period Unit
          description: >-
            Time unit of the billing frequency (only for `subscription` type).
            Possible values: `day`, `week`, `month`, `year`
        period_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Period Length
          description: >-
            Number of units of the billing frequency (only for `subscription`
            type).
        product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Id
          description: Identifier of the product related to this price item
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: 'Type of the price item. Possible values: `one_off`, `subscription`'
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Amount of the price item
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: PriceCreate
    PriceListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/PriceRead'
          type: array
          title: Data
          description: A page of prices.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: PriceListPage
    PriceRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the price.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the price item
        period_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Period Unit
          description: >-
            Time unit of the billing frequency (only for `subscription` type).
            Possible values: `day`, `week`, `month`, `year`
        period_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Period Length
          description: >-
            Number of units of the billing frequency (only for `subscription`
            type).
        product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Id
          description: Identifier of the product related to this price item
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: 'Type of the price item. Possible values: `one_off`, `subscription`'
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Amount of the price item
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: PriceRead
    PriceUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the price.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the price item
        period_unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Period Unit
          description: >-
            Time unit of the billing frequency (only for `subscription` type).
            Possible values: `day`, `week`, `month`, `year`
        period_length:
          anyOf:
            - type: integer
            - type: 'null'
          title: Period Length
          description: >-
            Number of units of the billing frequency (only for `subscription`
            type).
        product_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Id
          description: Identifier of the product related to this price item
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: 'Type of the price item. Possible values: `one_off`, `subscription`'
        amount:
          anyOf:
            - type: number
            - type: 'null'
          title: Amount
          description: Amount of the price item
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: PriceUpdate
    ProductCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the product.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the product
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: ProductCreate
    ProductListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ProductRead'
          type: array
          title: Data
          description: A page of products.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: ProductListPage
    ProductRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the product.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the product
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: ProductRead
    ProductUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the product.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: Name of the product
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: ProductUpdate
    SourceSummary:
      properties:
        id:
          type: integer
          title: Id
          description: Identifier of the newly created source.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp.
        name:
          type: string
          title: Name
          description: Source display name.
        status:
          type: string
          title: Status
          description: Human-readable connection status after confirmation.
      type: object
      required:
        - id
        - created_at
        - name
        - status
      title: SourceSummary
      example: *ref_3
    SubscriptionCreate:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier for the subscription.
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
          description: Identifier of the customer to which this subscription belongs
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: >-
            Status of the subscription. One of trialing, active, paused,
            canceled, unpaid
        subscription_set_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Set Id
          description: >-
            Identifier of the subscription set to which this subscription
            belongs
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: Start date (UTC) of the trial period (if any)
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date (UTC) of the trial period (if any)
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: If the subscription was cancelled, the cancellation date (UTC)
        effective_cancellation_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective Cancellation Date
          description: >-
            If the subscription was cancelled, the date date at which this
            cancellation was (or will be) effective
        subscription_start_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Subscription Start Date
          description: >-
            The date (UTC) when the subscription started or will start in the
            future. Corresponds to the start date of the first invoice and the
            beginning of the service period.
        deal_closed_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deal Closed Date
          description: >-
            The date (UTC) on which the subscription deal was finalized, marking
            its official confirmation. This date can be set earlier than the
            subscription_start_date. The subscription amount will contribute to
            the Committed Monthly Recurring Revenue (CMRR) from the
            deal_closed_date, while it will count towards Monthly Recurring
            Revenue (MRR) starting from the subscription_start_date, which
            denotes the beginning of the first billing period.
        contractual_commitment_end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Contractual Commitment End Date
          description: >-
            If the subscription is in a contractual commitment, the end date
            (UTC) of the commitment
        monthly_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Value
          description: Monthly value of the subscription
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code of the monthly value of the subscription
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: >-
            Identifier of the price object (a plan) to which this subscription
            belongs
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: SubscriptionCreate
    SubscriptionListPage:
      properties:
        data:
          items:
            $ref: '#/components/schemas/SubscriptionRead'
          type: array
          title: Data
          description: A page of subscriptions.
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Opaque cursor for the next page; `null` when there are no more
            results.
        has_more:
          type: boolean
          title: Has More
          description: Whether more results exist beyond this page.
      additionalProperties: false
      type: object
      required:
        - data
        - has_more
      title: SubscriptionListPage
    SubscriptionRead:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
        id:
          type: string
          title: Id
          description: Unique identifier for the subscription.
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
          description: Identifier of the customer to which this subscription belongs
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: >-
            Status of the subscription. One of trialing, active, paused,
            canceled, unpaid
        subscription_set_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Set Id
          description: >-
            Identifier of the subscription set to which this subscription
            belongs
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: Start date (UTC) of the trial period (if any)
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date (UTC) of the trial period (if any)
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: If the subscription was cancelled, the cancellation date (UTC)
        effective_cancellation_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective Cancellation Date
          description: >-
            If the subscription was cancelled, the date date at which this
            cancellation was (or will be) effective
        subscription_start_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Subscription Start Date
          description: >-
            The date (UTC) when the subscription started or will start in the
            future. Corresponds to the start date of the first invoice and the
            beginning of the service period.
        deal_closed_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deal Closed Date
          description: >-
            The date (UTC) on which the subscription deal was finalized, marking
            its official confirmation. This date can be set earlier than the
            subscription_start_date. The subscription amount will contribute to
            the Committed Monthly Recurring Revenue (CMRR) from the
            deal_closed_date, while it will count towards Monthly Recurring
            Revenue (MRR) starting from the subscription_start_date, which
            denotes the beginning of the first billing period.
        contractual_commitment_end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Contractual Commitment End Date
          description: >-
            If the subscription is in a contractual commitment, the end date
            (UTC) of the commitment
        monthly_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Value
          description: Monthly value of the subscription
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code of the monthly value of the subscription
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: >-
            Identifier of the price object (a plan) to which this subscription
            belongs
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      required:
        - id
      title: SubscriptionRead
    SubscriptionUpdate:
      properties:
        id:
          anyOf:
            - type: string
            - type: 'null'
          title: Id
          description: Unique identifier for the subscription.
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
          description: Identifier of the customer to which this subscription belongs
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: >-
            Status of the subscription. One of trialing, active, paused,
            canceled, unpaid
        subscription_set_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Subscription Set Id
          description: >-
            Identifier of the subscription set to which this subscription
            belongs
        trial_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial Start
          description: Start date (UTC) of the trial period (if any)
        trial_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Trial End
          description: End date (UTC) of the trial period (if any)
        canceled_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Canceled At
          description: If the subscription was cancelled, the cancellation date (UTC)
        effective_cancellation_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Effective Cancellation Date
          description: >-
            If the subscription was cancelled, the date date at which this
            cancellation was (or will be) effective
        subscription_start_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Subscription Start Date
          description: >-
            The date (UTC) when the subscription started or will start in the
            future. Corresponds to the start date of the first invoice and the
            beginning of the service period.
        deal_closed_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deal Closed Date
          description: >-
            The date (UTC) on which the subscription deal was finalized, marking
            its official confirmation. This date can be set earlier than the
            subscription_start_date. The subscription amount will contribute to
            the Committed Monthly Recurring Revenue (CMRR) from the
            deal_closed_date, while it will count towards Monthly Recurring
            Revenue (MRR) starting from the subscription_start_date, which
            denotes the beginning of the first billing period.
        contractual_commitment_end_date:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Contractual Commitment End Date
          description: >-
            If the subscription is in a contractual commitment, the end date
            (UTC) of the commitment
        monthly_value:
          anyOf:
            - type: number
            - type: 'null'
          title: Monthly Value
          description: Monthly value of the subscription
        currency_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Currency Code
          description: Currency code of the monthly value of the subscription
        price_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Price Id
          description: >-
            Identifier of the price object (a plan) to which this subscription
            belongs
        custom_properties:
          anyOf:
            - additionalProperties:
                anyOf:
                  - type: string
                  - type: 'null'
              type: object
            - type: 'null'
          title: Custom Properties
          description: Custom properties
          default: {}
      additionalProperties: false
      type: object
      title: SubscriptionUpdate
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    ViewColumn:
      properties:
        name:
          type: string
          title: Name
        type:
          type: string
          title: Type
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - name
        - type
      title: ViewColumn
    ViewDescriptor:
      properties:
        slug:
          type: string
          title: Slug
        label:
          type: string
          title: Label
        columns:
          items:
            $ref: '#/components/schemas/ViewColumn'
          type: array
          title: Columns
        time:
          anyOf:
            - $ref: '#/components/schemas/ViewTime'
            - type: 'null'
      type: object
      required:
        - slug
        - label
      title: ViewDescriptor
    ViewQueryResult:
      properties:
        slug:
          type: string
          title: Slug
        columns:
          items:
            $ref: '#/components/schemas/ViewColumn'
          type: array
          title: Columns
        rows:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Rows
        page:
          $ref: '#/components/schemas/Page'
        time:
          anyOf:
            - $ref: '#/components/schemas/ViewTime'
            - type: 'null'
      type: object
      required:
        - slug
        - columns
        - rows
        - page
      title: ViewQueryResult
    ViewTime:
      properties:
        kind:
          $ref: '#/components/schemas/MetricKind'
        as_of_column:
          anyOf:
            - type: string
            - type: 'null'
          title: As Of Column
        period_start_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Period Start Column
        period_end_column:
          anyOf:
            - type: string
            - type: 'null'
          title: Period End Column
      type: object
      required:
        - kind
      title: ViewTime
      description: >-
        Names a bucketized view's time column(s) and how to read the row's value
        — chosen so a date

        filter means the **same thing** here and in the corresponding metric
        (``get_metric``).


        Mirrors a metric point (``period_start`` / ``period_end`` / ``as_of``);
        the derived columns are

        real, filterable/sortable view columns the consumer reads instead of
        guessing the time axis:


        - ``point_in_time`` (MRR/ARR/CMRR, active counts): each row is a
        **stock** measured at an instant.
          ``as_of_column`` is the date that instant falls on — the period **end** (e.g. ``2024-02-29``),
          identical to the metric's ``as_of``. ``period_start_column``/``period_end_column`` are null.
        - ``periodic`` (revenue, MRR movements, …): each row's value is a
        **flow** accumulated over a
          period. ``period_start_column`` / ``period_end_column`` are its inclusive bounds (e.g.
          ``2024-02-01`` … ``2024-02-29``), identical to the metric's ``period_start`` / ``period_end``.
          ``as_of_column`` is null.
  securitySchemes:
    APIKey:
      name: Authorization
      in: header
      description: 'Include the following header: `Authorization: Bearer <YOUR_API_KEY>`'
x-tagGroups:
  - name: Import API - invoicing
    tags:
      - Customers
      - Products
      - Prices
      - Invoices
      - Credit Notes
      - Subscriptions
      - Invoice Line Items
      - Credit Note Line Items
      - Import an Excel dataset
  - name: Export API
    tags:
      - Export API
  - name: Other operations
    tags:
      - Refresh dashboard
tags:
  - name: Customers
  - name: Products
  - name: Prices
  - name: Invoices
  - name: Credit Notes
  - name: Subscriptions
  - name: Invoice Line Items
  - name: Credit Note Line Items
  - name: Import an Excel dataset
    description: >-
      ### Helper Script


      Download:
      [upload_excel_source.py](https://fincome-public-assets.s3.eu-west-3.amazonaws.com/upload_excel_source.py)


      ```bash

      python3 upload_excel_source.py "/path/to/invoices.xlsx" YOUR_TOKEN \
        --base-url https://api2.fincome.co/product/v1 \
        --name "Invoicing Upload"
      ```


      The script automates the full flow:


      1. Calls `/v1/import/sources/invoicing/excel/initiate_upload` to obtain
      the presigned S3 target.

      2. Uploads the workbook to S3 using the returned form fields.

      3. Calls `/v1/import/sources/invoicing/excel/confirm_upload` so the
      invoicing source is created and ingestion begins.
  - name: Export API
  - name: Refresh dashboard
servers:
  - url: https://api2.fincome.co/product
