billingo/php-sdk

3.0.10 2020-11-25 13:08 UTC

This package is auto-updated.

Last update: 2024-09-25 21:49:00 UTC


README

这是 Billingo API v3 文档。我们的 API 基于 REST 软件架构风格。API 使用面向资源的 URL,接受 JSON 编码的请求体并返回 JSON 编码的响应。要使用此 API,您必须在我们的 网站 上生成新的 API 密钥。之后,您可以在本页面上测试您的 API 密钥。

此 PHP 包由 Swagger Codegen 项目自动生成

要求

PHP 5.5 及以上

安装 & 使用

Composer

要通过 Composer 安装绑定,请将以下内容添加到 composer.json

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git"
    }
  ],
  "require": {
    "GIT_USER_ID/GIT_REPO_ID": "*@dev"
  }
}

然后运行 composer install

手动安装

下载文件并包含 autoload.php

    require_once('/path/to/SwaggerClient-php/vendor/autoload.php');

测试

要运行单元测试

composer install
./vendor/bin/phpunit

入门

请按照 安装过程 进行操作,然后运行以下命令

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: api_key
$config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new Billingo\Client\Api\BankAccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Billingo\Client\Model\BankAccount(); // \Billingo\Client\Model\BankAccount | BankAccount object that you would like to store.

try {
    $result = $apiInstance->createBankAccount($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountApi->createBankAccount: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: api_key
$config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new Billingo\Client\Api\BankAccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int |

try {
    $apiInstance->deleteBankAccount($id);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountApi->deleteBankAccount: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: api_key
$config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new Billingo\Client\Api\BankAccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$id = 56; // int |

try {
    $result = $apiInstance->getBankAccount($id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountApi->getBankAccount: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: api_key
$config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new Billingo\Client\Api\BankAccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$page = 56; // int |
$per_page = 25; // int |

try {
    $result = $apiInstance->listBankAccount($page, $per_page);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountApi->listBankAccount: ', $e->getMessage(), PHP_EOL;
}

// Configure API key authorization: api_key
$config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKey('X-API-KEY', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Billingo\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('X-API-KEY', 'Bearer');

$apiInstance = new Billingo\Client\Api\BankAccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$body = new \Billingo\Client\Model\BankAccount(); // \Billingo\Client\Model\BankAccount | Bank account object that you would like to update.
$id = 56; // int |

try {
    $result = $apiInstance->updateBankAccount($body, $id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BankAccountApi->updateBankAccount: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都相对于 https://api.billingo.hu/v3

方法HTTP 请求描述
BankAccountApicreateBankAccountPOST /bank-accounts创建银行账户
BankAccountApideleteBankAccountDELETE /bank-accounts/{id}删除银行账户
BankAccountApigetBankAccountGET /bank-accounts/{id}检索银行账户
BankAccountApilistBankAccountGET /bank-accounts列出所有银行账户
BankAccountApiupdateBankAccountPUT /bank-accounts/{id}更新银行账户
CurrencyApigetConversionRateGET /currencies获取货币汇率。
DocumentApicancelDocumentPOST /documents/{id}/cancel取消文档
DocumentApicreateDocumentPOST /documents创建文档
DocumentApicreateDocumentFromProformaPOST /documents/{id}/create-from-proforma从形式单创建文档。
DocumentApideletePaymentDELETE /documents/{id}/payments删除文档上的所有支付历史记录
DocumentApidownloadDocumentGET /documents/{id}/download以 PDF 格式下载文档。
DocumentApigetDocumentGET /documents/{id}检索文档
DocumentApigetOnlineSzamlaStatusGET /documents/{id}/online-szamla检索文档在线 Számla 状态
DocumentApigetPaymentGET /documents/{id}/payments检索支付历史记录
DocumentApigetPublicUrlGET /documents/{id}/public-url检索文档下载公开 URL。
DocumentApilistDocumentGET /documents列出所有文档
DocumentApisendDocumentPOST /documents/{id}/send将发票发送到指定的电子邮件地址。
DocumentApiupdatePaymentPUT /documents/{id}/payments更新支付历史记录
DocumentBlockApilistDocumentBlockGET /document-blocks列出所有文档块
DocumentExportApicreatePOST /document-export创建文档导出。
DocumentExportApidownloadGET /document-export/{id}/download返回导出的二进制文件。
DocumentExportApi轮询GET /document-export/{id}/poll检索导出状态。
OrganizationApigetOrganizationDataGET /organization检索组织数据。
PartnerApicreatePartnerPOST /partners创建合作伙伴
PartnerApideletePartnerDELETE /partners/{id}删除合作伙伴
PartnerApigetPartnerGET /partners/{id}检索合作伙伴
PartnerApilistPartnerGET /partners列出所有合作伙伴
PartnerApiupdatePartnerPUT /partners/{id}更新合作伙伴
ProductApicreateProductPOST /products创建产品
ProductApideleteProductDELETE /products/{id}删除产品
ProductApigetProductGET /products/{id}检索产品
ProductApilistProductGET /products列出所有产品
ProductApiupdateProductPUT /products/{id}更新产品
UtilApicheckTaxNumberGET /utils/check-tax-number/{tax_number}检查税号。
UtilApigetIdGET /utils/convert-legacy-id/{id}将旧ID转换为v3 ID。

模型文档说明

授权文档说明

api_key

  • 类型: API密钥
  • API密钥参数名: X-API-KEY
  • 位置: HTTP头部

作者

hello@billingo.hu