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

# Cancel Mandate

> Cancel an ACTIVE CRDB Direct Debit mandate. When the linked payment plan is still active, the plan and unpaid cycles are cancelled too.

<Note>
  Only mandates with status **ACTIVE** can be cancelled. See the [CRDB Direct Debit API overview](/crdb-direct-debit/api-overview).
</Note>


## OpenAPI

````yaml api-reference/collection/crdb-direct-debit/openapi.json POST /customers/crdb-direct-debit-mandate/cancel
openapi: 3.0.1
info:
  title: CORE API - CRDB Direct Debit
  description: API for requesting, querying, and cancelling CRDB Direct Debit mandates
  version: 1.0.0
servers:
  - url: https://api.clickpesa.com/third-parties
security:
  - bearerAuth: []
paths:
  /customers/crdb-direct-debit-mandate/cancel:
    post:
      tags:
        - CRDB Direct Debit
      summary: Cancel Mandate
      description: >-
        Cancel an ACTIVE CRDB Direct Debit mandate. When the linked payment plan
        is still active, the plan and unpaid cycles are cancelled too.
      operationId: cancelCrdbDirectDebitMandate
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - requestId
              properties:
                requestId:
                  type: string
                  description: The mandateRequestId returned when the mandate was requested
                  example: 69383ce4f8b5a8e2077df9c7
            example:
              requestId: 69383ce4f8b5a8e2077df9c7
      responses:
        '200':
          description: Mandate cancelled
          content:
            application/json:
              schema:
                type: object
                properties:
                  mandateRequestId:
                    type: string
                  mandateStatus:
                    type: string
                    description: Will be CANCELLED after successful cancellation
                  paymentsTotalAmount:
                    type: number
                  paymentsInstallments:
                    type: number
              example:
                mandateRequestId: 69383ce4f8b5a8e2077df9c7
                mandateStatus: CANCELLED
                paymentsTotalAmount: 27500
                paymentsInstallments: 11
        '400':
          description: Mandate not active or service error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                statusCode: 400
                message:
                  - >-
                    Cannot cancel CRDB direct debit mandate. Mandate must be
                    ACTIVE to cancel. Current status: REQUESTED
                error: Bad Request
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Mandate not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: CRDB direct debit mandate not found
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
        statusCode:
          type: number
    UnauthorizedError:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: Unauthorized
        error:
          type: string
          example: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token from Generate Authorization Token

````