Modern Treasury LineItem API

The LineItem API from Modern Treasury — 2 operation(s) for lineitem.

OpenAPI Specification

modern-treasury-lineitem-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Modern Treasury AccountCapability LineItem API
  version: v1
  contact:
    name: Modern Treasury Engineering Team
    url: https://moderntreasury.com
  description: The Modern Treasury REST API. Please see https://docs.moderntreasury.com for more details.
servers:
- url: http://localhost:3000
- url: https://app.moderntreasury.com
tags:
- name: LineItem
paths:
  /api/{itemizable_type}/{itemizable_id}/line_items:
    get:
      summary: list line items
      tags:
      - LineItem
      description: Get a list of line items
      operationId: listLineItems
      security:
      - basic_auth: []
      parameters:
      - name: itemizable_id
        in: path
        schema:
          type: string
        description: The ID of the payment order or expected payment.
        required: true
      - name: itemizable_type
        in: path
        schema:
          type: string
          enum:
          - expected_payments
          - payment_orders
        description: One of `payment_orders` or `expected_payments`.
        required: true
      - name: after_cursor
        in: query
        schema:
          type: string
          nullable: true
        required: false
      - name: per_page
        in: query
        schema:
          type: integer
        required: false
      responses:
        '200':
          description: successful
          headers:
            X-After-Cursor:
              schema:
                type: string
                nullable: true
              required: false
              description: The cursor for the next page. Including this in a call as `after_cursor` will return the next page.
            X-Per-Page:
              schema:
                type: integer
                nullable: true
              description: The current `per_page`.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/line_item'
  /api/{itemizable_type}/{itemizable_id}/line_items/{id}:
    get:
      summary: get line item
      tags:
      - LineItem
      description: Get a single line item
      operationId: getLineItem
      security:
      - basic_auth: []
      parameters:
      - name: itemizable_id
        in: path
        schema:
          type: string
        description: The ID of the payment order or expected payment.
        required: true
      - name: itemizable_type
        in: path
        schema:
          type: string
          enum:
          - expected_payments
          - payment_orders
        description: One of `payment_orders` or `expected_payments`.
        required: true
      - name: id
        in: path
        schema:
          type: string
        description: The ID of the line item.
        required: true
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/line_item'
    patch:
      summary: update line item
      tags:
      - LineItem
      operationId: updateLineItem
      security:
      - basic_auth: []
      parameters:
      - name: itemizable_id
        in: path
        schema:
          type: string
        description: The ID of the payment order or expected payment.
        required: true
      - name: itemizable_type
        in: path
        schema:
          type: string
          enum:
          - expected_payments
          - payment_orders
        description: One of `payment_orders` or `expected_payments`.
        required: true
      - name: id
        in: path
        schema:
          type: string
        description: The ID of the line item.
        required: true
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/line_item'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/line_item_update_request'
components:
  schemas:
    accounting:
      type: object
      deprecated: true
      properties:
        account_id:
          type: string
          format: uuid
          nullable: true
          deprecated: true
          description: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected.
        class_id:
          type: string
          format: uuid
          nullable: true
          deprecated: true
          description: The ID of one of the class objects in your accounting system. Class objects track segments of your business independent of client or project. Note that these will only be accessible if your accounting system has been connected.
    line_item_update_request:
      type: object
      properties:
        metadata:
          type: object
          description: Additional data represented as key-value pairs. Both the key and value must be strings.
          additionalProperties:
            type: string
          example:
            key: value
            foo: bar
            modern: treasury
    error_message:
      type: object
      properties:
        errors:
          type: object
          properties:
            code:
              type: string
              enum:
              - parameter_invalid
              - parameter_missing
              - resource_not_found
              - not_found
              - forbidden
              - invalid_ip
              - invalid_key
              - header_invalid
              - expired_key
              - conflict
              - too_many_requests
            message:
              type: string
            parameter:
              type: string
      required:
      - errors
    line_item:
      type: object
      properties:
        id:
          type: string
          format: uuid
        object:
          type: string
        live_mode:
          type: boolean
          description: This field will be true if this object exists in the live environment or false if it exists in the test environment.
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        itemizable_id:
          type: string
          format: uuid
          description: The ID of the payment order or expected payment.
        itemizable_type:
          type: string
          enum:
          - ExpectedPayment
          - PaymentOrder
          description: One of `payment_orders` or `expected_payments`.
        amount:
          type: integer
          description: Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.
        description:
          type: string
          description: A free-form description of the line item.
          nullable: true
        metadata:
          type: object
          description: Additional data represented as key-value pairs. Both the key and value must be strings.
          additionalProperties:
            type: string
          example:
            key: value
            foo: bar
            modern: treasury
        accounting:
          $ref: '#/components/schemas/accounting'
        accounting_category_id:
          type: string
          format: uuid
          deprecated: true
          description: The ID of one of your accounting categories. Note that these will only be accessible if your accounting system has been connected.
          nullable: true
        accounting_ledger_class_id:
          type: string
          format: uuid
          deprecated: true
          description: The ID of one of the class objects in your accounting system. Class objects track segments of your business independent of client or project. Note that these will only be accessible if your accounting system has been connected.
          nullable: true
      additionalProperties: false
      minProperties: 13
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - itemizable_id
      - itemizable_type
      - amount
      - description
      - metadata
      - accounting
      - accounting_category_id
      - accounting_ledger_class_id
  securitySchemes:
    basic_auth:
      type: http
      scheme: basic