Invoice for Bots public

Creating invoice using bot

Find out how to set bots for Facebook and Telegram in Corezoid

API Ivoice Bot doc:

Request
Param Required Type Description
version yes Number Version API. Current value - 3
public_key yes String Public key - the store identifier. You can get the key in the store settings
merchant_public_key yes String Public_key of agent shop
action yes String Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account, subscribe - regular payment, paydonate - donation, auth - card preauth
action yes String invoice_bot
order_id yes String order_id of successful payment
email yes String email for reciept sending
compensation_id no* String compensation_id проводки зачисления
resp_format no* String Possible report format json, csv, xml. If parameter is not passed, will be passed by default json.
date no** String If the compensation id parameter is unknown, then date by which you need to get a compensation id list, is transferred
phone yes String Payer's mobile phone. One time password will be sent to the number to confirm the payment. Mobile number should be in the international format (Ukraine +380, Russia +7). For example: +380950000001 (with +) or 380950000001 (without +)
amount yes Number Payment amount.For example: 5, 7.34
currency yes String Payment currency. Available values: USD, EUR, RUB, UAH BYN KZT. Additional currencies can be added by company's request.
description yes String Payment description.
order_id yes String Unique purchase id in your store.The maximum length is 255 characters.
confirm yes String Flag of request confirmation. Possible values: yes, no
card yes String Card number of the payer
card_exp_month yes String Expiry month of the payer's card.For example: 08
card_exp_year yes String Expiry year of the payer's card.For example:19
card_cvv yes String CVV/CVV2
card_token yes String Sender's card token.For example: B5BВB0D00B88B00ED00A00D0D
card_track yes String Sender's card track.For example:1111222233334444=1703000000000000000
imei yes String Device IMEI
receiver_card yes String Recipient's card number
bitcoin_addr yes String Bitcoin wallet that needs to be topped up
ip yes String client IP.
email yes String customer's e-mail to send invoice
channel_type yes String Bot channel. Supported values: telegram
account yes String User ID in messenger
language no String Customer's language ru, uk, en.
sandbox no String Enables the testing environment for developers. Payer card will not be charged. To enable testing environment you will need to transmit value 1. All test payments will have sandbox status - success test payment.
prepare no String Preparation of the request. This mode allows to check if all data are filled in, if 3DS authentication is required, if transaction is within limit. Payer card will not be charged. To enable this mode you will need to transmit value 1.
recurringbytoken no String This parameter allows to generate payer card_token which you receive in callback request to server_url. card_token allows to make recurring payments without payer card requisites using paytoken. To receive card_token please send in request value: 1
server_url no String URL API in your store for notifications of payment status change (server->server). The maximum length is 510 characters. Learn more
result_url no String Your store URL where customer will be redirected after purchasing in case of redirecting through 3ds page 3DS-verify. Maximum length 510 symbols.
receiver_card_token no String Recipient's card token. For example: B5BВB0D00B88B00ED00A00D0D
result_url no String URL in your store where the payer will be redirected after the payment. The maximum length is characters .
paytypes no String Parameter that gets the methods of payments that displayed on checkout. Possible values card - card payment, liqpay - with liqpay account, privat24 - with privat24 account, masterpass - with masterpass account, moment_part - installments, cash - cash, invoice - to email, qr - qr code scanning. If the parameter is not passed, shop settings will be applied, Checkout tab.
verifycode no String Possible Y value. Dynamic verification code is generated and going back to Callback. Also generated code will be transferred to verification transactions for displaying in statement by client's card. Works for action = auth.
token no String payment token
otp no String One time password that customer received to his phone numbert
date_from no String Start date of a report in timestamp in milliseconds
date_to no String End date of a report in timestamp in milliseconds
resp_format no String Possible report format json, csv, xml. If parameter is not passed, will be passed by default json.
phone yes String Shop phone number
public_phone no String Shop public phone number
logo no String URL shop logo
site yes String Store URL
description yes String Store description
email yes String Store e-mail
name yes String Store name
card yes * String Card number to receive payments in this store
card_exp_month yes * String Expiry month of the card
card_exp_year yes * String Expiry year of the card
card_cvv yes * String CVV/CVV2
account yes ** String Account number to receive payments in this store
mfo yes ** String Formation
okpo yes ** String OKPO of the account
company yes ** String Account name
amount_procent_agent no Number Agent fee in %
amount_static_agent no * Number Agent static fee
currency_static_agent no * String Currency of agent static fee
expired_date no 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
action_payment no String Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account, subscribe - regular payment, paydonate - donation
goods no String List of items
[
  {
    "amount": 1,
    "count": 2,
    "unit": "pcs.",
    "name": "USB"
  },
  {
    "amount": 10,
    "count": 1,
    "unit": "pcs.",
    "name": "Phone"
  }
]
Sender parameters
sender_first_name no String Payer first name
sender_last_name no String Payer last name
sender_country_code no String Payer card country. Digital ISO 3166-1 code
sender_city no String Payer city
sender_address no String Payer address
sender_postal_code no String Payer zip code
Receiver parameters
receiver_first_name no String Recipient first name
receiver_last_name no String Recipient last name
Regular payment parameters
subscribe no String Regular payment.Possible values: 1
subscribe_date_start no String Date of the first payment.
Time must be specified in the following format 2015-03-31 00:00:00 according to UTC. If past date is indicated - subscription will be activated with the date and time of request
subscribe_periodicity no String Period of payments.
Possible values:
month - once in a month
year - once in a year
Letter of credit parameters
letter_of_credit no String To enable receipt of payments within letter of credit send request with the value 1
letter_of_credit_date no String Letter of credit expiration date UTC. Should be sent in the following format 2015-04-24 00:00:00
3DS parameters
mpi_pares no String Parameter that returns from ACS pares.
This parameter is transmitted only in case when is used the API MPI
mpi_md no String Parameter that returns from ACS MD.
This parameter is transmitted only in case when is used the API MPI
Other parameters
product_url no String Product page address. The maximum length is 2000 characters.
product_category no String Product category in your shop. The maximum length is 25 characters.
product_name no String Product name in your shop. The maximum length is 100 characters.
product_description no String Product description in your shop. The maximum length is 500 characters.
expired_date no String Date and time untill which customer is able to pay invoice, also lifetime of checkout session by UTC. Should be sent in the following format 2016-04-24 00:00:00
info no String Information to add to payment details. For example: "External information for payments"
customer no String Unique customer ID in your shop. Max length 100 characters.
mpi_action no String Parameters defining payment type. Possible values:
pay - Acquiring
p2p - Money transfer from card to card
verifycode no String Dynamic verification code
suburl no String URL of submerchant
dae no String Detail Addenda.
Parameter dae is JSON string, to which function base64 is applied. JSON can contain the following parameters:
- Field name,
- Format [S/N]XXX,
- S - string,
- N - number,
- XXX - length,
- Field description.
{
  "airLine": "S4", // airline abbreviation, max length 4 symbol.
  "ticketNumber": "ACSFD12354SA", // ticket number, max length 15 symbols. 
  "passengerName": "John Doe", // passenger name, max length 29 symbols.
  "flightNumber": "742", // flight number, max length 5 symbols.
  "originCity": "DP", // departure city/airport code, max length 5 symbols.
  "destinationCity": "NY", // arrival city/airport code, max length 5 symbols.
  "departureDate": "100514" // дата вылета в формате YYMMDD, max length 6 symbols.
}

Example of parameter dae: ewogICJhaXJMaW5lIjogIkROSVBST0FWSUEiLAogICJ0aWNr
ZXROdW1iZXIiOiAiQUNTRkQxMjM1NFNBIiwKICAicGFzc2VuZ2VyTmFtZSI6ICJKb2huIERvZSIs
CiAgImZsaWdodE51bWJlciI6ICI3NDIiLAogICJvcmlnaW5DaXR5IjogIkRQIiwKICAiZGVzdGluY
XRpb25DaXR5IjogIk5ZIiwKICAiZGVwYXJ0dXJlRGF0ZSI6ICIxMDA1MTQiCn0=
split_rules no String Payment with split amount for a few receivers. This parameter is a JSON array containing split rules. While using split_rules paarameter, card is being charged and amount is split and credited to a few receivers. Acquiring fee is being charged from each shop in the split_rules array. Example of JSON string:
[
  {
    "public_key": "i000000001",
    "amount": 1,
    "commission_payer": "sender",
    "server_url": "https://server1/callback"
  },
  {
    "public_key": "i000000002",
    "amount": 2,
    "commission_payer": "receiver",
    "server_url": "https://server2/callback"
  }
]
#!/bin/bash
PUBLIC_KEY='your_public_key'
PRIVATE_KEY='your_private_key'
API_URL='https://www.liqpay.com/api/request'
JSON="{ 
	\"action\" : \"invoice_bot\",
    \"version\" : 3,
    \"public_key\" : \"${PUBLIC_KEY}\", 
    \"amount\" : 200,
    \"currency\" : \"USD\",
    \"order_id\" : \"order_id_1\",
    \"channel_type\" : \"telegram\", 
    \"account\" : \"1234567\"
}"
# DATA is besa64 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_bot',
'version'   => '3',
'amount'    => '200',
'currency'  => 'USD',
'order_id'  => 'order_id_1',
'channel_type'  => 'telegram',
'account'  => '1234567'
));
HashMap params = new HashMap();
params.put("action", "invoice_bot");
params.put("version", "3");
params.put("amount", "200");
params.put("currency", "USD");
params.put("order_id", "order_id_1");
params.put("channel_type", "telegram");
params.put("account", "1234567");

LiqPay liqpay = new LiqPay(PUBLIC_KEY, PRIVATE_KEY);
HashMap res = liqpay.api("request", params);		
System.out.println(res.get("result"));
liqpay = LiqPay(public_key, private_key)
res = liqpay.api("request", {
"action"    : "invoice_bot",
"version"   : "3",
"amount"    : "1",
"currency"  : "USD",
"order_id"  : "order_id_1",
"channel_type"  : "telegram",
"account"  : "1234567"
})
liqpay = Liqpay::Liqpay.new(
:public_key  => 'public_key',
:private_key => 'private_key'
)
res = liqpay.api("request", {
:action   => "invoice_bot",
:version  => "3",
:amount   => "1",
:currency => "USD",
:order_id => "order_id_1",
:channel_type => "telegram",
:account => "1234567"
})
LiqPay = liqpay:init(PublicKey, PrivateKey),
Res = liqpay:api("request", [
{<<"action">>, <<"invoice_bot">>},
{<<"version">>, <<"3">>}, 
{<<"email">>, <<"client-email@gmail.com">>}, 
{<<"amount">>, <<"1">>}, 
{<<"currency">>, <<"USD">>}, 
{<<"order_id">>, <<"order_id_1">>}, 
{<<"channel_type">>, <<"telegram">>}, 
{<<"account">>, <<"1234567">>}
], LiqPay)
var LiqPay = require('liqpay');
var liqpay = new LiqPay(public_key, private_key);
liqpay.api("request", {
"action"   : "invoice_bot",
"version"  : "3",
"email"    : "client-email@gmail.com",
"amount"   : "1",
"currency" : "USD",
"order_id" : "order_id_1",
"channel_type" : "telegram",
"account" : "1234567"
}, function( json ){
console.log( json.result );
});
my $liqpay = Liqpay->new($public_key,$private_key);
my $res = $liqpay->api("request",
{
'action'   => 'invoice_bot',
'version'  => '3',
'email'    => 'client-email@gmail.com',
'amount'   => '1',
'currency' => 'USD',
'order_id' => 'order_id_1',
'channel_type' => 'telegram',
'account' => '1234567'
}
);
Response
Param Type Description
err_code String Error code.
err_description String Error description.
version Number Version API. Current value - 3
result String The result of a request ok or error.
bot_name String LiqPay wallet bot name
bot_in_contacts Bollean This parameter indicates whether customer added LiqPay wallet bot to contact list or you need to ask customer to do that.
status String Payment status.
Possible values:
Final payment statuses
success Success payment
failure Failed payment
error Failed payment. Data is incorrect
subscribed Subscribed successfully framed
unsubscribed Subscribed successfully deactivated
reversed Payment is refunded
sandbox Sandbox payment
Statuses that required payment confirmation
otp_verify OTP confirmation is required. OTP is sent to a customer phone number.
To finish the payment otp_verify is required.
3ds_verify 3DS verification is required.
To finish the payment 3ds_verify is required.
cvv_verify CVV is required.
Send CVV code in card_cvv parameter in request..
sender_verify Payer additional data is required.
Send the following parameters in request: sender_first_name, sender_last_name, sender_country_code, sender_city, sender_address, sender_postal_code.
receiver_verify Receiver additional data is required.
Send the following parameters in request: receiver_first_name, receiver_last_name.
phone_verify Waiting for customer to enter a phone number
ivr_verify Waiting for customer to confirm with IVR
pin_verify Waiting for customer to confirm with PIN-code
captcha_verify Waiting for customer to confirm with captcha
password_verify Waiting for customer to confirm with Privat24
senderapp_verify Waiting for customer to confirm with Sender
Statuses while payment is being processed
processing payment is being processed
prepared Payment is created, waiting for customer to finish it
wait_bitcoin Waiting for a bitcoin transfer from a customer
wait_secure Payment is being checked by bank-acquirer
wait_accept Funds are charged from payer card but not credited to receiver as receiver is not active. If the store is not activated for 90 days, payment will be automatically cancelled
wait_lc Letter of Credit. Money from a client written off, confirmation expected delivery
hold_wait Amount is held successfully on a sender's card
cash_wait Waiting for payment in kiosk.
wait_qr Waiting for customer to scan QR-code.
wait_sender Waiting for customer to confirm in mob app Privat24 / Sender.
wait_card Receiver didn't set settlement method
wait_compensation Payment is successful, it will be transferred in daily settlement
invoice_wait Invoice is created successfully, waiting for a payment
wait_reserve Funds are reserved to make a refund according to a refund request
type String Payment type.
qr_code String QR-code for customer to make a payment
bitcoin_amount Number Amount in BTC
bitcoin_addr String Bitcoin wallet ti which customer should trannsfer bitcoin_amount
bitcoin_addr String Bitcoin wallet that needs to be topped up
bitcoin_rate String Bitcoin currency rate
err_erc String Error code.
redirect_to String The link to which a customer has to be redirected to confirm the payment with 3D-Secure.
token String Token of payment.
card_token String Token of sender card
payment_id Number Payment id in Liqpay system
id Number Payment id in Liqpay system
public_key String Shop public key
acq_id Number Acquirer ID
order_id String Order_id of payment
liqpay_order_id String Order_id of payment in Liqpay
description String Payment description
sender_phone String Payer phone
sender_card_mask2 String Payer card
sender_card String Payer card
sender_card_bank String Payer card bank
sender_card_country String Payer card country. Digital ISO 3166-1 code
sender_user_ip String IP адрес отправителя
sender_card_type String Sender's card type
paytype String Способ оплаты
ip String IP receiver's address
info String Additional payment information
customer String Unique customer ID in your shop. Max length 100 characters.
amount Number Payment amount
currency String Payment currency
sender_commission Number Payer comission in payment currency
receiver_commission Number Receiver comission in payment currency
agent_commission Number Agent comission in payment currency
amount_debit Number Payment amount for debit in currency of currency_debit
amount_credit Number Payment amount for credit in currency of currency_credit
commission_debit Number Payer comission in currency_debit
commission_credit Number Receiver comission in currency_credit
currency_debit String Transaction currency of debit
currency_credit String Transaction currency of credit
sender_bonus Number Payer bonus amount in payment currency
amount_bonus Number Payer bonus amount in currency of debit
refund_amount Number Refund amount
completion_date String Charge date
authcode_debit String Authorization code for transaction of debit
authcode_credit String Authorization code for transaction of credit
rrn_debit String Unique transaction ID in authorization and settlement system of issuer bank Retrieval Reference number
rrn_credit String Unique transaction ID in authorization and settlement system of issuer bank Retrieval Reference number
arrn_debit String Unique transaction ID in authorization and settlement system of issuer bank Acquirer's Reference Number
arrn_credit String Unique transaction ID in authorization and settlement system of issuer bank Acquirer's Reference Number
verifycode String Verification code
action String Transaction type. Possible values: pay - payment, hold - amount of hold on sender's account, paysplit - splitting payments, subscribe - regular payment, paydonate - donation
is_3ds Boolean Possible values:
true - transaction passed with 3DS,
false - transaction passed without 3DS
ecommerce_auth_code_debit String Authorization code
trans_type String Transaction type. Possible values r - reverse, hc - hold_compl, pr - purchase, rf - refund
create_date String Date of payment creation
end_date String Date of payment edition/end
mpi_req_pareq String Parameter required for sender authentification on ACS page
mpi_req_md String Parameter required for sender authentification on ACS page
mpi_req_url String issuer bank page url (ACS page) to which customer should be redirected to confirm payment with 3D-Secure
mpi_status String N - карта не участвует, перенаправление клиента для прохождения 3D-Secure не требуется,
U - не удалось проверить карту на участие, перенаправление клиента для прохождения 3D-Secure не требуется,
Y - карта поддерживает сервис 3D-Secure и в параметре mpi_req_url будет присутствовать адрес страницы банка-эмитента, куда нужно будет передать методом POST параметры mpi_req_pareq и mpi_req_md в следующей форме:

	<form name="MPIform" action='${mpi_req_url}' method="POST">
		 <input type="hidden" name="PaReq" value='${mpi_req_pareq}'>
		 <input type="hidden" name="MD" value='${mpi_req_md}'>
		 <input type="hidden" name="TermUrl" value='${TermUrl}'>
	</form>
	

where TermUrl – page address to which issuer will return the answer with PaRes and MD parameters.
To make a payment with already passed 3DS you need to transfer mpi_pares and mpi_md parameters with PaRes and MD values which were received from issuer bank ACS while payment is created.
public_key String Merchant public_key
private_key String Merchant private_key
data String Info
product_url String Product page address.
product_category String Product category in your shop.
product_name String Product name in your shop.
product_description String Payment description
{
"result": "ok",
"bot_name": "LiqPayWallet",
"bot_in_contacts" : true
}