Public
Invoice
Issuing the invoice to the client's email in sever-server mode


Creating
Scheme of API invoice
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\" : \"invoice_send\",
    \"version\" : 3,
    \"public_key\" : \"${PUBLIC_KEY}\", 
    \"email\" : \"client-email@gmail.com\", 
    \"amount\" : 200,
    \"currency\" : \"USD\",
    \"order_id\" : \"order_id_1\",
    \"goods\" : \"[{
        \\\"amount\\\" : 100,
        \\\"count\\\" : 2,
        \\\"unit\\\" : \\\"шт.\\\",
        \\\"name\\\" : \\\"USB\\\"
    }]\",
}"
# 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'    => 'invoice_send',
'version'   => '3',
'email'     => 'client-email@gmail.com',
'amount'    => '200',
'currency'  => 'USD',
'order_id'  => 'order_id_1',
'goods'     => array(array(
'amount' => 100,
'count'  => 2,
'unit'   => 'шт.',
'name'   => 'телефон'
))
));
HashMap<String, String> params = new HashMap<String, String>();
params.put("action", "invoice_send");
params.put("version", "3");
params.put("email", "client-email@gmail.com");
params.put("amount", "200");
params.put("currency", "USD");
params.put("order_id", "order_id_1");
params.put("goods", "[{"
+ "\"amount\":100,"
+ "\"count\":2,"
+ "\"unit\":\"шт.\","
+ "\"name\":\"телефон\""
+ "}]");

LiqPay liqpay = new LiqPay(PUBLIC_KEY, PRIVATE_KEY);
HashMap<String, Object> res = liqpay.api("request", params);		
System.out.println(res.get("result"));
liqpay = LiqPay(public_key, private_key)
res = liqpay.api("request", {
"action"    : "invoice_send",
"version"   : "3",
"email"     : "client-email@gmail.com",
"amount"    : "1",
"currency"  : "USD",
"order_id"  : "order_id_1",
"goods"     : [{
"amount" : 100,
"count"  : 2,
"unit"   : "шт.",
"name"   : "телефон"
}]
})
liqpay = Liqpay::Liqpay.new(
:public_key  => 'public_key',
:private_key => 'private_key'
)
res = liqpay.api("request", {
:action   => "invoice_send",
:version  => "3",
:email    => "client-email@gmail.com",
:amount   => "1",
:currency => "USD",
:order_id => "order_id_1",
:goods    => [{
:amount => 100,
:count  => 2,
:unit   => "шт.",
:name   => "телефон"
}]
})
LiqPay = liqpay:init(PublicKey, PrivateKey),
Res = liqpay:api("request", [
{<<"action">>, <<"invoice_send">>},
{<<"version">>, <<"3">>}, 
{<<"email">>, <<"client-email@gmail.com">>}, 
{<<"amount">>, <<"1">>}, 
{<<"currency">>, <<"USD">>}, 
{<<"order_id">>, <<"order_id_1">>}, 
{<<"goods">>, [[
{<<"amount">>, 100},
{<<"count">>, 2},
{<<"unit">>, <<"шт.">>},
{<<"name">>, <<"телефон">>},
]]}
], LiqPay)
var LiqPay = require('liqpay');
var liqpay = new LiqPay(public_key, private_key);
liqpay.api("request", {
"action"   : "invoice_send",
"version"  : "3",
"email"    : "client-email@gmail.com",
"amount"   : "1",
"currency" : "USD",
"order_id" : "order_id_1",
"goods"    : [{
"amount" : 100,
"count"  : 2,
"unit"   : "шт.",
"name"   : "телефон"
}]
}, function( json ){
console.log( json.result );
});
my $liqpay = Liqpay->new($public_key,$private_key);
my $res = $liqpay->api("request",
{
'action'   => 'invoice_send',
'version'  => '3',
'email'    => 'client-email@gmail.com',
'amount'   => '1',
'currency' => 'USD',
'order_id' => 'order_id_1',
'goods'    => [{
'amount' => 100,
'count'  => 2,
'unit'   => 'шт.',
'name'   => 'телефон'
}]
}
);
Init("my_public_key", "my_private_key")
Api("request", map[string]interface{}{
    "action": "invoice_send",
    "version": 3,
    "public_key": PublicKey,
    "order_id": "order_id_1",
    "email": "client-email@gmail.com", 
    "amount": 200,
    "currency": "USD",
    "split_rules": []interface{}{
        map[string]interface{}{
            "count": 1,
            "amount": 0.2,
            "unit": "pcs",
            "name": "unit_name",
        },
        map[string]interface{}{
            "count": 1,
            "amount": 0.2,
            "unit": "pcs",
            "name": "unit_name",
        },
    },
})
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 invoice_send
amount Required Number Payment amount. For example: 5, 7.34
currency Required String Payment currency. Possible values: USD, EUR, RUB, UAH
description Required String Payment description.
email Required String Customer's e-mail to send invoice (phone or email required parameters for transmission)
order_id Required String Unique purchase ID in your shop. Maximum length is 255 symbols.
phone Required String The phone to which the invoice will be sent (phone or email required parameters for transmission)
action_payment Optional String Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account, subscribe - regular payment, paydonate - donation
expired_date Optional String Date and time untill which customer is able to pay invoice by UTC. Should be sent in the following format 2016-04-24 00:00:00
goods Optional String List of items
[
  {
    "amount": 1,
    "count": 2,
    "unit": "pcs.",
    "name": "USB"
  },
  {
    "amount": 10,
    "count": 1,
    "unit": "pcs.",
    "name": "Phone"
  }
]
language Optional String Customer's language ru, uk, en
result_url Optional String URL of your shop where the buyer would be redirected after completion of the purchase. Maximum length 510 symbols.
server_url Optional String URL API in your store for notifications of payment status change (server->server). Maximum length is 510 symbols. Learn more
Example response:
{
  "id": 6173,
  "status": "invoice_wait",
  "amount": 0.03,
  "currency": "UAH",
  "description": "Invoice",
  "order_id": "98R1U1OV1485849059893399",
  "token": "150112455893001_6480_GBe3Mxwnq2O7G0MLX4gkQLtZf2",
  "href": "https://liqpay.ua/apipay/invoice/150112455893001_6480_GBe3Mxwnq2O7G0MLX4gkQLtZf2",
  "receiver_type": "email",
  "receiver_value": "test@gmail.com",
  "action": "pay"
}
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
amount Number Payment amount
currency String Payment currency
description String Payment description
href String Link to invoice
id Number Payment id in LiqPay system
order_id String Order_id payment
receiver_type String Receive channel type
receiver_value String The value obtained in the parameter receiver_type
status String Payment status.
Available values:
Final payment statuses
error Failed payment. Data is incorrect
failure Failed payment
success Successful payment
Other payment statuses
invoice_wait Invoice is created successfully, waiting for a payment
token String Payment token