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

# Cancel a Payment

> Cancel a payment that has not yet been debited.



## OpenAPI

````yaml POST /v1/payments/{id}/cancel
openapi: 3.1.0
info:
  title: Plexos Pay API
  description: Mobile Money Payment Gateway for African Markets
  version: 1.0.0
  contact:
    name: Plexos Pay
    url: https://plexospay.com
servers:
  - url: https://api.plexospay.com
    description: Production
security:
  - bearerAuth: []
paths:
  /v1/payments/{id}/cancel:
    post:
      tags:
        - Payments
      summary: Cancel a payment
      description: Cancel a payment that has not yet been debited.
      operationId: cancelPayment
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Payment cancelled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payment'
components:
  schemas:
    Payment:
      type: object
      properties:
        id:
          type: string
          example: pi_abc123
        externalId:
          type: string
          nullable: true
        amount:
          type: string
          description: Amount in centavos
          example: '10000'
        currency:
          $ref: '#/components/schemas/Currency'
        feeAmount:
          type: string
          example: '200'
        netAmount:
          type: string
          example: '9800'
        operator:
          $ref: '#/components/schemas/Operator'
        operatorPhone:
          type: string
          example: '+2389001234'
        operatorTxId:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/PaymentStatus'
        failureCode:
          type: string
          nullable: true
        failureMessage:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        statementDescriptor:
          type: string
          nullable: true
        customerId:
          type: string
          nullable: true
        metadata:
          $ref: '#/components/schemas/Metadata'
        expiresAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Currency:
      type: string
      enum:
        - CVE
        - AOA
      description: ISO currency code
    Operator:
      type: string
      enum:
        - CVMOVEL
        - UNITEL_TMAIS
        - MOCK
      description: Mobile money operator
    PaymentStatus:
      type: string
      enum:
        - CREATED
        - OPERATOR_PENDING
        - USER_CONFIRMING
        - DEBITED
        - SETTLED
        - FAILED
        - EXPIRED
        - REFUNDED
        - PARTIALLY_REFUNDED
        - CANCELLED
    Metadata:
      type: object
      additionalProperties: true
      description: Arbitrary key-value metadata (max 50 keys)
      nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key starting with `sk_live_` or `sk_test_`

````