PHP code example of weisl / hellocash-php-sdk

1. Go to this page and download the library: Download weisl/hellocash-php-sdk 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/ */

    

weisl / hellocash-php-sdk example snippets


$client = new HellocashClient('[email protected]', 'secret-password');
$response = $client->invoices()->all();

[
  'error' => 'Invoice with ID 123 not found'
]

$client->invoices()->all(); // gets all resources, no matter how many

$client->invoices()->query([ // query all invoices with supported parameters
  'limit' => 50,
  'offset' => 2,
  ...
]);

$client->invoices()->get($id); // get specific invoice by id

[
  'error' => 'Invoice with ID 123 not found',
]

$client->invoices()->cancel($id, [
  'cancellation_cashier_id' => 123,
]);

[
  'error' => 'Cancellation of Invoice with 123 was not successful. API error message: An Error occurred',
]

$client->invoices()->create([
  'cashier_id' => 123,
  'items' => [
      [
        'item_name' => 'test',
      ],
  ],
]);

$client->invoices()->pdf(123);
composer 
get(int $id)