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

# Cancel payment request



## OpenAPI

````yaml /openapi/merchant.openapi.json post /merchant/payment-request/{reference}/cancel
openapi: 3.0.3
info:
  title: Merchant API
  version: 1.0.0
  description: OpenAPI spec for Merchant API
servers:
  - url: https://staging-api.yourflexpay.com/v2
    description: Staging
  - url: https://sandbox-api.yourflexpay.com/v2
    description: Sandbox
  - url: https://api.yourflexpay.com/v2
    description: Live
security: []
tags:
  - name: Merchant QR
  - name: Merchant Payment Request
paths:
  /merchant/payment-request/{reference}/cancel:
    post:
      tags:
        - Merchant Payment Request
      summary: Cancel payment request
      parameters:
        - name: reference
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Cancelled payment request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentRequest'
      security:
        - ClientIdHeader: []
          ApiKeyHeader: []
          MerchantLocationHeader: []
components:
  schemas:
    PaymentRequest:
      type: object
      required:
        - ID
        - Amount
        - Status
        - Type
        - CreatedAt
        - UpdatedAt
      properties:
        ID:
          type: integer
        PayTag:
          $ref: '#/components/schemas/PayTagLite'
        Payer:
          $ref: '#/components/schemas/PayTagLite'
        Amount:
          type: number
        Reference:
          type: string
        Description:
          type: string
        Status:
          $ref: '#/components/schemas/PaymentRequestStatus'
        Type:
          $ref: '#/components/schemas/TransactionType'
        ExpiresAt:
          type: string
          format: date-time
        CreatedAt:
          type: string
          format: date-time
        UpdatedAt:
          type: string
          format: date-time
    PayTagLite:
      type: object
      properties:
        ID:
          type: integer
        Tag:
          type: string
        Name:
          type: string
      additionalProperties: true
    PaymentRequestStatus:
      type: string
      enum:
        - Pending
        - Accepted
        - Declined
        - Cancelled
        - Expired
    TransactionType:
      type: string
      enum:
        - C2C
        - C2P
        - C2M
        - Top Up
        - Adjustment
        - Reversal
        - Withdrawal
        - Bank Transfer
        - FirestoreTransaction
        - Wallet Settlement
        - Reward Redemption
        - Reward
        - Bulk Transfer
        - Exchange
        - Partner Terminal
        - Partner Gateway
        - Card Top Up
        - Vas
        - Airtime Purchase
        - Mobile Data Purchase
        - Terminal Settlement
        - Virtual Account Transfer
        - QR Virtual Account Transfer
        - Idaas Outward Transfer
        - Idaas Inward Transfer
  securitySchemes:
    ClientIdHeader:
      type: apiKey
      in: header
      name: x-client-id
    ApiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
    MerchantLocationHeader:
      type: apiKey
      in: header
      name: x-location

````