PHP code example of tavux / qonto-php

1. Go to this page and download the library: Download tavux/qonto-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tavux / qonto-php example snippets


    /**
     * @param string $slug
     * @param string $iban
     * @param array $status
     * @param string $updated_at_from
     * @param string $updated_at_to
     * @param string $settled_at_from
     * @param string $settled_at_to
     * @param string $sort_by
     * @param integer $current_page
     * @param integer $per_page
     * @return \Tavux\Qonto\Models\Transactions
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function listTransactions($slug, $iban=null, $status=null, $updated_at_from=null, $updated_at_to=null, $settled_at_from=null, $settled_at_to=null, $sort_by=null, $current_page=null, $per_page=null);

    /**
     * @param integer $current_page
     * @param integer $per_page
     * @return \Tavux\Qonto\Models\Labels
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function listLabels($current_page=null, $per_page=null);

    /**
     * @param integer $current_page
     * @param integer $per_page
     * @return \Tavux\Qonto\Models\Memberships
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function listMemberships($current_page=null, $per_page=null);

    /**
     * @param int $id
     * @return \Tavux\Qonto\Models\Attachment
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function getAttachment($id);

    /**
     * @param int $id
     * @return \Tavux\Qonto\Models\Organization
     * @throws \GuzzleHttp\Exception\GuzzleException
     */
    public function getOrganization($id);

    /**
     * Change credentials to connect to Qonto API
     * @see https://api-doc.qonto.eu/2.0/welcome/authentication
     *
     * @param string $login
     * @param string $secret_key
     */
    public function setCredentials($login, $secret_key);

use \Tavux\Qonto\QontoClient;

$qonto = new QontoClient('login', 'secret_key');

try {
    $organization = $qonto->getOrganization('company_id');
    $transactions = $qonto->listTransactions(
        $organization->bank_accounts[0]->slug,
        $organization->bank_accounts[0]->iban,
        null,
        null,
        null,
        null,
        null,
        null,
        1,
        null
    );
    $labels = $qonto->listLabels();
    $memberships = $qonto->listMemberships();

    var_dump($organization, $transactions->transactions, $labels->labels, $memberships->memberships);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
    echo $e->getMessage();
}