sharis-gmbh/debitoorapiclient

提供一个PHP客户端中debitoor api的实现

dev-master 2019-10-15 15:29 UTC

This package is not auto-updated.

Last update: 2024-09-12 13:00:56 UTC


README

Debitoor PHP API客户端库,工作正在进行中

用法

您可以针对每种服务类型实例化一个API

  • 客户
  • 草稿发票
  • 发票
  • 费用
  • 产品
  • 报价
  • 等等。

每种服务都提供了一个接口,用于访问debitoor api提供的方法,您可以通过查看"Services/servicename.json"来检查可以发送的参数。

示例

$customerService = DebitoorApiClient::getService('Customers', array('access_token' => $auth_token));

// list customers
$customerService->getCustomers();

// get customer by id
$customerService->getCustomer(array('customer_id' => 'your customer id'));


// create customer
$customerService->createCustomer(
    array(
        'name'          => 'your customer name',
        'address'       => 'customer address',
        'email'         => 'customer@debitoor',
        'phone'         => '000-000-00-00',
        ...
    )
);


// update customer
$customerService->updateCustomer(
    array(
        'customer_id'   => 'your customer id',
        'name'          => 'your customer name',
        'address'       => 'customer address',
        'email'         => 'customer@debitoor',
        'phone'         => '000-000-00-00',
        ...
    )
);