m2pfintech
API LibraryBalance And Transactions

Reverse a previous transaction

Reverse a previously completed transaction. Supports both full and partial reversals.

For a full reversal, omit the amount field or set it equal to the original transaction amount. For a partial reversal, provide the partial amount (must be less than the original). The partial reversal amount must not exceed the original transaction amount.

The originalTransactionId identifies which transaction to reverse. A transaction can only be reversed once for full reversals. Multiple partial reversals are allowed as long as the total does not exceed the original amount.

POST
/Yappay/transaction-manager/reverse

Authorization

BearerAuth TenantHeader
AuthorizationBearer <token>

JWT Bearer token obtained from the /auth/login endpoint

In: header

TENANT<token>

Tenant identifier provided by M2P (e.g. ENBDTABBY)

In: header

Request Body

application/json

originalTransactionId*string

Transaction ID of the original transaction to reverse

amount?number

Amount to reverse. If omitted, the full original amount is reversed. For partial reversal, specify the partial amount (must not exceed original).

Formatdouble
reason*string

Reason for the reversal. Mandatory for audit purposes.

Response Body

application/json

application/json

curl -X POST "https://api.m2p.com/Yappay/transaction-manager/reverse" \  -H "Content-Type: application/json" \  -d '{    "originalTransactionId": "TXN20260306005678",    "reason": "Customer dispute - item not received"  }'
{
  "status": "success",
  "data": {
    "reversalTransactionId": "TXN20260306009999",
    "originalTransactionId": "TXN20260306005678",
    "reversedAmount": 1000,
    "availableBalance": 18500
  }
}

{
  "result": null,
  "exception": {
    "detailMessage": "Reversal not allowed for this transaction type",
    "shortMessage": "Reversal not allowed",
    "errorCode": "TXN_020",
    "languageCode": "en"
  },
  "pagination": null
}