> ## 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.

# Create Invoice

> Creates a draft invoice with its line items. Every line must reference an
item (fund/designation) that belongs to the Merchant; the line name and
unit price are snapshotted onto the invoice. The invoice number may be
supplied, otherwise the next number is allocated automatically.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/invoice/create
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/create:
    post:
      tags:
        - Invoice management
      summary: Create Invoice
      description: >-
        Creates a draft invoice with its line items. Every line must reference
        an

        item (fund/designation) that belongs to the Merchant; the line name and

        unit price are snapshotted onto the invoice. The invoice number may be

        supplied, otherwise the next number is allocated automatically.
      operationId: createInvoice
      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_number:
                      type: string
                      description: An optional custom invoice number (unique per Merchant).
                      example: INV-0007
                    customer_id:
                      type: integer
                      description: >-
                        An existing customer id belonging to the Merchant to
                        link.
                      example: 88
                    customer_name:
                      type: string
                      description: The customer name to show on the invoice.
                      example: Jane Doe
                    customer_email:
                      type: string
                      description: The customer email the invoice is addressed to.
                      example: jane@example.com
                    payment_terms:
                      type: string
                      description: 'One of: due_on_receipt, net_15, net_30, net_60.'
                      example: net_15
                    issue_date:
                      type: string
                      description: The issue date (Y-m-d); defaults to today.
                      example: '2026-07-01'
                    thank_you_note:
                      type: string
                      description: An optional note shown on the invoice.
                      example: Thanks for your business!
                    allow_partial_payment:
                      type: boolean
                      description: Whether partial payments are allowed.
                      example: true
                    reminder_settings:
                      type: object
                      description: Optional per-invoice reminder toggles.
                      example:
                        before_due: true
                      properties: {}
                    lines:
                      type: array
                      description: The line items (at least one).
                      example:
                        - []
                      items:
                        type: object
                        properties:
                          item_id:
                            type: integer
                            description: The Merchant item id this line is sourced from.
                            example: 5
                          name:
                            type: string
                            description: The line name.
                            example: Consulting
                          description:
                            type: string
                            description: An optional line description.
                            example: 2 hours
                          quantity:
                            type: number
                            description: The quantity.
                            example: 2
                          unit_price:
                            type: number
                            description: The unit price in dollars.
                            example: 125
                        required:
                          - item_id
                          - name
                          - quantity
                          - unit_price
                  required:
                    - sid
                    - customer_id
                    - customer_name
                    - customer_email
                    - payment_terms
                    - lines
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    id: null
                    token: R5htQiW94vYcE91wyxBYJ01L6yGkz5HOO8nQA5DN
                    invoice_number: INV-70546
                    status: draft
                    payment_terms: net_15
                    issue_date: '2026-06-25'
                    due_date: '2026-07-10'
                    is_overdue: false
                    subtotal: 0
                    total: 0
                    amount_paid: 0
                    balance: 0
                    allow_partial_payment: true
                    thank_you_note: Quos velit et fugiat sunt nihil accusantium harum.
                    public_url: >-
                      http://app.dimepayments.com/invoice/R5htQiW94vYcE91wyxBYJ01L6yGkz5HOO8nQA5DN
                    customer:
                      id: 15120
                      name: Mittie Considine
                      email: lexus42@example.com
                    items: []
                    payments: []
                    events: []
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        example: null
                        nullable: true
                      token:
                        type: string
                        example: R5htQiW94vYcE91wyxBYJ01L6yGkz5HOO8nQA5DN
                      invoice_number:
                        type: string
                        example: INV-70546
                      status:
                        type: string
                        example: draft
                      payment_terms:
                        type: string
                        example: net_15
                      issue_date:
                        type: string
                        example: '2026-06-25'
                      due_date:
                        type: string
                        example: '2026-07-10'
                      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: Quos velit et fugiat sunt nihil accusantium harum.
                      public_url:
                        type: string
                        example: >-
                          http://app.dimepayments.com/invoice/R5htQiW94vYcE91wyxBYJ01L6yGkz5HOO8nQA5DN
                      customer:
                        type: object
                        properties:
                          id:
                            type: integer
                            example: 15120
                          name:
                            type: string
                            example: Mittie Considine
                          email:
                            type: string
                            example: lexus42@example.com
                      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.lines:
                      - The data.lines field is required.
                properties:
                  errors:
                    type: object
                    properties:
                      data.lines:
                        type: array
                        example:
                          - The data.lines field is required.
                        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: Invalid sid
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: No such Merchant
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: No such Merchant
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>.

````