Getting a list of payments

Getting a list of payments

URL POST
https://api-merchant.alikassa.com/v1/payment/history
HEADER
Content-Type application/json
Account Your account uuid, you can find in Accounts
https://merchant.alikassa.com/cabinet/resources/project-accounts
Sign Request signature

Link https://merchant.alikassa.com/cabinet/form/setting-api-certs generate "API certificate for payment", save the archive, unpack

  • password.txt
  • private.pem
  • public.pem

We keep only public.pem for signature verification.

Wrap all POST data in json (in the same order) and sign

$data = json_encode($data);

$privateKey = openssl_pkey_get_private(
        file_get_contents('private.pem'),
        file_get_contents('password.txt')
    );

if ($privateKey===false) {
        throw new \Exception('Error cert.');
}

openssl_sign($data, $sign, $privateKey);
$sign = base64_encode($sign);

Pass the received $sign in the Sign header. You can find a sample code at the end of the document.

Name Type Description
date_from format (YYYY-MM-DD) 2024-11-01
date_to format (YYYY-MM-DD) 2024-11-30
page int 1
paginate int 12

Response

Name Example
data
[
    [
        "created_at" => "2024-11-07 14:58:59",
        "id" => 110586876,
        "order_id" => "1730980738",
        "amount" => "5000.000000000",
        "commission_amount" => null,
        "currency" => "RUB",
        "status" => "fail",
    ],
    [
        "created_at" => "2024-11-07 14:59:03",
        "id" => 110586877,
        "order_id" => "1730980738",
        "amount" => "5000.000000000",
        "commission_amount" => "10.000000000",
        "currency" => "RUB",
        "status" => "paid",
    ],
]
links
[
    "first" => "https://api-merchant.alikassa.com/v1/payment/history?page=1",
    "last" => "https://api-merchant.alikassa.com/v1/payment/history?page=3",
    "prev" => null,
    "next" => "https://api-merchant.alikassa.com/v1/payment/history?page=2",
]
meta
[
    "current_page" => 1,
    "from" => 1,
    "last_page" => 3,
    "links" => []
    "path" => "https://api-merchant.alikassa.com/v1/payment/history"
    "per_page" => 15
    "to" => 15
    "total" => 35
]

An example of an unsuccessful HTTP CODE 400 response:

{
   "message": "The given data was invalid.",
   "errors": {
      ...
   }
}