Praxis Wiki logo

Agent API {deposit-refund}

{deposit-refund} API function lets you refund the approved deposit transaction. The refund will be a new transaction sent to the same PSP as the one used for the original deposit transaction in order to send the same amount back to customer's account.

{danger.fa-exclamation} IMPORTANT #1: The original referenced transaction (see reference_id request parameter) has to be a deposit having the approved status.

{danger.fa-exclamation} IMPORTANT #2: Please make sure that the PSP supports the refund transaction type. If the refund amount is different from the original deposit amount, you will also need to confirm that the PSP supports the partial refunds.


Name URL


Variable Type Description
merchant_id varchar(50) Required. Merchant API client account identifier
application_key varchar(32) Required. Identifier of your application (website)
amount int(20) Required. Payment amount in cents.
Please note: for certain currencies (JPY, CLP, KRW, VND, BHD, IQD, JOD, LYD, OMR, TND) the amount is sent as-in without being converted to cents, this is important if you multiply by 100 to send the amount in cents
currency varchar(10) Required. Payment currency
reference_id varchar(50) Required. Original transaction identifier from
order_id varchar(50) Required. Transaction identifier in your system
timestamp int(11) Required. Request time. URL will be active during 1 min after this time
version varchar(3) Required. API version
signature varchar(96) Required. Hash of the request parameters


Variable Type Description
status int Required.
- 0 if the request was successful
- Negative integer if internal server/network error occurs
- Positive integer if application/logical error occurs
description varchar(256) Required. Accurate description of the result. Return the actual error for any exception as it helps to diagnose issues in production
trace_id int(11) Required. Transaction identifier in
transaction_id varchar(50) Optional. Transaction identifier in PSP
transaction_status varchar(16) Required.
- pending - processing initiated, final response expected from PSP
- approved - processing was successful
- declined retry - processing failed and will be reattempted
- declined - processing failed
- cancelled - processing cancelled by the merchant or client
- pending async - customer action expected (3D Secure, etc.)
- requested - merchant action expected (approval)
payment_processor varchar(25) Required. Gateway doing the processing
error_code varchar(32) Optional. Error code for rejected transactions
error_details varchar(256) Optional. Error description for rejected transactions
version varchar(3) Required. API version
signature varchar(96) Required. sha384 HASH code of response (same algorithm as request signature)



For example below: Merchant Secret = "MerchantSecretKey"

curl -X POST \ \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
    "amount": 1000,
    "application_key": "Sandbox",
    "currency": "USD",
    "merchant_id": "Test-Integration-Merchant",
    "order_id": "test-1560610955",
    "reference_id": 752856,
    "timestamp": 1578879961,
    "version": "1.2",
    "signature": "29fcf0a2c4e5b1b428db042272aeaf0631df62389baa2bfe2f4ee7c2e95280b0b11390885a52d9c1abe33d16ae238749"

Response (OK)

Response (Approved)

    "description": "Ok",
    "error_code": "0",
    "error_details": "[TEST] Transaction status: approved",
    "payment_processor": "TestPP",
    "status": 0,
    "trace_id": 1000000681,
    "transaction_id": "15607165967620",
    "transaction_status": "approved",
    "version": "1.2",
    "signature": "268ac58da717d65217c7957d7fde679c35c5b5fa58bac53d3cea8fec9739c5bb3acce42d90e11987db43305beadad0ac"

Response (Rejected)

    "description": "Ok",
    "error_code": "1",
    "error_details": "[TEST] Transaction status: declined",
    "payment_processor": "TestPP",
    "status": 0,
    "trace_id": 1000000682,
    "transaction_id": "15607165967622",
    "transaction_status": "declined",
    "version": "1.2",
    "signature": "09f8a113225fa301458eb72eec1c7c368db1b7bbe2f770a831688439e371aa4d89998d2bad68b764848e70c422f9c03f"

Please refer to How to Build Signature for details on signing the request.

You are currently viewing version 3.4 Latest version here