PHP code example of ryadnov / zenmoney-php-api-library

1. Go to this page and download the library: Download ryadnov/zenmoney-php-api-library 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/ */

    

ryadnov / zenmoney-php-api-library example snippets


use Ryadnov\ZenMoney\Api\Auth\OAuth2;
use Ryadnov\ZenMoney\Api\V8\RequestDiff;

$auth       = new OAuth2([
    'consumer_key'    => 'XXXXXXXX',
    'consumer_secret' => 'XXXXXXXX',
    'username'        => 'XXXXXXXX',
    'password'        => 'XXXXXXXX',
]);
$token_info = $auth->getToken();

$request = new RequestDiff([
    'token' => $token_info['access_token'],
]);
$data    = $request->execute([
    'serverTimestamp' => 0, // first sync
]);