Modern Treasury AccountCollectionFlow API

The AccountCollectionFlow API from Modern Treasury — 2 operation(s) for accountcollectionflow.

OpenAPI Specification

modern-treasury-accountcollectionflow-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Modern Treasury AccountCapability AccountCollectionFlow 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: AccountCollectionFlow
paths:
  /api/account_collection_flows:
    get:
      summary: list account_collection_flows
      tags:
      - AccountCollectionFlow
      operationId: listAccountCollectionFlows
      security:
      - basic_auth: []
      parameters:
      - name: after_cursor
        in: query
        schema:
          type: string
          nullable: true
        required: false
      - name: per_page
        in: query
        required: false
        schema:
          type: integer
      - name: client_token
        in: query
        required: false
        schema:
          type: string
      - name: status
        in: query
        required: false
        schema:
          type: string
      - name: counterparty_id
        in: query
        schema:
          type: string
        required: false
      - name: external_account_id
        in: query
        schema:
          type: string
        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/account_collection_flow'
    post:
      summary: create account_collection_flow
      tags:
      - AccountCollectionFlow
      operationId: createAccountCollectionFlow
      security:
      - basic_auth: []
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        description: This key should be something unique, preferably something like an UUID.
        schema:
          type: string
      responses:
        '201':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/account_collection_flow'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/account_collection_flow_create_request'
  /api/account_collection_flows/{id}:
    parameters:
    - name: id
      in: path
      schema:
        type: string
      description: id
      required: true
    get:
      summary: get account_collection_flow
      tags:
      - AccountCollectionFlow
      operationId: getAccountCollectionFlow
      security:
      - basic_auth: []
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        description: This key should be something unique, preferably something like an UUID.
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/account_collection_flow'
    patch:
      summary: update account_collection_flow
      tags:
      - AccountCollectionFlow
      operationId: updateAccountCollectionFlow
      security:
      - basic_auth: []
      parameters:
      - name: Idempotency-Key
        in: header
        required: false
        description: This key should be something unique, preferably something like an UUID.
        schema:
          type: string
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/account_collection_flow'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '422':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/account_collection_flow_update_request'
components:
  schemas:
    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
    account_collection_flow_create_request:
      type: object
      properties:
        counterparty_id:
          type: string
          format: uuid
          description: Required.
        payment_types:
          type: array
          items:
            type: string
            description: Required. At least one of `ach`, `wire` or `check`.
        receiving_countries:
          type: array
          items:
            type: string
            enum:
            - USA
            - AUS
            - BEL
            - CAN
            - CHL
            - CHN
            - COL
            - FRA
            - DEU
            - HKG
            - IND
            - IRL
            - ITA
            - MEX
            - NLD
            - PER
            - ESP
            - GBR
            description: Optional. Array of 3-digit ISO country codes.
      required:
      - payment_types
      - counterparty_id
    account_collection_flow_update_request:
      type: object
      properties:
        status:
          type: string
          enum:
          - cancelled
          description: Required. The updated status of the account collection flow. Can only be used to mark a flow as `cancelled`.
      required:
      - status
    account_collection_flow:
      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
        client_token:
          type: string
          description: The client token of the account collection flow.  This token can be used to embed account collection in your client-side application.
        status:
          type: string
          enum:
          - cancelled
          - completed
          - expired
          - pending
          description: The current status of the account collection flow. One of `pending`, `completed`, `expired`, or `cancelled`.
        counterparty_id:
          type: string
          format: uuid
          description: The ID of a counterparty. An external account created with this flow will be associated with this counterparty.
        external_account_id:
          type: string
          format: uuid
          nullable: true
          description: If present, the ID of the external account created using this flow.
        payment_types:
          type: array
          items:
            type: string
            enum:
            - ach
            - wire
            description: An account created with this flow will support payments of one of these types.
        receiving_countries:
          type: array
          items:
            type: string
            enum:
            - USA
            - AUS
            - BEL
            - CAN
            - CHL
            - CHN
            - COL
            - FRA
            - DEU
            - HKG
            - IND
            - IRL
            - ITA
            - MEX
            - NLD
            - PER
            - ESP
            - GBR
            description: An account created with this flow will support wires from the US to these countries.
      additionalProperties: false
      minProperties: 10
      required:
      - payment_types
      - counterparty_id
  securitySchemes:
    basic_auth:
      type: http
      scheme: basic