Modern Treasury IncomingPaymentDetail API

The IncomingPaymentDetail API from Modern Treasury — 3 operation(s) for incomingpaymentdetail.

OpenAPI Specification

modern-treasury-incomingpaymentdetail-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Modern Treasury AccountCapability IncomingPaymentDetail 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: IncomingPaymentDetail
paths:
  /api/incoming_payment_details:
    get:
      summary: list incoming payment_details
      tags:
      - IncomingPaymentDetail
      operationId: listIncomingPaymentDetails
      description: Get a list of Incoming Payment Details.
      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: direction
        in: query
        schema:
          type: string
          enum:
          - credit
          - debit
          _x-stainless-modelDefPath: $shared.transaction_direction
        required: false
        description: One of `credit` or `debit`.
      - name: status
        in: query
        schema:
          type: string
          enum:
          - completed
          - pending
          - returned
        required: false
        description: The current status of the incoming payment order. One of `pending`, `completed`, or `returned`.
      - name: type
        in: query
        schema:
          type: string
          enum:
          - ach
          - au_becs
          - bacs
          - book
          - check
          - eft
          - interac
          - neft
          - nz_becs
          - rtp
          - sepa
          - signet
          - stablecoin
          - wire
          - zengin
        required: false
        description: 'One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or `wire`.'
      - name: as_of_date_start
        in: query
        schema:
          type: string
          format: date
        required: false
        description: Filters incoming payment details with an as_of_date starting on or after the specified date (YYYY-MM-DD).
      - name: as_of_date_end
        in: query
        schema:
          type: string
          format: date
        required: false
        description: Filters incoming payment details with an as_of_date starting on or before the specified date (YYYY-MM-DD).
      - $ref: '#/components/parameters/metadata_query'
      - name: virtual_account_id
        in: query
        schema:
          type: string
        required: false
        description: If the incoming payment detail is in a virtual account, the ID of the Virtual Account.
      - name: subtype
        in: query
        schema:
          type: string
        required: false
        description: An additional layer of classification for the type of incoming payment detail. For example, a `type` of `stablecoin` may have a `subtype` of `ethereum` or `solana`.
      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/incoming_payment_detail'
        '401':
          description: unsuccessful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
  /api/incoming_payment_details/{id}:
    parameters:
    - name: id
      in: path
      schema:
        type: string
      description: The unique identifier of the incoming payment detail.
      required: true
    get:
      summary: get incoming payment detail
      tags:
      - IncomingPaymentDetail
      operationId: getIncomingPaymentDetail
      description: Get an existing Incoming Payment Detail.
      security:
      - basic_auth: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/incoming_payment_detail'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
    patch:
      summary: update incoming payment detail
      tags:
      - IncomingPaymentDetail
      operationId: updateIncomingPaymentDetail
      description: Update an existing Incoming Payment Detail.
      security:
      - basic_auth: []
      parameters: []
      responses:
        '200':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/incoming_payment_detail'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/incoming_payment_detail_update_request'
  /api/simulations/incoming_payment_details/create_async:
    post:
      summary: create async incoming payment detail
      tags:
      - IncomingPaymentDetail
      operationId: createAsyncIncomingPaymentDetail
      description: Simulate Incoming Payment Detail
      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:
        '202':
          description: successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/incoming_payment_detail'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '404':
          description: not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_message'
        '405':
          description: not allowed
          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/incoming_payment_detail_create_request'
components:
  schemas:
    address:
      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
        line1:
          type: string
          nullable: true
        line2:
          type: string
          nullable: true
        locality:
          type: string
          nullable: true
          description: Locality or City.
        region:
          type: string
          nullable: true
          description: Region or State.
        postal_code:
          type: string
          description: The postal code of the address.
          nullable: true
        country:
          type: string
          description: Country code conforms to [ISO 3166-1 alpha-2]
          nullable: true
      nullable: true
      additionalProperties: false
      minProperties: 11
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - line1
      - line2
      - locality
      - region
      - postal_code
      - country
    account_detail:
      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
        discarded_at:
          type: string
          format: date-time
          nullable: true
        account_number:
          type: string
          description: The account number for the bank account.
        account_number_type:
          type: string
          enum:
          - au_number
          - base_address
          - card_token
          - clabe
          - ethereum_address
          - hk_number
          - iban
          - id_number
          - nz_number
          - other
          - pan
          - polygon_address
          - sg_number
          - solana_address
          - wallet_address
          description: One of `iban`, `clabe`, `wallet_address`, or `other`. Use `other` if the bank account number is in a generic format.
        account_number_safe:
          type: string
          description: The last 4 digits of the account_number.
      additionalProperties: false
      minProperties: 8
      maxProperties: 9
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - discarded_at
      - account_number_type
      - account_number_safe
    incoming_payment_detail_create_request:
      type: object
      properties:
        type:
          type: string
          enum:
          - ach
          - au_becs
          - bacs
          - book
          - check
          - eft
          - interac
          - neft
          - nz_becs
          - rtp
          - sepa
          - signet
          - stablecoin
          - wire
          - zengin
          description: One of `ach`, `wire`, `check`.
        direction:
          type: string
          enum:
          - credit
          - debit
          description: One of `credit`, `debit`.
        amount:
          type: integer
          description: Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.
        currency:
          $ref: '#/components/schemas/currency'
          nullable: true
          description: Defaults to the currency of the originating account.
        internal_account_id:
          type: string
          format: uuid
          description: The ID of one of your internal accounts.
        virtual_account_id:
          type: string
          format: uuid
          nullable: true
          description: An optional parameter to associate the incoming payment detail to a virtual account.
        as_of_date:
          type: string
          format: date
          nullable: true
          description: Defaults to today.
        description:
          type: string
          nullable: true
          description: Defaults to a random description.
        subtype:
          type: string
          nullable: true
          description: An additional layer of classification for the type of incoming payment detail, e.g. `ethereum` for a `stablecoin` type.
        data:
          type: object
          nullable: true
          description: An object passed through to the simulated IPD that could reflect what a vendor would pass.
    virtual_account:
      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
        discarded_at:
          type: string
          format: date-time
          nullable: true
        name:
          type: string
          description: The name of the virtual account.
        description:
          type: string
          description: An optional free-form description for internal use.
          nullable: true
        counterparty_id:
          type: string
          format: uuid
          description: The ID of a counterparty that the virtual account belongs to. Optional.
          nullable: true
        internal_account_id:
          type: string
          format: uuid
          description: The ID of the internal account that the virtual account is in.
        account_details:
          type: array
          description: An array of account detail objects.
          items:
            $ref: '#/components/schemas/account_detail'
        routing_details:
          type: array
          description: An array of routing detail objects. These will be the routing details of the internal account.
          items:
            $ref: '#/components/schemas/routing_detail'
        debit_ledger_account_id:
          type: string
          format: uuid
          description: The ID of a debit normal ledger account. When money enters the virtual account, this ledger account will be debited. Must be accompanied by a credit_ledger_account_id if present.
          nullable: true
        credit_ledger_account_id:
          type: string
          format: uuid
          description: The ID of a credit normal ledger account. When money enters the virtual account, this ledger account will be credited. Must be accompanied by a debit_ledger_account_id if present.
          nullable: true
        ledger_account_id:
          type: string
          format: uuid
          nullable: true
          description: If the virtual account links to a ledger account in Modern Treasury, the id of the ledger account will be populated here.
        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
      additionalProperties: false
      minProperties: 16
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - discarded_at
      - name
      - description
      - counterparty_id
      - internal_account_id
      - account_details
      - routing_details
      - debit_ledger_account_id
      - credit_ledger_account_id
      - ledger_account_id
      - metadata
    currency:
      type: string
      enum:
      - AED
      - AFN
      - ALL
      - AMD
      - ANG
      - AOA
      - ARS
      - AUD
      - AWG
      - AZN
      - BAM
      - BBD
      - BCH
      - BDT
      - BGN
      - BHD
      - BIF
      - BMD
      - BND
      - BOB
      - BRL
      - BSD
      - BTC
      - BTN
      - BWP
      - BYN
      - BYR
      - BZD
      - CAD
      - CDF
      - CHF
      - CLF
      - CLP
      - CNH
      - CNY
      - COP
      - CRC
      - CUC
      - CUP
      - CVE
      - CZK
      - DJF
      - DKK
      - DOP
      - DZD
      - EEK
      - EGP
      - ERN
      - ETB
      - ETH
      - EUR
      - EURC
      - FJD
      - FKP
      - GBP
      - GBX
      - GEL
      - GGP
      - GHS
      - GIP
      - GMD
      - GNF
      - GTQ
      - GYD
      - HKD
      - HNL
      - HRK
      - HTG
      - HUF
      - IDR
      - ILS
      - IMP
      - INR
      - IQD
      - IRR
      - ISK
      - JEP
      - JMD
      - JOD
      - JPY
      - KES
      - KGS
      - KHR
      - KMF
      - KPW
      - KRW
      - KWD
      - KYD
      - KZT
      - LAK
      - LBP
      - LKR
      - LRD
      - LSL
      - LTL
      - LVL
      - LYD
      - MAD
      - MDL
      - MGA
      - MKD
      - MMK
      - MNT
      - MOP
      - MRO
      - MRU
      - MTL
      - MUR
      - MVR
      - MWK
      - MXN
      - MYR
      - MZN
      - NAD
      - NGN
      - NIO
      - NOK
      - NPR
      - NZD
      - OMR
      - OP
      - PAB
      - PEN
      - PGK
      - PHP
      - PKR
      - PLN
      - PYG
      - PYUSD
      - QAR
      - RON
      - RSD
      - RUB
      - RWF
      - SAR
      - SBD
      - SCR
      - SDG
      - SEK
      - SGD
      - SHP
      - SKK
      - SLE
      - SLL
      - SOS
      - SRD
      - SSP
      - STD
      - STN
      - SVC
      - SYP
      - SZL
      - THB
      - TJS
      - TMM
      - TMT
      - TND
      - TOP
      - TRY
      - TTD
      - TWD
      - TZS
      - UAH
      - UGX
      - USD
      - USDB
      - USDC
      - USDG
      - USDP
      - USDT
      - UYU
      - UZS
      - VEF
      - VES
      - VND
      - VUV
      - WST
      - XAF
      - XAG
      - XAU
      - XBA
      - XBB
      - XBC
      - XBD
      - XCD
      - XCG
      - XDR
      - XFU
      - XOF
      - XPD
      - XPF
      - XPT
      - XTS
      - YER
      - ZAR
      - ZMK
      - ZMW
      - ZWD
      - ZWG
      - ZWL
      - ZWN
      - ZWR
      description: Three-letter ISO currency code.
    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
    incoming_payment_detail:
      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
        internal_account_id:
          type: string
          format: uuid
          description: The ID of the Internal Account for the incoming payment detail. This is always present.
        virtual_account_id:
          type: string
          format: uuid
          nullable: true
          description: If the incoming payment detail is in a virtual account, the ID of the Virtual Account.
        virtual_account:
          $ref: '#/components/schemas/virtual_account'
          nullable: true
          description: If the incoming payment detail is in a virtual account, the serialized virtual account object.
        transaction_line_item_id:
          type: string
          format: uuid
          nullable: true
          description: The ID of the reconciled Transaction Line Item or `null`.
        transaction_id:
          type: string
          format: uuid
          nullable: true
          description: The ID of the reconciled Transaction or `null`.
        ledger_transaction_id:
          type: string
          format: uuid
          nullable: true
          description: The ID of the ledger transaction linked to the incoming payment detail or `null`.
        type:
          type: string
          enum:
          - ach
          - au_becs
          - bacs
          - book
          - check
          - eft
          - interac
          - neft
          - nz_becs
          - rtp
          - sepa
          - signet
          - stablecoin
          - wire
          - zengin
          description: 'One of: `ach`, `book`, `check`, `eft`, `interac`, `rtp`, `sepa`, `signet`, or `wire`.'
        data:
          type: object
          description: The raw data from the payment pre-notification file that we get from the bank.
          additionalProperties: true
        amount:
          type: integer
          description: Value in specified currency's smallest unit. e.g. $10 would be represented as 1000.
        currency:
          $ref: '#/components/schemas/currency'
          description: The currency of the incoming payment detail.
        direction:
          type: string
          enum:
          - credit
          - debit
          description: One of `credit` or `debit`.
          _x-stainless-modelDefPath: $shared.transaction_direction
        status:
          type: string
          enum:
          - completed
          - pending
          - returned
          description: The current status of the incoming payment order. One of `pending`, `completed`, or `returned`.
        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
        as_of_date:
          type: string
          format: date
          description: The date on which the corresponding transaction will occur.
        vendor_id:
          type: string
          format: uuid
          nullable: true
          description: The identifier of the vendor bank.
        originating_routing_number:
          type: string
          description: The routing number of the originating account for the incoming payment detail.
          nullable: true
        originating_routing_number_type:
          type: string
          enum:
          - aba
          - au_bsb
          - br_codigo
          - ca_cpa
          - chips
          - cnaps
          - dk_interbank_clearing_code
          - gb_sort_code
          - hk_interbank_clearing_code
          - hu_interbank_clearing_code
          - id_sknbi_code
          - il_bank_code
          - in_ifsc
          - jp_zengin_code
          - mx_bank_identifier
          - my_branch_code
          - nz_national_clearing_code
          - pl_national_clearing_code
          - se_bankgiro_clearing_code
          - sg_interbank_clearing_code
          - swift
          - za_national_clearing_code
          description: The type of the originating routing number for the incoming payment detail.
          nullable: true
        originating_account_number:
          type: string
          description: The account number of the originating account for the incoming payment detail.
          nullable: true
        originating_account_number_safe:
          type: string
          description: The last 4 digits of the originating account_number for the incoming payment detail.
          nullable: true
        originating_account_number_type:
          type: string
          enum:
          - au_number
          - base_address
          - card_token
          - clabe
          - ethereum_address
          - hk_number
          - iban
          - id_number
          - nz_number
          - other
          - pan
          - polygon_address
          - sg_number
          - solana_address
          - wallet_address
          description: The type of the originating account number for the incoming payment detail.
          nullable: true
        originating_party_name:
          type: string
          description: The name of the originating party for the incoming payment detail.
          nullable: true
        originating_party_address:
          $ref: '#/components/schemas/address'
          nullable: true
          description: The address of the originating party for the incoming payment detail, or `null`.
        originating_party_vendor_identifier:
          type: string
          description: The vendor-assigned identifier for the originating party of the incoming payment detail, or `null`.
          nullable: true
        receiving_account_number:
          type: string
          description: The account number of the receiving account for the incoming payment detail, or `null`.
          nullable: true
        receiving_account_number_safe:
          type: string
          description: The last 4 digits of the receiving account number for the incoming payment detail, or `null`.
          nullable: true
        subtype:
          type: string
          nullable: true
          description: An additional layer of classification for the type of incoming payment detail. For example, a `type` of `stablecoin` may have a `subtype` of `ethereum` or `solana`.
        reconciliation_status:
          type: string
          enum:
          - unreconciled
          - tentatively_reconciled
          - reconciled
          description: One of `unreconciled`, `tentatively_reconciled` or `reconciled`.
      additionalProperties: false
      minProperties: 26
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - internal_account_id
      - virtual_account_id
      - virtual_account
      - transaction_line_item_id
      - transaction_id
      - ledger_transaction_id
      - type
      - data
      - amount
      - currency
      - direction
      - status
      - metadata
      - as_of_date
      - vendor_id
      - originating_routing_number
      - originating_routing_number_type
      - originating_account_number_safe
      - originating_account_number_type
      - subtype
      - reconciliation_status
    incoming_payment_detail_update_request:
      type: object
      properties:
        metadata:
          type: object
          additionalProperties:
            type: string
          description: Additional data in the form of key-value pairs. Pairs can be removed by passing an empty string or `null` as the value.
    routing_detail:
      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
        discarded_at:
          type: string
          format: date-time
          nullable: true
        routing_number:
          type: string
          description: The routing number of the bank.
        routing_number_type:
          type: string
          enum:
          - aba
          - au_bsb
          - br_codigo
          - ca_cpa
          - chips
          - cnaps
          - dk_interbank_clearing_code
          - gb_sort_code
          - hk_interbank_clearing_code
          - hu_interbank_clearing_code
          - id_sknbi_code
          - il_bank_code
          - in_ifsc
          - jp_zengin_code
          - mx_bank_identifier
          - my_branch_code
          - nz_national_clearing_code
          - pl_national_clearing_code
          - se_bankgiro_clearing_code
          - sg_interbank_clearing_code
          - swift
          - za_national_clearing_code
          description: The type of routing number. See https://docs.moderntreasury.com/platform/reference/routing-detail-object for more details.
        payment_type:
          type: string
          enum:
          - ach
          - au_becs
          - bacs
          - book
          - card
          - chats
          - check
          - cross_border
          - dk_nets
          - eft
          - gb_fps
          - hu_ics
          - interac
          - masav
          - mx_ccen
          - neft
          - nics
          - nz_becs
          - pl_elixir
          - provxchange
          - ro_sent
          - rtp
          - se_bankgirot
          - sen
          - sepa
          - sg_giro
          - sic
          - signet
          - sknbi
          - stablecoin
          - wire
          - zengin
          nullable: true
          description: If the routing detail is to be used for a specific payment type this field will be populated, otherwise null.
        bank_name:
          type: string
          description: The name of the bank.
        bank_address:
          $ref: '#/components/schemas/address'
      additionalProperties: false
      minProperties: 11
      required:
      - id
      - object
      - live_mode
      - created_at
      - updated_at
      - discarded_at
      - routing_number
      - routing_number_type
      - payment_type
      - bank_name
      - bank_address
  parameters:
    metadata_query:
      name: metadata
      in: query
      schema:
        type: object
        additionalProperties:
          type: string
      style: deepObject
      explode: true
      required: false
      description: For example, if you want to query for records with metadata key `Type` and value `Loan`, the query would be `metadata%5BType%5D=Loan`. This encodes the query parameters.
  securitySchemes:
    basic_auth:
      type: http
      scheme: basic