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

# Cancel an invoice

> Cancel an invoice



## OpenAPI

````yaml POST /v1/invoices/{id}/cancel
openapi: 3.0.0
info:
  title: Paycashless API
  version: 1.1.0
servers:
  - url: https://api.paycashless.com
    description: Production
security: []
paths:
  /v1/invoices/{id}/cancel:
    post:
      tags:
        - invoices
      description: Cancel an invoice
      parameters:
        - schema:
            type: string
            example: inv_ff0c3z37zi40pvc82g74bgsm4q7fubbw
          required: true
          name: id
          in: path
        - schema:
            type: string
            minLength: 1
            description: SHA-512 HMAC signature of the request payload using the API secret
            example: >-
              5e73d044c44d733fcf819ad3409aaaddca840d421b69cb0b04e2c750fc62ece7526d36296237663ad1f06f62a730c0466516507196b3ce6567493cc52a7cf63d
          required: true
          description: SHA-512 HMAC signature of the request payload using the API secret
          name: Request-Signature
          in: header
        - schema:
            type: string
            pattern: ^\d{10}$
            description: UNIX timestamp when the request was created (in seconds)
            example: '1712336881'
          required: true
          description: UNIX timestamp when the request was created (in seconds)
          name: Request-Timestamp
          in: header
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                cancellationReason:
                  type: string
              required:
                - cancellationReason
      responses:
        '200':
          description: Invoice cancelled successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                  status:
                    type: string
                    enum:
                      - draft
                      - open
                      - paid
                      - partially_paid
                      - cancelled
                  description:
                    type: string
                  currency:
                    type: string
                    enum:
                      - NGN
                      - USD
                  maxInstallments:
                    type: number
                  number:
                    type: string
                  reference:
                    type: string
                  acceptPartialPayments:
                    type: boolean
                  amountDue:
                    type: number
                  amountPaid:
                    type: number
                  amountOverpaid:
                    type: number
                  amountRemaining:
                    type: number
                  subTotal:
                    type: number
                  customerId:
                    type: string
                  sendEmail:
                    type: boolean
                  totalInclusiveTaxAmount:
                    type: number
                  totalExclusiveTaxAmount:
                    type: number
                  cancellationReason:
                    type: string
                    nullable: true
                  taxRateIds:
                    type: array
                    items:
                      type: string
                  logo:
                    type: string
                    nullable: true
                  invoicePdf:
                    type: string
                    nullable: true
                  receiptPdf:
                    type: string
                    nullable: true
                  callbackUrl:
                    type: string
                    nullable: true
                  returnUrl:
                    type: string
                    nullable: true
                  metadata:
                    type: object
                    nullable: true
                    additionalProperties:
                      anyOf:
                        - type: string
                        - type: number
                  daysUntilDue:
                    type: number
                  dueDate:
                    type: string
                    format: date-time
                  paidAt:
                    type: string
                    nullable: true
                    format: date-time
                  cancelledAt:
                    type: string
                    nullable: true
                    format: date-time
                  liveMode:
                    type: boolean
                required:
                  - id
                  - status
                  - description
                  - currency
                  - maxInstallments
                  - number
                  - reference
                  - acceptPartialPayments
                  - amountDue
                  - amountPaid
                  - amountOverpaid
                  - amountRemaining
                  - subTotal
                  - customerId
                  - sendEmail
                  - totalInclusiveTaxAmount
                  - totalExclusiveTaxAmount
                  - cancellationReason
                  - taxRateIds
                  - logo
                  - invoicePdf
                  - receiptPdf
                  - callbackUrl
                  - returnUrl
                  - metadata
                  - daysUntilDue
                  - dueDate
                  - paidAt
                  - cancelledAt
                  - liveMode

````