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

# Expire a Payment Transaction

> Expire a payment link to prevent further payments.

## Endpoint

`POST /expire-pay`

Expire a payment link to prevent further payments.

<Note>Only transactions that were created with the [initiate-pay](/en/api-reference/endpoint/initiate-pay) endpoint can be expired.</Note>

## Parameters

| Name    | Required | Type   | Description                     |
| :------ | :------- | :----- | :------------------------------ |
| transId | Yes      | string | ID of the transaction to expire |

## Response

* Returns details of the expired transaction if successful.
* Returns `400 Bad Request` with message `"Link already expired"` if the transaction was already expired.


## OpenAPI

````yaml /en/api-reference/openapi.json POST /expire-pay
openapi: 3.1.0
info:
  title: Fapshi Payment API
  description: >-
    API for generating payment links, direct payments, transaction monitoring,
    payouts, and more.
  version: 1.0.0
servers:
  - url: https://sandbox.fapshi.com
security:
  - apiAuth: []
    apiKey: []
paths:
  /expire-pay:
    post:
      summary: Expire a Payment Transaction
      description: Invalidate a payment link to prevent further payments.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                transId:
                  type: string
                  description: Transaction ID to expire.
              required:
                - transId
      responses:
        '200':
          description: Payment link expired successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Transaction'
        '400':
          description: Link already expired or invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Transaction:
      type: object
      properties:
        transId:
          type: string
          description: Transaction ID of the payment.
        status:
          type: string
          enum:
            - CREATED
            - PENDING
            - SUCCESSFUL
            - FAILED
            - EXPIRED
          description: Transaction status
        medium:
          type: string
          enum:
            - mobile money
            - orange money
            - fapshi
          description: Payment method
        serviceName:
          type: string
          description: Name of the service in use
        transType:
          type: string
          enum:
            - Collection
            - Payout
          description: Type of transaction
        amount:
          type: integer
          description: Transaction amount
        revenue:
          type: integer
          description: Amount received when Fapshi fees have been deducted
        payerName:
          type: string
          description: Client name
        email:
          type: string
          format: email
          description: Client email
        redirectUrl:
          type: string
          format: uri
          description: URL to redirect after payment
        externalId:
          type: string
          description: The transaction ID on your application
        userId:
          type: string
          description: ID of the client on your application
        webhook:
          type: string
          format: uri
          description: The webhook you defined for your service
        reason:
          type: string
          description: Typically appears when a payout via fapshi fails
        financialTransId:
          type: string
          description: Transaction ID with the payment operator
        dateInitiated:
          type: string
          format: date
          description: Date when the payment was initiated
        dateConfirmed:
          type: string
          format: date
          description: Date when the payment was made
    Error:
      type: object
      properties:
        message:
          type: string
          description: Error message.
  securitySchemes:
    apiAuth:
      type: apiKey
      in: header
      name: apiuser
    apiKey:
      type: apiKey
      in: header
      name: apikey

````