Public
Refund
Payment refund to the client's card

Scheme of API refund payment
Forming a request to API for self-integration:
Example of using SDK:
#!/bin/bash
PUBLIC_KEY='your_public_key'
PRIVATE_KEY='your_private_key'
API_URL='https://www.liqpay.ua/api/request'
JSON="{ 
	\"action\" : \"refund\",
	\"version\" : 3,
	\"public_key\" : \"${PUBLIC_KEY}\", 
	\"order_id\" : \"order_id_1\"
}"
# DATA is base64_encode result from JSON string
DATA=$(echo -n ${JSON} | base64)
# SIGNATURE is base64 encode result from sha1 binary hash from concatenate string ${PRIVATE_KEY}${DATA}${PRIVATE_KEY}
SIGNATURE=$(echo -n "${PRIVATE_KEY}${DATA}${PRIVATE_KEY}" | openssl dgst -binary -sha1 | base64)
# REQ is json response from liqpay
REQ=$(curl --silent -XPOST ${API_URL} --data-urlencode data="${DATA}" --data-urlencode signature="${SIGNATURE}")
echo "Result: ${REQ}"
$liqpay = new LiqPay($public_key, $private_key);
$res = $liqpay->api("request", array(
'action'        => 'refund',
'version'       => '3',
'order_id'      => 'order_id_1'
));
HashMap<String, String> params = new HashMap<String, String>();
params.put("action", "refund");
params.put("version", "3");
params.put("order_id", "order_id_1");

LiqPay liqpay = new LiqPay(PUBLIC_KEY, PRIVATE_KEY);
HashMap<String, Object> res = liqpay.api("request", params);		
System.out.println(res.get("status"));
from liqpay import LiqPay

liqpay = LiqPay(public_key, private_key)
res = liqpay.api("request", {
"action"        : "refund",
"version"       : "3",
"order_id"      : "order_id_1"
})
liqpay = Liqpay::Liqpay.new(
:public_key  => 'public_key',
:private_key => 'private_key'
)
res = liqpay.api("request", {
:action        => "refund",
:version       => "3",
:order_id      => "order_id_1"
})
LiqPay = liqpay:init(PublicKey, PrivateKey),
Res = liqpay:api("request", [
{<<"action">>, <<"refund">>},
{<<"version">>, <<"3">>},
{<<"order_id">>, <<"order_id_1">>}
], LiqPay)
var LiqPay = require('liqpay');
var liqpay = new LiqPay(public_key, private_key);
liqpay.api("request", {
"action"   : "refund",
"version"  : "3",
"order_id" : "order_id_1"
}, function( json ){
console.log( json.status );
});
my $liqpay = Liqpay->new($public_key,$private_key);
my $res = $liqpay->api("request",
{
'action'        => 'refund',
'version'       => '3',
'order_id'      => 'order_id_1'
}
);
Init("my_public_key", "my_private_key")
Api("request", map[string]interface{}{
    "action": "refund",
    "version": 3,
    "public_key": PublicKey,
    "order_id": "order_id_1",
})
Options for generating data:
Main
Parameter Required Type Description
version Required Number Version API. Current value - 3
public_key Required String Public key - the store identifier. You can get the key in the store settings
action Required String refund
amount Required Number Payment amount. For example: 5, 7.34
order_id Required String Unique purchase ID in your shop. Maximum length is 255 symbols.
Example response:
{
  "action": "refund",
  "payment_id": 165173,
  "status": "reversed"
}
Response parameters
Parameter Type Description
action String Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account, paysplit - splitting payments, subscribe - creation of a regular payment, paydonate - donation, auth - card preauth, regular - regular payment
payment_id Number Payment id in LiqPay system
status String Payment status.
Available values:
Final payment statuses
error Failed payment. Data is incorrect
failure Failed payment
reversed Payment refunded
success Successful payment