1. Edit
Freedom Pay
  • Overview
  • Gateway API
    • Overview
    • Sync API
      • Overview
      • Card data encryption
      • Payments
        • Overview
        • Pay by card
        • Pay by card: complete 3DS
        • Pay with Apple Pay
        • Pay with Google Pay
        • Pay by recurring profile
        • Create payment page
        • Create payment page with any amount
        • Capture payment (clearing)
        • Cancel payment
        • Refund payment
        • Get payment status
      • Payouts
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfers
        • Overview
        • Transfer from card to card
        • Transfer from card to card: complete 3DS
        • Get exchange rates
        • Get transfer status
      • Saved cards
        • Overview
        • Save card
        • Save card: complete 3DS
        • List saved cards
        • Remove saved card
        • Pay by card token
        • Pay out to card token
        • Get payment status
    • Async API
      • Overview
      • Create
        • Create payment
        • Save card without a charge
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
          POST
        • Cancel payment (reverse)
          POST
        • Refund payment
          POST
  • Merchant API
    • Overview
    • Payments
      • Overview
      • Checkout
      • Pay by saved card
        • Overview
        • Create payment
        • Confirm payment with CVC
        • Confirm payment without the client
      • Create payment
      • Create payment with a payment page template
      • Create payment in a payment frame
      • Create payment with any amount
      • Create recurring payment
      • Capture payment (clearing)
      • Cancel payment
      • Refund payment
      • Get payment status
    • Payouts
      • Overview
      • Create payout page
      • Pay out to saved card
      • Pay out to IBAN
      • Get payout status
      • Get payout balance
    • Saved cards
      • Get saved cards
      • Save card
      • Save card for payouts
      • Delete saved card
      • Save card without a charge
    • Mobile balance
      • Overview
      • Create mobile balance payment
      • Charge mobile balance
      • Get mobile balance payment status
      • Confirm payment with SMS code
      • Resend SMS code
    • Invoices
      • Overview
      • Recurring payments
        • Overview
        • Create recurring profile
        • Get recurring profile
        • Charge by recurring profile
        • Cancel recurring profile
        • Recurring profile notification
      • Tips
        • Overview
        • Create
      • Create invoice
      • Get invoice status
      • Get invoice details
      • Cancel invoice
      • Refund invoice
    • SDK
      • JS SDK
      • Merchant SDK
        • Android
        • iOS
    • CMS
      • Overview
      • Get Merchant ID and key
      • WordPress
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
        • Update
      • Tilda
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • InSales
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Ecwid
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • Bitrix
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • PrestaShop
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • OpenCart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
      • CS-Cart
        • Overview
        • Installation
        • Configuration
        • Test
        • Live payments
    • Installment
      • Overview
      • Status
        • Get application status
        • Application status notification
        • Change application status
      • Get partners
      • Create application
    • Callbacks
      • Overview
      • Result notify
      • Check request
      • Payout notify
      • Redirect back
  • Partner API
    • Rates
      • Overview
      • Rates
    • Products
      • Overview
      • Dictionaries
      • Add client with product
      • Client request status
      • Create terminal
      • Update terminal limits
      • Product request status
    • E-Money
      • Overview
      • Add
      • Owner identification
      • Info
      • Close
      • Block
      • Balance
      • Statement
      • Request Status
    • Device ID
      • Android SDK
      • iOS SDK
    • Implement SuperApp
      • Overview
      • Pay
      • Refund
      • Status
    • Account
      • Overview
      • Create payment
      • Payment status
      • Batch statuses
      • Statement
      • Statement status
      • Balance
      • Balance status
    • Invoices
      • Info
  1. Edit

Cancel payment (reverse)

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/v5/g2g/edit
Cancels the hold of a two-step payment (auto_clearing = false) and releases the funds.
The X-Action header must be gateway.payment.reverse.
Sign the request with X-JWS-Signature: see Async API Overview.
Reversal is possible only for a payment in status approved that is not cleared: for a cleared payment use gateway.payment.refund.

Reverse flow#

The full two-step flow (create, clearing or reverse, refund) is shown in Capture payment (clearing).

Result#

ResponseMeaningNext step
reverse_payment.status = processThe reversal is accepted: a child reversal payment is created.Get the final status with gateway.payment.status: the payment gets status reversed. If the response is lost, use gateway.request.status.
status = errorThe reversal is rejected: a failed reversal payment is returned.See «Errors» below. The failed attempt is also listed in reverse_payments of the original payment.
{}, X-Request-Status: processThe result is not ready yet.Repeat the request in a few seconds with the same X-Request-Id.

Errors#

A rejected reversal is returned with HTTP 200 as a failed reversal payment: status error and the error object.
The error is returned in error.code and error.description.
HTTPerror.codeWhenWhat to do
200110691Invalid payment status: reversal is possible only for a two-step payment in status approved that is not cleared and not reversed yet.Get the payment status with gateway.payment.status. For a cleared payment use gateway.payment.refund.
2009994Reversal is disabled in the merchant settings.Contact Freedom Pay.
4009400The body is not valid JSON.Fix the request.
4019998The signature is invalid.Check the signature: see Async API Overview.
4229403id is missing or is not a UUID, or a required header is missing. The reason is in error.description.Fix the request.
5009999Internal error at the gateway entry point.Repeat the request later with the same X-Request-Id.
50010000Internal error in payment processing.Repeat the request later with the same X-Request-Id.

Request

Header Params

Body Params application/json

Example
{
  "id": "01a133ca-fa79-7f0c-82d7-7c04ba783963"
}

Responses

🟢200OK
application/json
Headers

Bodyapplication/json

Example
{
    "id": "01a133ca-fa79-7f0c-82d7-7c04ba783963",
    "amount": 100,
    "reverse_payment": {
        "id": "01a133cb-07bc-7115-8c30-afe77ae49495",
        "status": "process"
    },
    "status": "error",
    "created_at": "2026-10-13T05:45:12.452783942Z",
    "error": {
        "code": "110691",
        "description": "Invalid payment status."
    }
}
🟠400Bad Request
🟠422Unprocessable Entity
🟠401Unauthorized
🔴500Internal Server Error
Previous
Capture payment (clearing)
Next
Refund payment