tsukiro/openfactura-api-sdk

1.1.9 2021-10-13 01:59 UTC

This package is auto-updated.

Last update: 2024-09-22 08:53:02 UTC


README

openfactura 结构

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

  • API 版本:1.0.0
  • 构建包:io.swagger.codegen.v3.generators.php.PhpClientCodegen

要求

PHP 5.5 及以上版本

安装与使用

Composer

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

composer install tsukiro/openfactura-api-sdk

然后运行 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');

$apiInstance = new Tsukiro\Client\Api\OpenFacturaApi(
    // 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()
);
$body = new \Tsukiro\Client\Model\DTERequest(); // \Tsukiro\Client\Model\DTERequest | 
$apikey = "apikey_example"; // string | openfactura apikey

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

$apiInstance = new Tsukiro\Client\Api\OpenFacturaApi(
    // 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()
);
$body = new \Tsukiro\Client\Model\DocumentReceivedFilter(); // \Tsukiro\Client\Model\DocumentReceivedFilter | 
$apikey = "apikey_example"; // string | openfactura apikey

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

$apiInstance = new Tsukiro\Client\Api\OpenFacturaApi(
    // 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()
);
$body = new \Tsukiro\Client\Model\DocumentIssuedFilter(); // \Tsukiro\Client\Model\DocumentIssuedFilter | 
$apikey = "apikey_example"; // string | openfactura apikey

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

$apiInstance = new Tsukiro\Client\Api\OpenFacturaApi(
    // 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()
);
$rut = "rut_example"; // string | 
$type = "type_example"; // string | 
$document_number = "document_number_example"; // string | 
$value = "value_example"; // string | 
$apikey = "apikey_example"; // string | openfactura apikey

try {
    $result = $apiInstance->getDTEDocument($rut, $type, $document_number, $value, $apikey);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling DefaultApi->v2DteDocumentRutTypeDocumentNumberValueGet: ', $e->getMessage(), PHP_EOL;
}
?>

API 端点文档

所有 URI 都是相对于 https://dev-api.haulmer.com

模型文档

授权文档

所有端点都不需要授权。

作者