Skip to content

invoicetronic/php-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP SDK for the Invoicetronic API

The Invoicetronic API is a RESTful service that allows you to send and receive invoices through the Italian Servizio di Interscambio (SDI), or Interchange Service. The API is designed to be simple and easy to use, abstracting away SDI complexity while providing complete control over the invoice send/receive process. It provides advanced features as encryption at rest, multi-language pre-flight invoice validation, multiple upload formats, webhooks, event logging, client SDKs, and CLI tools.

For more information, see Invoicetronic website

For more information, please visit https://invoicetronic.com.

Installation & Usage

Requirements

PHP 7.4 and later. Should also work with PHP 8.0.

Composer

To install the bindings via Composer, run the following command:

$ composer require invoicetronic/php-sdk

Then run composer install

Manual Installation

There are three options:

  • Download the latest release of the PHP SDK Phar Archive and simply include it in your project.
require_once('./invoicetronic-sdk.phar');
  • Download our SDK using PHP-download and simply include it in your project.
  • Create your own custom autoloader and download all the dependencies (transitive included) as explained here.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

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



// Configure HTTP basic authorization: Basic
$config = Invoicetronic\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new Invoicetronic\Api\CompanyApi(
    // 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 = 1; // int | Page number.
$page_size = 100; // int | Items per page. Cannot be greater than 200.
$sort = 'sort_example'; // string | Sort by field. Prefix with '-' for descending order.

try {
    $result = $apiInstance->companyGet($page, $page_size, $sort);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling CompanyApi->companyGet: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to http://localhost

Class Method HTTP request Description
CompanyApi companyGet GET /company List companies
CompanyApi companyIdDelete DELETE /company/{id} Delete a company
CompanyApi companyIdGet GET /company/{id} Get a company by id
CompanyApi companyPost POST /company Add a company
CompanyApi companyPut PUT /company Update a company
LogApi logGet GET /log List events
LogApi logIdGet GET /log/{id} Get an event by id
ReceiveApi receiveGet GET /receive List incoming invoices
ReceiveApi receiveIdDelete DELETE /receive/{id} Delete an incoming invoice by id
ReceiveApi receiveIdGet GET /receive/{id} Get an incoming invoice by id
SendApi sendFilePost POST /send/file Add an invoice by file
SendApi sendGet GET /send List invoices
SendApi sendIdGet GET /send/{id} Get a invoice by id
SendApi sendIdentifierGet GET /send/{identifier} Get a invoice by identifier
SendApi sendJsonPost POST /send/json Add an invoice by json
SendApi sendPost POST /send Add an invoice
SendApi sendValidateFilePost POST /send/validate/file Validate an invoice file
SendApi sendValidateJsonPost POST /send/validate/json Validate an invoice by json
SendApi sendValidatePost POST /send/validate Validate an invoice
SendApi sendValidateXmlPost POST /send/validate/xml Validate an invoice by xml
SendApi sendXmlPost POST /send/xml Add an invoice by xml
StatusApi statusGet GET /status Account status
UpdateApi updateGet GET /update List updates
UpdateApi updateIdGet GET /update/{id} Get an update by id
WebhookApi webhookGet GET /webhook List webhooks
WebhookApi webhookIdDelete DELETE /webhook/{id} Delete a webhook by id
WebhookApi webhookIdGet GET /webhook/{id} Get a webhook by id
WebhookApi webhookPost POST /webhook Add a webhook
WebhookApi webhookPut PUT /webhook Update a webhook
WebhookApi webhookhistoryGet GET /webhookhistory List webhook history items
WebhookApi webhookhistoryIdGet GET /webhookhistory/{id} Get a webhook history item by id

Models

Authorization

Authentication schemes defined for the API:

Basic

  • Type: HTTP basic authentication

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

[email protected]

About this package

This PHP package is automatically generated by the OpenAPI Generator project:

  • API version: 1
    • Generator version: 7.14.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen

Packages

No packages published

Languages