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
      • Payout
        • Overview
        • Pay out to card
        • Pay out to IBAN
        • Get payout balance
        • Get payout status
      • Transfer
        • 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
      • Read
        • Get payment status
        • Get request result
      • Edit
        • Capture payment (clearing)
          POST
        • Cancel payment (reverse)
          POST
        • Refund payment
          POST
  • Merchant API
    • Overview
    • Purchase
      • Overview
      • Checkout
      • Card token
        • Overview
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment (with CVC)
        • Confirm payment (with CVC)
        • Create payment
        • Confirm payment
      • Create payment
      • Any amount
      • Reccuring payment
      • Cancel payment
      • Clearing
      • Refund payment
      • Status
    • Payout
      • Overview
      • Card token
        • Tokenize card
        • Delete token
        • Card token list
        • Create payment
      • Create payment
      • IBAN
      • Balance status
      • Status
    • Mobile balance
      • Overview
      • Init
      • Pay
      • Approve
      • Resend code
      • Status
    • Invoice
      • Overview
      • Recurring profile
        • Overview
        • Create
        • Cancel
        • Info
        • Notify
      • Tips
        • Overview
        • Create
      • Create
      • Execute
      • Info
      • Refund
      • Status
      • Cancel
    • SDK
      • JS SDK
      • Merchant SDK
        • Google Pay
        • 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
    • Installment
      • Overview
      • Status
        • Application Status
        • Application Callback Status
        • Application Change Status
      • Get partners
      • Create application
    • Redirect back
      POST
    • Result notify
      POST
    • Payout notify
      POST
    • Check request
      POST
  • 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

Refund payment

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/v5/g2g/edit
Refunds a debited payment fully or partially.
The X-Action header must be gateway.payment.refund.
Sign the request with X-JWS-Signature: see Async API Overview.
Refund is possible only for a payment in status success: to cancel a hold that is not cleared use gateway.payment.reverse.
Several partial refunds are allowed while their total with reversals does not exceed the payment amount.
The status of the payment stays success: count only refund_payments items with status success.

Refund flow#

Result#

ResponseMeaningNext step
refund_payment.status = processThe refund is accepted: a child refund payment is created.Get the final status with gateway.payment.status: the refund is listed in refund_payments. If the response is lost, use gateway.request.status.
status = errorThe refund is rejected: a failed refund payment is returned.See «Errors» below. The failed attempt is also listed in refund_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 refund is returned with HTTP 200 as a failed refund payment: status error and the error object.
The error is returned in error.code and error.description.
HTTPerror.codeWhenWhat to do
200110691Invalid payment status: refund is possible only for a payment in status success (not approved, not reversed, not failed).Get the payment status with gateway.payment.status. To cancel a hold that is not cleared use gateway.payment.reverse.
200900811The refund amount exceeds the amount available for refund.Pass a smaller amount: the total of refunds and reversals cannot exceed the payment amount.
2009994Refund 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, amount is less than 0.01, 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

Examples
{
  "id": "01a133d6-91e2-7993-8302-61572319a64a"
}

Responses

🟢200OK
application/json
Headers

Bodyapplication/json

Examples
{
  "id": "01a133d6-91e2-7993-8302-61572319a64a",
  "amount": 100,
  "refund_payment": {
    "id": "01a133d6-9e79-7b54-969c-4b269bd9b2e3",
    "status": "process",
    "amount": -30
  }
}
🟠400Bad Request
🟠422Unprocessable Entity
🟠401Unauthorized
🔴500Internal Server Error
Previous
Cancel payment (reverse)
Next
Overview