For the complete documentation index, see llms.txt. This page is also available as Markdown.

Retrieve accounting payments list

Use listAccountingPayments to retrieve extract information about accounting payments with filtering and pagination options.

The response will contains the Downloads and Actions parameters, which may contain downloadable links that are accessible only once per each call. If a file from the API response has already been downloaded, the next attempt will result in a "Token expired" error.

Request parameters

Parameters
Type / Description

Status

String (Required)

Accepted values ALL, PAID, PARTIAL_PAID, UNPAID, CANCELED

InvoiceDate

String (Required)

Accepted values anytime, today, yesterday, last7Days, last30Days, currentMonth, lastMonth, lastYear, custom

InvoiceDateStartDate

String (Optional)

Date in format YYYY-MM-DD (e.g., 2026-01-15). Required when InvoiceDate=custom

InvoiceDateEndDate

String (Optional)

Date in format YYYY-MM-DD (e.g., 2026-01-15). Required when InvoiceDate=custom

PaidOn

String (Required)

Accepted values anytime, today, yesterday, last7Days, last30Days, currentMonth, lastMonth, lastYear, custom. When not using value anytime can only be used with Status=PAID or Status=PARTIAL_PAID

PaidOnStartDate

String (Optional)

Date in format YYYY-MM-DD (e.g., 2026-01-15). Required when PaidOn=custom

PaidOnEndDate

String (Optional)

Date in format YYYY-MM-DD (e.g., 2026-01-15). Required when PaidOn=custom

TransactionType

String (Required)

Accepted values ALL, SALES, SERVICES, ADJUSTMENTS, DISPUTES, ROLLING_RESERVE, AFF_COMM, PO

Page

Interger (optional)

Minimum: 1

Limit

Interger (optional)

Range: 1 to 1000

Request sample

<?php

declare(strict_types=1);

class Configuration
{
    public const MERCHANT_CODE = 'MERCHANT_CODE';
    public const MERCHANT_KEY = 'SECRET_KEY';
    public const URL = 'http://api.2checkout.com/soap/6.0';
    public const ACTION = 'listAccountingPayments';
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Status": "UNPAID"
}
JSON;

}
class Client
{
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?object {
        if (is_array($payload)) {
            $payload = json_encode($payload);
        }
        if (!empty($payload)) {
            // SoapClient works with objects(StdClass)
            $payload = json_decode($payload);
        }
        $soapClient = $this->getClient($url);
        $sessionId = $this->getSession($soapClient);
        $args = array_filter([$sessionId, $payload]);
        return $soapClient->$action(...$args);
    }

    public function getClient(string $url): SoapClient
    {
        return new SoapClient(
            $url.'?wsdl',
            [
                'location' => $url,
                'cache_wsdl' => WSDL_CACHE_NONE,
            ]
        );
    }

    public function getSession(SoapClient $client)
    {
        $date = gmdate('Y-m-d H:i:s');
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $string = strlen($merchantCode).$merchantCode.strlen($date).$date;
        $algo = 'sha256';
        $hash = hash_hmac($algo, $string, $key);
        $client->__setCookie('XDEBUG_SESSION', 'PHPSTORM');
        return $client->login($merchantCode, $date, $hash, $algo);
    }
}
try {
    $client = new Client();
    var_dump($client->call());
} catch (Exception $ex) {
    var_dump($ex);
}

Response sample

Last updated

Was this helpful?