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

# Pay Invoice

> Records a merchant-initiated (MOTO) payment against an open invoice, charging
a credit card (raw card or a stored token) or a bank account (ACH) through
ProPay. Mirrors the card/ACH charge endpoints but targets the invoice: the
amount is the invoice balance (or a partial amount when the invoice allows
it), no cover fee is added, and on approval the invoice status/payment
history/per-line classification are updated exactly as a customer payment.

The invoice must be open (Sent/Viewed/Partially Paid) with a balance due on
an active ProPay merchant. A declined card is NOT recorded as a payment.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/invoice/pay
openapi: 3.0.3
info:
  title: Dime Payments API Documentation
  description: >-
    A simple, basic API for managing Merchants through Dime Payments. JSON based
    REST API
  version: 1.0.0
servers:
  - url: https://app.dimepayments.com
security:
  - default: []
tags:
  - name: Merchant management
    description: ''
  - name: Transaction management
    description: >-

      APIs for managing transactions.  Depending on API KEY permissions, one
      should be able to

      charge credit cards, ACH, Google/Apple Pay wallets along with other
      functions.
  - name: Addresses
    description: |-

      APIs for managing customer addresses
  - name: Customer management
    description: >-

      APIs for managing customers.  Depending on API KEY permissions, one should
      be able to

      list, create, update, and delete customers along with several other
      customer specific requests.
  - name: Deposit management
    description: ''
  - name: Invoice management
    description: >-

      APIs for managing invoices. Depending on API KEY permissions, one should
      be

      able to list, create, update, delete, and send invoices, manage their line

      items, and manage recurring-invoice schedules. Every request is scoped to
      a

      single Merchant via the required `data.sid`.
  - name: Payment Method management
    description: >-

      APIs for managing payment methods associated with customers.  Depending on
      API KEY permissions, one should be able to

      list, show, create, update, and delete payment methods.
  - name: Recurring Payments management
    description: >-

      APIs for managing recurring payments.  Depending on API KEY permissions,
      one should be able to

      create, edit, pause, cancel along with other functions.
  - name: Zapier
    description: >-

      APIs for use through Zapier.  Depending on API KEY permissions, one should
      be able to

      see customers and transactions data.
paths:
  /api/invoice/pay:
    post:
      tags:
        - Invoice management
      summary: Pay Invoice
      description: >-
        Records a merchant-initiated (MOTO) payment against an open invoice,
        charging

        a credit card (raw card or a stored token) or a bank account (ACH)
        through

        ProPay. Mirrors the card/ACH charge endpoints but targets the invoice:
        the

        amount is the invoice balance (or a partial amount when the invoice
        allows

        it), no cover fee is added, and on approval the invoice status/payment

        history/per-line classification are updated exactly as a customer
        payment.


        The invoice must be open (Sent/Viewed/Partially Paid) with a balance due
        on

        an active ProPay merchant. A declined card is NOT recorded as a payment.
      operationId: payInvoice
      parameters: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: object
                  description: ''
                  example:
                    sid: 12345
                  properties:
                    sid:
                      type: integer
                      description: The SID of the Merchant.
                      example: 12345
                    invoice_id:
                      type: integer
                      description: The id of the open invoice to pay.
                      example: 42
                    payment_type:
                      type: string
                      description: 'The method to charge. One of: cc, ach.'
                      example: cc
                    amount:
                      type: number
                      description: >-
                        A partial amount to pay (only when the invoice allows
                        partial payments); defaults to the full balance.
                      example: 100
                    memo:
                      type: string
                      description: An optional memo for the transaction.
                      example: Phone payment
                    token:
                      type: string
                      description: >-
                        (cc) A stored ProPay card token to charge instead of raw
                        card details.
                      example: abc123
                    cardholder_name:
                      type: string
                      description: (cc, required without data.token) The name on the card.
                      example: Jane Doe
                    card_number:
                      type: string
                      description: >-
                        (cc, required without data.token) The card number (15-16
                        digits).
                      example: '4111111111111111'
                    expiration_date:
                      type: string
                      description: (cc, required without data.token) The expiration in m/Y.
                      example: 01/2028
                    cvv:
                      type: string
                      description: (cc) The card CVV (3-4 digits).
                      example: '123'
                    account_number:
                      type: string
                      description: (ach, required) The bank account number.
                      example: '91828382'
                    routing_number:
                      type: string
                      description: (ach, required) The 9-digit routing number.
                      example: '123456789'
                    account_type:
                      type: string
                      description: (ach, required) Checking or Savings.
                      example: Checking
                    account_name:
                      type: string
                      description: (ach, required) The name on the bank account.
                      example: Jane Doe
                    billing_address:
                      type: object
                      description: ''
                      example:
                        first_name: Jane
                      properties:
                        first_name:
                          type: string
                          description: Billing first name.
                          example: Jane
                        last_name:
                          type: string
                          description: Billing last name.
                          example: Doe
                        addr1:
                          type: string
                          description: Billing address line 1.
                          example: 123 Main St
                        addr2:
                          type: string
                          description: Billing address line 2.
                          example: Suite 2
                        city:
                          type: string
                          description: Billing city.
                          example: Alpharetta
                        state:
                          type: string
                          description: Billing state (2 letters).
                          example: GA
                        zip:
                          type: string
                          description: Billing ZIP (5 digits).
                          example: '30004'
                  required:
                    - sid
                    - invoice_id
                    - payment_type
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: null
                    token: 9jLytvaGYXXQJUMS4rcDR971hcqorbVY8lHSmIGL
                    invoice_number: INV-30805
                    status: draft
                    payment_terms: net_15
                    issue_date: '2026-07-20'
                    due_date: '2026-08-04'
                    is_overdue: false
                    subtotal: 0
                    total: 0
                    amount_paid: 0
                    balance: 0
                    allow_partial_payment: true
                    thank_you_note: null
                    public_url: >-
                      http://app.dimepayments.com/invoice/9jLytvaGYXXQJUMS4rcDR971hcqorbVY8lHSmIGL
                    customer:
                      id: 15126
                      name: Prof. Mina Bauch
                      email: okeefe.isidro@example.org
                    items: []
                    payments: []
                    events: []
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: null
                        nullable: true
                      token:
                        type: string
                        example: 9jLytvaGYXXQJUMS4rcDR971hcqorbVY8lHSmIGL
                      invoice_number:
                        type: string
                        example: INV-30805
                      status:
                        type: string
                        example: draft
                      payment_terms:
                        type: string
                        example: net_15
                      issue_date:
                        type: string
                        example: '2026-07-20'
                      due_date:
                        type: string
                        example: '2026-08-04'
                      is_overdue:
                        type: boolean
                        example: false
                      subtotal:
                        type: integer
                        example: 0
                      total:
                        type: integer
                        example: 0
                      amount_paid:
                        type: integer
                        example: 0
                      balance:
                        type: integer
                        example: 0
                      allow_partial_payment:
                        type: boolean
                        example: true
                      thank_you_note:
                        type: string
                        example: null
                        nullable: true
                      public_url:
                        type: string
                        example: >-
                          http://app.dimepayments.com/invoice/9jLytvaGYXXQJUMS4rcDR971hcqorbVY8lHSmIGL
                      customer:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 15126
                          name:
                            type: string
                            example: Prof. Mina Bauch
                          email:
                            type: string
                            example: okeefe.isidro@example.org
                      items:
                        type: array
                        example: []
                      payments:
                        type: array
                        example: []
                      events:
                        type: array
                        example: []
        '400':
          description: Failed validation
          content:
            application/json:
              schema:
                type: object
                example:
                  errors:
                    data.card_number:
                      - >-
                        The data.card number field is required when data.token
                        is not present.
                properties:
                  errors:
                    type: object
                    properties:
                      data.card_number:
                        type: array
                        example:
                          - >-
                            The data.card number field is required when
                            data.token is not present.
                        items:
                          type: string
        '401':
          description: Token unauthorized
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Permission Denied.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Permission Denied.
        '404':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: Invalid sid
                    type: object
                    example:
                      data:
                        message: No such Merchant
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: No such Merchant
                  - description: Invoice not found
                    type: object
                    example:
                      data:
                        message: Invoice not found
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Invoice not found
        '422':
          description: ''
          content:
            application/json:
              schema:
                oneOf:
                  - description: Not payable
                    type: object
                    example:
                      data:
                        message: >-
                          This invoice cannot be paid (it must be an open
                          invoice with a balance due on an active ProPay
                          merchant).
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: >-
                              This invoice cannot be paid (it must be an open
                              invoice with a balance due on an active ProPay
                              merchant).
                  - description: Method not accepted
                    type: object
                    example:
                      data:
                        message: This payment method is not accepted by the merchant.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: >-
                              This payment method is not accepted by the
                              merchant.
                  - description: Already processing
                    type: object
                    example:
                      data:
                        message: >-
                          A payment for this invoice is already being processed.
                          Please try again in a moment.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: >-
                              A payment for this invoice is already being
                              processed. Please try again in a moment.
                  - description: Amount exceeds balance
                    type: object
                    example:
                      data:
                        message: The payment amount exceeds the $50.00 balance now due.
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: >-
                              The payment amount exceeds the $50.00 balance now
                              due.
                  - description: Declined
                    type: object
                    example:
                      data:
                        message: The card was declined.
                        code: '51'
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: The card was declined.
                          code:
                            type: string
                            example: '51'
        '500':
          description: Captured but not recorded
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: >-
                      The payment was captured but could not be recorded. Do not
                      retry — please contact support to reconcile this invoice.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: >-
                          The payment was captured but could not be recorded. Do
                          not retry — please contact support to reconcile this
                          invoice.
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: >-
        You can retrieve your token by visiting your dashboard and clicking
        <b>Generate API token under your profile in top right</b>.

````