1. Purchase
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)
        • Cancel payment (reverse)
        • Refund payment
  • 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
        POST
      • Create payment with any amount
        POST
      • Create recurring payment
        POST
      • Cancel payment
        POST
      • Capture payment (clearing)
        POST
      • Refund payment
        POST
      • Get payment status
        POST
      • Create payment with a payment page template
        POST
      • Create payment in a payment frame
        POST
    • 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. Purchase

Capture payment (clearing)

KZ
https://api.freedompay.kz
KZ
https://api.freedompay.kz
POST
https://api.freedompay.kz
/do_capture.php
Captures the amount of a two-step payment (pg_auto_clearing = 0) that was blocked at authorization.
One clearing per payment: capture the full amount or a part of it; the rest of the amount is released to the client.
pg_status = ok means that the request is processed, not that the amount is captured: check pg_clearing_amount in the response. 0 means that nothing is captured: the amount is greater than the payment amount, the payment is not successful or cancelled, or the payment system declined the clearing.
A repeated request does not capture the amount again: the response returns the amount captured earlier. For a one-step payment the response returns the full amount.
If neither clearing nor cancel is requested within 5 days (the period can be changed for the merchant), the payment is captured or cancelled automatically, depending on the merchant settings. Test payments are not processed automatically.
Test cards: see Merchant API Overview.

Clearing flow#

Result#

pg_statuspg_clearing_amountMeaningNext step
okgreater than 0The amount is captured.To return the money later, call Refund payment.
ok0Nothing is captured.Check the payment with Get payment status.
error—The request is rejected.See «Errors» below.

Errors#

The HTTP status is always 200; the error is returned in pg_error_code and pg_error_description. Error responses are not signed.
pg_error_codeWhenWhat to do
340The payment is not found, is not paid yet or is not a card payment.Check pg_payment_id.
1100The signature is missing or invalid.Check the signature: see Merchant API Overview.
Other codesOther errors of the request.See Error codes.

Request example#

Required fields only. pg_sig is calculated with the secret key test_secret_key.
Line breaks in the body are added for readability: send the body as one line.

Request

Body Params multipart/form-data

Responses

🟢200Success
application/xml
Bodyapplication/xml

Examples
<?xml version="1.0" encoding="utf-8"?>
<response>
    <pg_amount>100</pg_amount>
    <pg_clearing_amount>40</pg_clearing_amount>
    <pg_status>ok</pg_status>
    <pg_salt>9b2aaedvray9F4i3</pg_salt>
    <pg_sig>c980c4c95df5e9e83830d1daf68c42f1</pg_sig>
</response>
🟢200Error
Previous
Cancel payment
Next
Refund payment