Fatture in Cloud SDK (Software Development Kit) for PHP

Overview

FattureInCloud PHP SDK

Request informations

In every request description you will be able to find some additional informations about context, permissions and supported functionality:

Parameter Description
👥 Context Indicate the subject of the request. Can be company, user or accountant.
🔒 Required scope If present, indicates the required scope to fulfill the request.
🔍 Filtering If present, indicates which fields support the filtering feature.
↕️ Sorting If present, indicates which fields support the sorting feature.
📄 Paginated results If present, indicate that the results are paginated.
🎩 Customized responses supported If present, indicate that you can use field or fieldset to customize the response body.

For example the request GET /entities/{entityRole} have tis informations: \ 👥 Company context \ 🔒 Required scope: entity.clients:r or entity.suppliers:r (depending on entityRole) \ 🔍 Filtering: id, name \ ↕️ Sorting: id, name \ 📄 Paginated results \ 🎩 Customized responses supported

Keep in mind that if you are making company realted requests, you will need to specify the company id in the requests:

GET /c/{company_id}/issued_documents

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

Installation & Usage

Requirements

PHP 7.3 and later. Should also work with PHP 8.0 but has not been tested.

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "require": {
    "fattureincloud/fattureincloud-php-sdk": "2.0.1"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:


require_once('/path/to/FattureInCloud PHP SDK/vendor/autoload.php');

Getting Started

Please follow the installation procedure and then run the following:

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

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 Referred Company Id.
$create_archive_document_request = {"data":{"date":"2021-08-20","category":"Altri documenti","description":"spesa 1","attachment_token":"ibfjdbf94ey9w94g3w894qbasrga"}}; // \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

Class Method HTTP request Description
ArchiveApi createArchiveDocument POST /c/{company_id}/archive Create Archive Document
ArchiveApi deleteArchiveDocument DELETE /c/{company_id}/archive/{document_id} Delete Archive Document
ArchiveApi getArchiveDocument GET /c/{company_id}/archive/{document_id} Get Archive Document
ArchiveApi listArchiveDocuments GET /c/{company_id}/archive List Archive Documents
ArchiveApi modifyArchiveDocument PUT /c/{company_id}/archive/{document_id} Modify Archive Document
ArchiveApi uploadArchiveDocumentAttachment POST /c/{company_id}/archive/attachment Upload Archive Document Attachment
CashbookApi createCashbookEntry POST /c/{company_id}/cashbook Create Cashbook Entry
CashbookApi deleteCashbookEntry DELETE /c/{company_id}/cashbook/{document_id} Delete Cashbook Entry
CashbookApi getCashbookEntry GET /c/{company_id}/cashbook/{document_id} Get Cashbook Entry
CashbookApi listCashbookEntries GET /c/{company_id}/cashbook List Cashbook Entries
CashbookApi modifyCashbookEntry PUT /c/{company_id}/cashbook/{document_id} Modify Cashbook Entry
ClientsApi createClient POST /c/{company_id}/entities/clients Create Client
ClientsApi deleteClient DELETE /c/{company_id}/entities/clients/{client_id} Delete Client
ClientsApi getClient GET /c/{company_id}/entities/clients/{client_id} Get Client
ClientsApi listClients GET /c/{company_id}/entities/clients List Clients
ClientsApi modifyClient PUT /c/{company_id}/entities/clients/{client_id} Modify Client
CompaniesApi getCompanyInfo GET /c/{company_id}/company/info Get Company Info
InfoApi listArchiveCategories GET /c/{company_id}/info/archive_categories List Archive Categories
InfoApi listCities GET /info/cities List Cities
InfoApi listCostCenters GET /c/{company_id}/info/cost_centers List Cost Centers
InfoApi listCountries GET /info/countries List Countries
InfoApi listCurrencies GET /info/currencies List Currencies
InfoApi listDeliveryNotesDefaultCausals GET /info/dn_causals List Delivery Notes Default Causals
InfoApi listLanguages GET /info/languages List Languages
InfoApi listPaymentAccounts GET /c/{company_id}/info/payment_accounts List Payment Accounts
InfoApi listPaymentMethods GET /c/{company_id}/info/payment_methods List Payment Methods
InfoApi listProductCategories GET /c/{company_id}/info/product_categories List Product Categories
InfoApi listReceivedDocumentCategories GET /c/{company_id}/info/received_document_categories List Received Document Categories
InfoApi listRevenueCenters GET /c/{company_id}/info/revenue_centers List Revenue Centers
InfoApi listTemplates GET /info/templates List Templates
InfoApi listUnitsOfMeasure GET /info/measures List Units of Measure
InfoApi listVatTypes GET /c/{company_id}/info/vat_types List Vat Types
IssuedDocumentsApi createIssuedDocument POST /c/{company_id}/issued_documents Create Issued Document
IssuedDocumentsApi deleteIssuedDocument DELETE /c/{company_id}/issued_documents/{document_id} Delete Issued Document
IssuedDocumentsApi deleteIssuedDocumentAttachment DELETE /c/{company_id}/issued_documents/{document_id}/attachment Delete Issued Document Attachment
IssuedDocumentsApi getEmailData GET /c/{company_id}/issued_documents/{document_id}/email Get Email Data
IssuedDocumentsApi getExistingIssuedDocumentTotals POST /c/{company_id}/issued_documents/{document_id}/totals Get Existing Issued Document Totals
IssuedDocumentsApi getIssuedDocument GET /c/{company_id}/issued_documents/{document_id} Get Issued Document
IssuedDocumentsApi getIssuedDocumentPreCreateInfo GET /c/{company_id}/issued_documents/info Get Issued Document Pre-create info
IssuedDocumentsApi getNewIssuedDocumentTotals POST /c/{company_id}/issued_documents/totals Get New Issued Document Totals
IssuedDocumentsApi listIssuedDocuments GET /c/{company_id}/issued_documents List Issued Documents
IssuedDocumentsApi modifyIssuedDocument PUT /c/{company_id}/issued_documents/{document_id} Modify Issued Document
IssuedDocumentsApi scheduleEmail POST /c/{company_id}/issued_documents/{document_id}/email Schedule Email
IssuedDocumentsApi uploadIssuedDocumentAttachment POST /c/{company_id}/issued_documents/attachment Upload Issued Document Attachment
IssuedEInvoicesApi sendEInvoice POST /c/{company_id}/issued_documents/{document_id}/e_invoice/send Send the e-invoice
IssuedEInvoicesApi verifyEInvoiceXml GET /c/{company_id}/issued_documents/{document_id}/e_invoice/xml_verify Verify e-invoice xml
ProductsApi createProduct POST /c/{company_id}/products Create Product
ProductsApi deleteProduct DELETE /c/{company_id}/products/{product_id} Delete Product
ProductsApi getProduct GET /c/{company_id}/products/{product_id} Get Product
ProductsApi listProducts GET /c/{company_id}/products List Products
ProductsApi modifyProduct PUT /c/{company_id}/products/{product_id} Modify Product
ReceiptsApi createReceipt POST /c/{company_id}/receipts Create Receipt
ReceiptsApi deleteReceipt DELETE /c/{company_id}/receipts/{document_id} Delete Receipt
ReceiptsApi getReceipt GET /c/{company_id}/receipts/{document_id} Get Receipt
ReceiptsApi getReceiptPreCreateInfo GET /c/{company_id}/receipts/info Get Receipt Pre-Create Info
ReceiptsApi getReceiptsMonthlyTotals GET /c/{company_id}/receipts/monthly_totals Get Receipts Monthly Totals
ReceiptsApi listReceipts GET /c/{company_id}/receipts List Receipts
ReceiptsApi modifyReceipt PUT /c/{company_id}/receipts/{document_id} Modify Receipt
ReceivedDocumentsApi createReceivedDocument POST /c/{company_id}/received_documents Create Received Document
ReceivedDocumentsApi deleteReceivedDocument DELETE /c/{company_id}/received_documents/{document_id} Delete Received Document
ReceivedDocumentsApi deleteReceivedDocumentAttachment DELETE /c/{company_id}/received_documents/{document_id}/attachment Delete Received Document Attachment
ReceivedDocumentsApi getExistingReceivedDocumentTotals POST /c/{company_id}/received_documents/{document_id}/totals Get Existing Received Document Totals
ReceivedDocumentsApi getNewReceivedDocumentTotals POST /c/{company_id}/received_documents/totals Get New Received Document Totals
ReceivedDocumentsApi getReceivedDocument GET /c/{company_id}/received_documents/{document_id} Get Received Document
ReceivedDocumentsApi getReceivedDocumentPreCreateInfo GET /c/{company_id}/received_documents/info Get Received Document Pre-Create Info
ReceivedDocumentsApi listReceivedDocuments GET /c/{company_id}/received_documents List Received Documents
ReceivedDocumentsApi modifyReceivedDocument PUT /c/{company_id}/received_documents/{document_id} Modify Received Document
ReceivedDocumentsApi uploadReceivedDocumentAttachment POST /c/{company_id}/received_documents/attachment Upload Received Document Attachment
SuppliersApi createSupplier POST /c/{company_id}/entities/suppliers Create Supplier
SuppliersApi deleteSupplier DELETE /c/{company_id}/entities/suppliers/{supplier_id} Delete Supplier
SuppliersApi getSupplier GET /c/{company_id}/entities/suppliers/{supplier_id} Get Supplier
SuppliersApi listSuppliers GET /c/{company_id}/entities/suppliers List Suppliers
SuppliersApi modifySupplier PUT /c/{company_id}/entities/suppliers/{supplier_id} Modify Supplier
TaxesApi createF24 POST /c/{company_id}/taxes Create F24
TaxesApi deleteF24 DELETE /c/{company_id}/taxes/{document_id} Delete F24
TaxesApi deleteF24Attachment DELETE /c/{company_id}/taxes/{document_id}/attachment Delete F24 Attachment
TaxesApi getF24 GET /c/{company_id}/taxes/{document_id} Get F24
TaxesApi listF24 GET /c/{company_id}/taxes List F24
TaxesApi modifyF24 PUT /c/{company_id}/taxes/{document_id} Modify F24
TaxesApi uploadF24Attachment POST /c/{company_id}/taxes/attachment Upload F24 Attachment
UserApi getUserInfo GET /user/info Get User Info
UserApi listUserCompanies GET /user/companies Get User Companies

Models

Authorization

OAuth2AuthenticationCodeFlow

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://api-v2.fattureincloud.it/oauth/authorize
  • Scopes:
    • entity.clients:r:
    • entity.clients:a:
    • entity.suppliers:r:
    • entity.suppliers:a:
    • products:r:
    • products:a:
    • issued_documents.invoice:r:
    • issued_documents.credit_note:r:
    • issued_documents.receipt:r:
    • issued_documents.order:r:
    • issued_documents.quote:r:
    • issued_documents.proforma:r:
    • issued_documents.delivery_note:r:
    • issued_documents.invoice:a:
    • issued_documents.credit_note:a:
    • issued_documents.receipt:a:
    • issued_documents.order:a:
    • issued_documents.quote:a:
    • issued_documents.proforma:a:
    • issued_documents.delivery_note:a:
    • received_documents:r:
    • received_documents:a:
    • stock:r:
    • stock:a:
    • receipts:r:
    • receipts:a:
    • taxes:r:
    • taxes:a:
    • archive:r:
    • archive:a:
    • cashbook:r:
    • cashbook:a:
    • settings:r:
    • settings:a:
    • situation:r:

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: 2.0.0
  • Build package: org.openapitools.codegen.languages.PhpClientCodegen
Comments
  • not working after install via composer

    not working after install via composer

    Describe the bug I install the package via composer and not work! How i can add in my code the library (to replace require_once(DIR . '/vendor/autoload.php'); )? Must be have this line use FattureIncloud/xxxxxx

    opened by pws2016 5
  • Custom template not listed

    Custom template not listed

    Describe the bug With the command $fattureInCloud->info()->listTemplates() we can't see our custom template we created on Fatture in cloud web gui.

    Env info Please, provide us with the following details:

    • PHP version 8.0
    • PHP SDK version latest

    To Reproduce $fattureInCloud->info()->listTemplates()

    Expected behavior Show our custom templates

    opened by Mattia-Marchiorato 4
  • Return 500 on createClient

    Return 500 on createClient

    Describe the bug return a 500 on entities/clients {"error":{"message":"An unexpected error occurred. Contact support for more information."}} Env info Please, provide us with the following details:

    • PHP version 8.1
    • PHP SDK version 2.0.16

    Expected behavior Create a client on FIC or return an error not a 500

    opened by Mattia-Marchiorato 4
  • Get Subscription Account Info

    Get Subscription Account Info

    Is there an API Call which we can get informations about user active subscription?

    • Subscription Plan name
    • Subscription expire date
    • Subscription annual documents number
    opened by christiancannata 3
  • Modify Issued Document fails without emitting anything

    Modify Issued Document fails without emitting anything

    Describe the bug A call to $documentsApi->modifyIssuedDocument with malformed parameters fails silently without emitting warnings, errors, or throwing exceptions

    Env info

    • PHP 7.2
    • SDK 2.0.16

    To Reproduce

    • $result = $documentsApi->modifyIssuedDocument($this->company_id, $document_id, $request)->getData();, where the request is created with some invalid parameters (eg: adding/deleting/updating items without also updating the payment amount)

    Expected behavior An ApiException is thrown with, for instance,"Il totale dei pagamenti non corrisponde al totale da pagare." as a message.

    Additional context Also, it would be very convenient to have the fix_payments options also in the modifying requests.

    opened by melefabrizio 3
  • Fields created_at and updated_at not returned

    Fields created_at and updated_at not returned

    I tried to use method: ReceivedDocumentsApi->listReceivedDocuments to retrieve all expenses (in "detailed" mode) but fields "created_at" and "updated_at" are not returned.

    If I use API REFERENCE web tools from: https://developers.fattureincloud.it/api-reference, both fields are returned correctly

    opened by itajackass 3
  • Missing permanent token and mismatch between examples and schemas in API reference docs

    Missing permanent token and mismatch between examples and schemas in API reference docs

    Describe the bug The permanent_token field is present in the responses examples for creation, retrieval and modification of issued documents, but it is not present in the related docs schemes and SDK.

    Previously (API v1), the id of the issued documents changes at each modification of the data requiring the use of the permanent token.

    Now (API v2) the permanent token is no longer accessible, and even if the id remains the same, it makes it impossible to transition from API v1 to v2 without creating disruption to our customers.

    Env info Please, provide us with the following details:

    • PHP 7.3.32
    • PHP SDK 2.0.16

    To Reproduce Not applicable.

    Expected behavior The documentation should be aligned and the permanent_token should be accessible from the SDK, otherwise it becomes impossible to transition to v2 for non-finalized documents, or for documents for which a subsequent modification is made through the API.

    I understand it's a major version transition, but I don't think you've overlooked that, so let me know if I've missed anything.

    opened by marco-sacchi 2
  • Implement `salva_anagrafica` and `autocompleta_anagrafica`

    Implement `salva_anagrafica` and `autocompleta_anagrafica`

    Currently Api v2 does not support the salva_anagrafica and autocompleta_anagrafica options on IssuedDocument endpoints to automatically save and fetch entity information, it would be very useful to implement it, as it makes transition from v1 to v2 much easier

    opened by melefabrizio 1
  • fixed reference from ddt to dn in IssuedDocumentItemsListItem

    fixed reference from ddt to dn in IssuedDocumentItemsListItem

    in agreement with this discussion https://github.com/fattureincloud/api/discussions/168 the api accept "in_dn" not "in_ddt". This PR seems to fix the the method $invoice->setDeliveryNote(true) to display only correct products with in_dn boolean test to true

    opened by zofe 1
  • Entity senza chiave primaria?

    Entity senza chiave primaria?

    Salve, ho una domanda: come è possibile che ci siano alcune entity (associate a fatture) senza l'id. Qual è la chiave primaria su cui fare affidamento? Posso usare il name? Grazie.

    opened by ventoh 1
  • how use create_client_request

    how use create_client_request

    How i can send client data (as name, cf, phone) with CreateClientRequest ?

    $apiInstance = new FattureInCloud\Api\ClientsApi( // 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 ); $create_client_request = new \FattureInCloud\Model\CreateClientRequest; // \FattureInCloud\Model\CreateClientRequest | The client to create

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

    opened by pws2016 1
  • data.items_list.0.discount can't be null, discording with API Reference

    data.items_list.0.discount can't be null, discording with API Reference

    Describe the bug A clear and concise description of what the bug is. POST https://api-v2.fattureincloud.it/c/company_id/issued_documents resulted in a 422 Unprocessable Entity response: {"error":{"message":"Invalid request.","validation_result":{"data.items_list.0.discount":["The data.items list.0.discoun

    From API Reference discount: number┃null Discount percentual value. But when is set to null we receive a 422

    Env info

    • PHP version 8.0
    • PHP SDK version latest

    To Reproduce Create an invoice with discount null

    Expected behavior Creation of an invoice

    opened by Mattia-Marchiorato 0
Owner
Fatture in Cloud
Fatture in Cloud
Google Cloud Profiler for PHP

Google Cloud Profiler for PHP Idiomatic PHP client for Google Cloud Profiler. API documentation NOTE: This repository is part of Google Cloud PHP. Any

Google APIs 1 Apr 28, 2022
PHP client library for the DynamicPDF Cloud API.

PHP Client (php-client) The PHP Client (php-client) project uses the DynamicPDF Cloud API's PHP client library to create, merge, split, form fill, sta

DynamicPDF Cloud API 0 Nov 29, 2021
It's a PHP Application to simplify working with Google Sheets SDK for php.

About GoogleSheetsPHP It's a PHP Application to simplify working with Google Sheets SDK for php. Note: i used Slim 3 to construct the application but

Sami Alateya 5 Dec 20, 2022
Official repository of the AWS SDK for PHP (@awsforphp)

AWS SDK for PHP - Version 3 The AWS SDK for PHP makes it easy for developers to access Amazon Web Services in their PHP code, and build robust applica

Amazon Web Services 5.7k Jan 1, 2023
Mailgun's Official SDK for PHP

Mailgun PHP client This is the Mailgun PHP SDK. This SDK contains methods for easily interacting with the Mailgun API. Below are examples to get you s

Mailgun Team 1k Dec 23, 2022
A Laravel package to help integrate Shopware PHP SDK much more easier

Shopware 6 Laravel SDK A Laravel package to help integrate Shopware PHP SDK much more easier Installation Install with Composer composer require sas/s

Shape & Shift 16 Nov 3, 2022
Minter Blockchain PHP SDK

About This is a pure PHP SDK for working with Minter blockchain Installation Minter Api Methods: getBalance getNonce send getAddresses getStatus getVa

Minter 24 Nov 21, 2022
The official PHP SDK for Webmarketer (app.webmarketer.io)

PHP SDK for Webmarketer The official PHP SDK for Webmarketer (app.webmarketer.io). Install To add this package, your project must meet several require

Webmarketer 5 Dec 13, 2021
A PHP SDK for the GlobalSmartOTP API.

GlobalSmartOTP PHP SDK A PHP SDK for the GlobalSmartOTP API. Requirements PHP 7.4 or higher cURL Installation $ git clone [email protected]:GlobalSmartOT

GlobalSmartOTP 4 Oct 2, 2022
🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Telegram Bot API - PHP SDK Telegram Bot PHP SDK lets you develop Telegram Bots in PHP easily! Supports Laravel out of the box. Telegram Bot API is an

Irfaq Syed 2.5k Jan 6, 2023
Explicador e2Payments PHP SDK

This package seeks to help php developers implement the e2Payments APIs without much hustle. It is based on the REST API whose documentation

Explicador 5 Oct 26, 2022
Official PHP SDK for interacting with the Knock API.

Knock PHP library Documentation See the documentation for PHP usage examples

Knock 4 Dec 16, 2022
Laravel wrapper for the Facebook Graph PHP 8 SDK

Laravel Facebook Graph SDK Installation Getting started with Laravel Facebook Graph is easy - first, install the package via composer composer require

Joel Butcher 44 Dec 8, 2022
OneSignal PHP SDK

OneSignal SDK for PHP developers with fluent API and supports Laravel / Lumen out of the box.

Lawrence Onah 4 Nov 8, 2022
2c2p payment gateway Redirect PHP-SDK

2c2p payment gateway Redirect PHP-SDK

Bilions 2 Oct 1, 2022
可能是基于 hyperf 的最优雅的支付宝、微信支付 SDK 了

当前组件整体处于 beta 阶段 运行环境 php >= 7.3 composer hyperf >= 2.1 安装 composer require yansongda/hyperf-pay:~1.0.0 说明 发布配置文件 php bin/hyperf.php vendor:publish ya

yansongda 44 Dec 8, 2022
SDK for latest version of Telegram bots API

SDK for latest version of Telegram bots API (from April 24, 2020) Using Examples Installing composer require "DiyorbekUz/Telelib: dev-master" Init bot

Diyorbek 2 Sep 5, 2021
API SDK for OpenTrade Commerce API: Taobao, Alibaba, JD, 1688, Aliexpress, Ebay.

OtapiPhpClient Create Client $client = new OtClient($key, $secret, $lang); key (Access Key) secret (Secret for access key) language (2 symbol lang id

OpenTrade Commerce 5 Sep 20, 2022
Laravel SDK for Sentry

Sentry for Laravel Laravel integration for Sentry. Laravel Version Compatibility Laravel <= 4.2.x is supported until 0.8.x Laravel <= 5.7.x on PHP <=

Sentry 1.1k Dec 30, 2022