Skip to content

Refunds and cancellations

refund.ts
import { ameria } from "./client.js";
const result = await ameria.refundPayment("PAYMENT-ID", 5); // partial refund
if (result.ResponseCode !== "00") {
console.error("Refund failed:", result.ResponseMessage);
}
  • refundPayment(paymentId, amount) returns money from a completed payment. The amount can be less than the original for a partial refund.
  • cancelPayment(paymentId) reverses a payment. For two-step payments it releases an approval that was never confirmed.

Your client needs the bank’s permission for each: response code 513 means no refund permission, 514 no reversal permission.