Skip to content

fattureincloud/fattureincloud-js-sdk

Repository files navigation

FattureInCloud JavaScript SDK

NPM unit tests

@fattureincloud/fattureincloud-js-sdk - JavaScript client for Fatture in Cloud API.

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.

This SDK is automatically generated by the OpenAPI Generator project:

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

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

Installation

Using npm:

npm install @fattureincloud/fattureincloud-js-sdk

Using yarn:

yarn add @fattureincloud/fattureincloud-js-sdk

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var fattureInCloudSdk = require('@fattureincloud/fattureincloud-js-sdk');

var defaultClient = fattureInCloudSdk.ApiClient.instance;
// Configure OAuth2 access token for authorization: OAuth2AuthenticationCodeFlow
var OAuth2AuthenticationCodeFlow = defaultClient.authentications['OAuth2AuthenticationCodeFlow'];
OAuth2AuthenticationCodeFlow.accessToken = "YOUR ACCESS TOKEN"

var api = new fattureInCloudSdk.ArchiveApi()
var companyId = 12345; // {Number} The ID of the company.
var opts = {
  'createArchiveDocumentRequest': {"data":{"date":"2021-08-20","category":"Altri documenti","description":"spesa 1","attachment_token":"ibfjdbf94ey9w94g3w894qbasrga"}} // {CreateArchiveDocumentRequest} The Archive Document.
};
api.createArchiveDocument(companyId, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

Class Method HTTP request Description
fattureInCloudSdk.ArchiveApi createArchiveDocument POST /c/{company_id}/archive Create Archive Document
fattureInCloudSdk.ArchiveApi deleteArchiveDocument DELETE /c/{company_id}/archive/{document_id} Delete Archive Document
fattureInCloudSdk.ArchiveApi getArchiveDocument GET /c/{company_id}/archive/{document_id} Get Archive Document
fattureInCloudSdk.ArchiveApi listArchiveDocuments GET /c/{company_id}/archive List Archive Documents
fattureInCloudSdk.ArchiveApi modifyArchiveDocument PUT /c/{company_id}/archive/{document_id} Modify Archive Document
fattureInCloudSdk.ArchiveApi uploadArchiveDocumentAttachment POST /c/{company_id}/archive/attachment Upload Archive Document Attachment
fattureInCloudSdk.CashbookApi createCashbookEntry POST /c/{company_id}/cashbook Create Cashbook Entry
fattureInCloudSdk.CashbookApi deleteCashbookEntry DELETE /c/{company_id}/cashbook/{document_id} Delete Cashbook Entry
fattureInCloudSdk.CashbookApi getCashbookEntry GET /c/{company_id}/cashbook/{document_id} Get Cashbook Entry
fattureInCloudSdk.CashbookApi listCashbookEntries GET /c/{company_id}/cashbook List Cashbook Entries
fattureInCloudSdk.CashbookApi modifyCashbookEntry PUT /c/{company_id}/cashbook/{document_id} Modify Cashbook Entry
fattureInCloudSdk.ClientsApi createClient POST /c/{company_id}/entities/clients Create Client
fattureInCloudSdk.ClientsApi deleteClient DELETE /c/{company_id}/entities/clients/{client_id} Delete Client
fattureInCloudSdk.ClientsApi getClient GET /c/{company_id}/entities/clients/{client_id} Get Client
fattureInCloudSdk.ClientsApi listClients GET /c/{company_id}/entities/clients List Clients
fattureInCloudSdk.ClientsApi modifyClient PUT /c/{company_id}/entities/clients/{client_id} Modify Client
fattureInCloudSdk.CompaniesApi getCompanyInfo GET /c/{company_id}/company/info Get Company Info
fattureInCloudSdk.CompaniesApi getCompanyPlanUsage GET /c/{company_id}/company/plan_usage Get Company Plan Usage
fattureInCloudSdk.EmailsApi listEmails GET /c/{company_id}/emails List Emails
fattureInCloudSdk.InfoApi listArchiveCategories GET /c/{company_id}/info/archive_categories List Archive Categories
fattureInCloudSdk.InfoApi listCities GET /info/cities List Cities
fattureInCloudSdk.InfoApi listCostCenters GET /c/{company_id}/info/cost_centers List Cost Centers
fattureInCloudSdk.InfoApi listCountries GET /info/countries List Countries
fattureInCloudSdk.InfoApi listCurrencies GET /info/currencies List Currencies
fattureInCloudSdk.InfoApi listDeliveryNotesDefaultCausals GET /info/dn_causals List Delivery Notes Default Causals
fattureInCloudSdk.InfoApi listDetailedCountries GET /info/detailed_countries List Detailed Countries
fattureInCloudSdk.InfoApi listLanguages GET /info/languages List Languages
fattureInCloudSdk.InfoApi listPaymentAccounts GET /c/{company_id}/info/payment_accounts List Payment Accounts
fattureInCloudSdk.InfoApi listPaymentMethods GET /c/{company_id}/info/payment_methods List Payment Methods
fattureInCloudSdk.InfoApi listProductCategories GET /c/{company_id}/info/product_categories List Product Categories
fattureInCloudSdk.InfoApi listReceivedDocumentCategories GET /c/{company_id}/info/received_document_categories List Received Document Categories
fattureInCloudSdk.InfoApi listRevenueCenters GET /c/{company_id}/info/revenue_centers List Revenue Centers
fattureInCloudSdk.InfoApi listTemplates GET /info/templates List Templates
fattureInCloudSdk.InfoApi listUnitsOfMeasure GET /info/measures List Units of Measure
fattureInCloudSdk.InfoApi listVatTypes GET /c/{company_id}/info/vat_types List Vat Types
fattureInCloudSdk.IssuedDocumentsApi createIssuedDocument POST /c/{company_id}/issued_documents Create Issued Document
fattureInCloudSdk.IssuedDocumentsApi deleteIssuedDocument DELETE /c/{company_id}/issued_documents/{document_id} Delete Issued Document
fattureInCloudSdk.IssuedDocumentsApi deleteIssuedDocumentAttachment DELETE /c/{company_id}/issued_documents/{document_id}/attachment Delete Issued Document Attachment
fattureInCloudSdk.IssuedDocumentsApi getEmailData GET /c/{company_id}/issued_documents/{document_id}/email Get Email Data
fattureInCloudSdk.IssuedDocumentsApi getExistingIssuedDocumentTotals POST /c/{company_id}/issued_documents/{document_id}/totals Get Existing Issued Document Totals
fattureInCloudSdk.IssuedDocumentsApi getIssuedDocument GET /c/{company_id}/issued_documents/{document_id} Get Issued Document
fattureInCloudSdk.IssuedDocumentsApi getIssuedDocumentPreCreateInfo GET /c/{company_id}/issued_documents/info Get Issued Document Pre-Create Info
fattureInCloudSdk.IssuedDocumentsApi getNewIssuedDocumentTotals POST /c/{company_id}/issued_documents/totals Get New Issued Document Totals
fattureInCloudSdk.IssuedDocumentsApi joinIssuedDocuments GET /c/{company_id}/issued_documents/join Join Issued Documents
fattureInCloudSdk.IssuedDocumentsApi listIssuedDocuments GET /c/{company_id}/issued_documents List Issued Documents
fattureInCloudSdk.IssuedDocumentsApi modifyIssuedDocument PUT /c/{company_id}/issued_documents/{document_id} Modify Issued Document
fattureInCloudSdk.IssuedDocumentsApi scheduleEmail POST /c/{company_id}/issued_documents/{document_id}/email Schedule Email
fattureInCloudSdk.IssuedDocumentsApi transformIssuedDocument GET /c/{company_id}/issued_documents/transform Transform Issued Document
fattureInCloudSdk.IssuedDocumentsApi uploadIssuedDocumentAttachment POST /c/{company_id}/issued_documents/attachment Upload Issued Document Attachment
fattureInCloudSdk.IssuedEInvoicesApi getEInvoiceRejectionReason GET /c/{company_id}/issued_documents/{document_id}/e_invoice/error_reason Get E-Invoice Rejection Reason
fattureInCloudSdk.IssuedEInvoicesApi getEInvoiceXml GET /c/{company_id}/issued_documents/{document_id}/e_invoice/xml Get E-Invoice XML
fattureInCloudSdk.IssuedEInvoicesApi sendEInvoice POST /c/{company_id}/issued_documents/{document_id}/e_invoice/send Send E-Invoice
fattureInCloudSdk.IssuedEInvoicesApi verifyEInvoiceXml GET /c/{company_id}/issued_documents/{document_id}/e_invoice/xml_verify Verify E-Invoice XML
fattureInCloudSdk.ProductsApi createProduct POST /c/{company_id}/products Create Product
fattureInCloudSdk.ProductsApi deleteProduct DELETE /c/{company_id}/products/{product_id} Delete Product
fattureInCloudSdk.ProductsApi getProduct GET /c/{company_id}/products/{product_id} Get Product
fattureInCloudSdk.ProductsApi listProducts GET /c/{company_id}/products List Products
fattureInCloudSdk.ProductsApi modifyProduct PUT /c/{company_id}/products/{product_id} Modify Product
fattureInCloudSdk.ReceiptsApi createReceipt POST /c/{company_id}/receipts Create Receipt
fattureInCloudSdk.ReceiptsApi deleteReceipt DELETE /c/{company_id}/receipts/{document_id} Delete Receipt
fattureInCloudSdk.ReceiptsApi getReceipt GET /c/{company_id}/receipts/{document_id} Get Receipt
fattureInCloudSdk.ReceiptsApi getReceiptPreCreateInfo GET /c/{company_id}/receipts/info Get Receipt Pre-Create Info
fattureInCloudSdk.ReceiptsApi getReceiptsMonthlyTotals GET /c/{company_id}/receipts/monthly_totals Get Receipts Monthly Totals
fattureInCloudSdk.ReceiptsApi listReceipts GET /c/{company_id}/receipts List Receipts
fattureInCloudSdk.ReceiptsApi modifyReceipt PUT /c/{company_id}/receipts/{document_id} Modify Receipt
fattureInCloudSdk.ReceivedDocumentsApi createReceivedDocument POST /c/{company_id}/received_documents Create Received Document
fattureInCloudSdk.ReceivedDocumentsApi deleteReceivedDocument DELETE /c/{company_id}/received_documents/{document_id} Delete Received Document
fattureInCloudSdk.ReceivedDocumentsApi deleteReceivedDocumentAttachment DELETE /c/{company_id}/received_documents/{document_id}/attachment Delete Received Document Attachment
fattureInCloudSdk.ReceivedDocumentsApi getExistingReceivedDocumentTotals POST /c/{company_id}/received_documents/{document_id}/totals Get Existing Received Document Totals
fattureInCloudSdk.ReceivedDocumentsApi getNewReceivedDocumentTotals POST /c/{company_id}/received_documents/totals Get New Received Document Totals
fattureInCloudSdk.ReceivedDocumentsApi getReceivedDocument GET /c/{company_id}/received_documents/{document_id} Get Received Document
fattureInCloudSdk.ReceivedDocumentsApi getReceivedDocumentPreCreateInfo GET /c/{company_id}/received_documents/info Get Received Document Pre-Create Info
fattureInCloudSdk.ReceivedDocumentsApi listReceivedDocuments GET /c/{company_id}/received_documents List Received Documents
fattureInCloudSdk.ReceivedDocumentsApi modifyReceivedDocument PUT /c/{company_id}/received_documents/{document_id} Modify Received Document
fattureInCloudSdk.ReceivedDocumentsApi uploadReceivedDocumentAttachment POST /c/{company_id}/received_documents/attachment Upload Received Document Attachment
fattureInCloudSdk.SettingsApi createPaymentAccount POST /c/{company_id}/settings/payment_accounts Create Payment Account
fattureInCloudSdk.SettingsApi createPaymentMethod POST /c/{company_id}/settings/payment_methods Create Payment Method
fattureInCloudSdk.SettingsApi createVatType POST /c/{company_id}/settings/vat_types Create Vat Type
fattureInCloudSdk.SettingsApi deletePaymentAccount DELETE /c/{company_id}/settings/payment_accounts/{payment_account_id} Delete Payment Account
fattureInCloudSdk.SettingsApi deletePaymentMethod DELETE /c/{company_id}/settings/payment_methods/{payment_method_id} Delete Payment Method
fattureInCloudSdk.SettingsApi deleteVatType DELETE /c/{company_id}/settings/vat_types/{vat_type_id} Delete Vat Type
fattureInCloudSdk.SettingsApi getPaymentAccount GET /c/{company_id}/settings/payment_accounts/{payment_account_id} Get Payment Account
fattureInCloudSdk.SettingsApi getPaymentMethod GET /c/{company_id}/settings/payment_methods/{payment_method_id} Get Payment Method
fattureInCloudSdk.SettingsApi getVatType GET /c/{company_id}/settings/vat_types/{vat_type_id} Get Vat Type
fattureInCloudSdk.SettingsApi modifyPaymentAccount PUT /c/{company_id}/settings/payment_accounts/{payment_account_id} Modify Payment Account
fattureInCloudSdk.SettingsApi modifyPaymentMethod PUT /c/{company_id}/settings/payment_methods/{payment_method_id} Modify Payment Method
fattureInCloudSdk.SettingsApi modifyVatType PUT /c/{company_id}/settings/vat_types/{vat_type_id} Modify Vat Type
fattureInCloudSdk.SuppliersApi createSupplier POST /c/{company_id}/entities/suppliers Create Supplier
fattureInCloudSdk.SuppliersApi deleteSupplier DELETE /c/{company_id}/entities/suppliers/{supplier_id} Delete Supplier
fattureInCloudSdk.SuppliersApi getSupplier GET /c/{company_id}/entities/suppliers/{supplier_id} Get Supplier
fattureInCloudSdk.SuppliersApi listSuppliers GET /c/{company_id}/entities/suppliers List Suppliers
fattureInCloudSdk.SuppliersApi modifySupplier PUT /c/{company_id}/entities/suppliers/{supplier_id} Modify Supplier
fattureInCloudSdk.TaxesApi createF24 POST /c/{company_id}/taxes Create F24
fattureInCloudSdk.TaxesApi deleteF24 DELETE /c/{company_id}/taxes/{document_id} Delete F24
fattureInCloudSdk.TaxesApi deleteF24Attachment DELETE /c/{company_id}/taxes/{document_id}/attachment Delete F24 Attachment
fattureInCloudSdk.TaxesApi getF24 GET /c/{company_id}/taxes/{document_id} Get F24
fattureInCloudSdk.TaxesApi listF24 GET /c/{company_id}/taxes List F24
fattureInCloudSdk.TaxesApi modifyF24 PUT /c/{company_id}/taxes/{document_id} Modify F24
fattureInCloudSdk.TaxesApi uploadF24Attachment POST /c/{company_id}/taxes/attachment Upload F24 Attachment
fattureInCloudSdk.UserApi getUserInfo GET /user/info Get User Info
fattureInCloudSdk.UserApi listUserCompanies GET /user/companies List User Companies
fattureInCloudSdk.WebhooksApi createWebhooksSubscription POST /c/{company_id}/subscriptions Create a Webhook Subscription
fattureInCloudSdk.WebhooksApi deleteWebhooksSubscription DELETE /c/{company_id}/subscriptions/{subscription_id} Delete Webhooks Subscription
fattureInCloudSdk.WebhooksApi getWebhooksSubscription GET /c/{company_id}/subscriptions/{subscription_id} Get Webhooks Subscription
fattureInCloudSdk.WebhooksApi listWebhooksSubscriptions GET /c/{company_id}/subscriptions List Webhooks Subscriptions
fattureInCloudSdk.WebhooksApi modifyWebhooksSubscription PUT /c/{company_id}/subscriptions/{subscription_id} Modify Webhooks Subscription

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

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