coldfrontlabs/freshbooks-api

用于对最新 Freshbooks API 发送请求的库(见 https://www.freshbooks.com/api)。

0.1.3 2019-06-10 17:45 UTC

This package is auto-updated.

Last update: 2024-09-07 03:07:38 UTC


README

用于 v2 Freshbooks API 的 API 库(非 Freshbooks Classic)。

示例用法。

use Freshbooks\Client;


// Create the Client connection and authorize the user.
$freshbooks = Client::create(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL)->authorize();

// Example get the list of clients with a search filter applied.
$freshbooks->clients()->getAll(['search' => ['email' => '123fake@example.com', 'userid' => '12345']]);

// Fetch all the invoices for a specific custom and include the line items.
$freshbooks->invoices()->getAll(['search' => ['customerid' => '54321'], 'include' => ['lines']]);

// Fetch a single estimate by ID.
$freshbooks->estimates()->get('123442');

// Create a new invoice.
$freshbooks->invoices()->create(['invoice' => ['email' => '123fake@example.com', 'customerid' => 12344, 'create_date' => '2018-02-02']]);