> ## Documentation Index
> Fetch the complete documentation index at: https://docs.montereyfinancial.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Post a payment collected outside Monterey

> Records a payment your organization collected itself against one of its accounts. Requires an `Idempotency-Key` header; replaying the same key and body returns the original response. Returns 201 when the payment is posted and 202 when the outcome is still being confirmed (`pending_confirmation`).



## OpenAPI

````yaml /api-reference/external_api.openapi.json post /v1/accounts/{account_id}/payments
openapi: 3.1.0
info:
  title: Monterey Client API
  description: >-
    Org-scoped, token-authenticated account, borrower, and payment endpoints for
    Monterey Financial clients.
  version: 1.0.0
servers:
  - url: https://api.montereyfinancial.app
    description: Production
security:
  - BearerToken: []
tags:
  - name: Authentication
    description: Exchange API keys for access tokens.
  - name: Organizations
    description: Organizations visible to the API key.
  - name: Persons
    description: Borrowers visible through in-scope accounts.
  - name: Accounts
    description: Servicing accounts and identifier lookups.
  - name: Transactions
    description: Account money-movement history.
  - name: Payment Methods
    description: Stored payment instruments.
  - name: Autopay
    description: Recurring payment schedules.
paths:
  /v1/accounts/{account_id}/payments:
    post:
      tags:
        - External Payments
      summary: Post a payment collected outside Monterey
      description: >-
        Records a payment your organization collected itself against one of its
        accounts. Requires an `Idempotency-Key` header; replaying the same key
        and body returns the original response. Returns 201 when the payment is
        posted and 202 when the outcome is still being confirmed
        (`pending_confirmation`).
      operationId: post_external_payment_v1_accounts__account_id__payments_post
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            type: string
            title: Account Id
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 255
            title: Idempotency-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExternalPaymentCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalPaymentOut'
        '202':
          description: Outcome not yet confirmed (`pending_confirmation`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalPaymentOut'
        '401':
          description: Missing or invalid access token.
        '403':
          description: Authenticated token lacks the required scope (`insufficient_scope`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Account or payment not in scope or does not exist.
        '409':
          description: >-
            `idempotency_conflict` (key reused with a different body) or
            `idempotency_in_progress`.
        '422':
          description: >-
            Invalid request, `account_not_payable`, `amount_exceeds_payoff` or a
            rejected posting (`omega_rejected`, with a `reason`).
        '503':
          description: Payment posting is temporarily unavailable.
      security:
        - BearerToken: []
components:
  schemas:
    ExternalPaymentCreate:
      properties:
        amount_cents:
          type: integer
          exclusiveMinimum: 0
          title: Amount Cents
          description: Payment amount, in integer cents.
        payment_method:
          $ref: '#/components/schemas/ExternalPaymentMethod'
        check_number:
          anyOf:
            - type: integer
              exclusiveMinimum: 0
            - type: 'null'
          title: Check Number
          description: >-
            Required for `check`, `money_order` and `cashiers_check`; not
            allowed for other methods.
        card_brand:
          anyOf:
            - $ref: '#/components/schemas/ExternalCardBrand'
            - type: 'null'
          description: Required for `card`; not allowed for other methods.
        external_reference:
          anyOf:
            - type: string
              maxLength: 64
            - type: 'null'
          title: External Reference
          description: Your own reference for this payment.
        memo:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Memo
          description: Free-text note.
      additionalProperties: false
      type: object
      required:
        - amount_cents
        - payment_method
      title: ExternalPaymentCreate
      description: Request body for recording a payment collected outside Monterey.
    ExternalPaymentOut:
      properties:
        payment_id:
          type: string
          title: Payment Id
          description: Monterey payment ID.
        account_id:
          type: string
          title: Account Id
          description: The account the payment was posted to.
        amount_cents:
          type: integer
          title: Amount Cents
          description: Payment amount, in integer cents.
        payment_method:
          type: string
          title: Payment Method
          description: How the payment was collected.
        check_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Check Number
          description: Check number, when applicable.
        status:
          type: string
          title: Status
          description: >-
            `pending`, `posted`, `pending_confirmation`, `reversal_pending`,
            `reversed` or `failed`.
        effective_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Effective Date
          description: Date the payment applies.
        external_reference:
          anyOf:
            - type: string
            - type: 'null'
          title: External Reference
          description: Your own reference.
        memo:
          anyOf:
            - type: string
            - type: 'null'
          title: Memo
          description: Free-text note.
        reference_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reference Number
          description: Reference number of the posted payment.
        posted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Posted At
          description: When it was posted.
        reversal:
          anyOf:
            - $ref: '#/components/schemas/ReversalOut'
            - type: 'null'
          description: Reversal details; null unless the payment was reversed.
      type: object
      required:
        - payment_id
        - account_id
        - amount_cents
        - payment_method
        - check_number
        - status
        - effective_date
        - external_reference
        - memo
        - reference_number
        - posted_at
        - reversal
      title: ExternalPaymentOut
      description: A payment an organization posted to one of its accounts.
    ErrorResponse:
      properties:
        detail:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - detail
      title: ErrorResponse
      description: Standard error envelope. Branch on `detail.error_code`.
    ExternalPaymentMethod:
      type: string
      enum:
        - cash
        - check
        - card
        - money_order
        - cashiers_check
      title: ExternalPaymentMethod
      description: How the payment was collected.
    ExternalCardBrand:
      type: string
      enum:
        - visa
        - mastercard
        - amex
        - discover
        - diners
      title: ExternalCardBrand
      description: Card network, required when `payment_method` is `card`.
    ReversalOut:
      properties:
        reversed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reversed At
          description: When it was reversed.
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Reason given for the reversal.
        is_nsf:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Nsf
          description: Whether it was reversed as NSF.
        reference_number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reference Number
          description: Reference number of the reversal.
        reversed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Reversed By
          description: Who reversed the payment.
      type: object
      required:
        - reversed_at
        - reason
        - is_nsf
        - reference_number
        - reversed_by
      title: ReversalOut
      description: Reversal details of a payment that has been (or is being) reversed.
    ErrorBody:
      properties:
        error_code:
          type: string
          title: Error Code
      type: object
      required:
        - error_code
      title: ErrorBody
      description: Standard error body. Branch on `error_code`.
  securitySchemes:
    BearerToken:
      type: http
      description: Short-lived access token minted by POST /v1/oauth/token.
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.