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

# Delete Invoice

> Soft-deletes a draft invoice. Only draft invoices can be deleted.



## OpenAPI

````yaml https://app.dimepayments.com/openapi.yaml post /api/invoice/delete
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/delete:
    post:
      tags:
        - Invoice management
      summary: Delete Invoice
      description: Soft-deletes a draft invoice. Only draft invoices can be deleted.
      operationId: deleteInvoice
      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 draft invoice.
                      example: 42
                  required:
                    - sid
                    - invoice_id
      responses:
        '200':
          description: Deleted
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Draft invoice deleted.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Draft invoice deleted.
                        description: 'The result message. Example: Draft invoice deleted.'
        '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.
                        description: 'The result message. Example: Draft invoice deleted.'
        '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: >-
                              The result message. Example: Draft invoice
                              deleted.
                  - description: Invoice not found
                    type: object
                    example:
                      data:
                        message: Invoice not found
                    properties:
                      data:
                        type: object
                        properties:
                          message:
                            type: string
                            example: Invoice not found
                            description: >-
                              The result message. Example: Draft invoice
                              deleted.
        '422':
          description: Invoice locked
          content:
            application/json:
              schema:
                type: object
                example:
                  data:
                    message: Only draft invoices can be deleted.
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Only draft invoices can be deleted.
                        description: 'The result message. Example: Draft invoice deleted.'
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>.

````