fattureincloud/fattureincloud-php-sdk

Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 500.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.

v2.1.0 2024-06-17 13:40 UTC

README

Packagist unit tests

Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 500.000 businesses in Italy.

The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol.

For more information, please visit https://www.fattureincloud.it.

Installation & Usage

Requirements

PHP 7.3 and later.

Composer

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

$ composer require fattureincloud/fattureincloud-php-sdk

Manual Installation

There are three options:

  • [recommended] download the latest release of the fattureincloud-php-sdk Phar Archive and simply include it in your project.
require_once('./fattureincloud-php-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 and then run the following:

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



// Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
$config = FattureInCloud\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new FattureInCloud\Api\ArchiveApi(
    // 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
);
$company_id = 12345; // int | The ID of the company.
$create_archive_document_request = new \FattureInCloud\Model\CreateArchiveDocumentRequest; // \FattureInCloud\Model\CreateArchiveDocumentRequest | The Archive Document.

try {
    $result = $apiInstance->createArchiveDocument($company_id, $create_archive_document_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ArchiveApi->createArchiveDocument: ', $e->getMessage(), PHP_EOL;
}

API Endpoints

All URIs are relative to https://api-v2.fattureincloud.it

Models

Authorization

OAuth2AuthenticationCodeFlow

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api-v2.fattureincloud.it/oauth/authorize
  • Scopes:
    • entity.clients:r: Read permission to the Clients registry
    • entity.clients:a: Write permission to the Clients registry
    • entity.suppliers:r: Read permission to the Suppliers registry
    • entity.suppliers:a: Write permission to the Suppliers registry
    • products:r: Read permission to the Products
    • products:a: Write permission to the Products
    • issued_documents.invoices:r: Read permission to the issued Invoices
    • issued_documents.credit_notes:r: Read permission to the issued Credit Notes
    • issued_documents.receipts:r: Read permission to the issued Receipts
    • issued_documents.orders:r: Read permission to the issued Orders
    • issued_documents.quotes:r: Read permission to the issued Quotes
    • issued_documents.proformas:r: Read permission to the issued Proformas
    • issued_documents.delivery_notes:r: Read permission to the issued Delivery Notes
    • issued_documents.work_reports:r: Read permission to the issued Work Reports
    • issued_documents.supplier_orders:r: Read permission to the issued Supplier Orders
    • issued_documents.self_invoices:r: Read permission to the issued Self Invoices
    • issued_documents.invoices:a: Write permission to the issued Invoices
    • issued_documents.credit_notes:a: Write permission to the issued Credit Notes
    • issued_documents.receipts:a: Write permission to the issued issued Receipts
    • issued_documents.orders:a: Write permission to the issued Orders
    • issued_documents.quotes:a: Write permission to the issued Quotes
    • issued_documents.proformas:a: Write permission to the issued Proformas
    • issued_documents.delivery_notes:a: Write permission to the issued Delivery Notes
    • issued_documents.work_reports:a: Write permission to the issued Work Reports
    • issued_documents.supplier_orders:a: Write permission to the issued Supplier Orders
    • issued_documents.self_invoices:a: Write permission to the issued Self Invoices
    • received_documents:r: Read permission to the Received Documents
    • received_documents:a: Write permission to the Received Documents
    • stock:r: Read permission to the Stock movements
    • stock:a: Write permission to the Stock movements
    • receipts:r: Read permission to the Receipts
    • receipts:a: Write permission to the Receipts
    • taxes:r: Read permission to the Taxes
    • taxes:a: Write permission to the Taxes
    • archive:r: Read permission to the Archive Documents
    • archive:a: Read permission to the Archive Documents
    • cashbook:r: Read permission to the Cashbook
    • cashbook:a: Write permission to the Cashbook
    • settings:r: Read permission to the Settings
    • settings:a: Write permission to the Settings
    • situation:r: Read permission to the company Situation

Tests

To run the tests, use:

composer install
vendor/bin/phpunit

Author

info@fattureincloud.it

About this package

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

  • API version: 2.1.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen