Product Documentation

Versions

About FusionInvoice - 2024

The FusionInvoice API- Getting Started

Getting Your Authentication Token

How the API Endpoints are Organized


For the purpose of testing, we are using Postman. You can use whatever API testing tool you prefer. We are including a Postman collection for you to explore the API.


Click here to download the Postman collection.

Below are the variables we have set up for our local environment to make testing easier. Note that the token value must be retrieved using the login endpoint. More on that next.



Getting Your Authentication Token


Your API auth token can be retrieved by using the FusionInvoice login endpoint. Before doing this, it's a good idea to create a new admin level user within your FusionInvoice installation, which you will use for API calls. For instance, create a called API user with an email of [email protected] and made note of the password. Next, we'll go back to Postman and call the login endpoint with this new user's credentials. (see example below)



Click the Send button and your personal access token will be generated. You will see it in the response area.



At this point, you can go back to your Postman environment variables and paste in the value from the token you received. (In this example you would paste in the value starting with 2|Wlf. Do not paste the quotation marks.) Now that you have a token saved to your environment, you should be able to start making API calls from Postman.


How the API Endpoints are Organized


Our endpoints are organized by module and we currently support:

  • Client
  • Invoices
  • Quotes
  • Payments

Let's explore the Client endpoints first. There are 5 endpoints that can be called for clients.



List endpoints end in the name of the module, for instance the list endpoint for clients would be something like: https://myfiurl.com/api/v1/clients


List endpoints support many query parameter options for filtering criteria.

  • paginated_response
  • include_custom_fields
  • active

In addition, you can specify any valid field name that matches (or does not match) a certain value. For instance, if we wanted to retrieve a list of clients that had a timezone in America, we would add a “timezone” key and give it a value of “america”.


You may also query by custom field values. For instance you may have defined a custom field (column_3) for owner's name. To query all clients that have an owner's name containing "dirk", you would add the parameter "custom->column_3 = dirk".


In the same manner, you can query the invoices, quotes and payments list endpoints by related field values. For instance, you might want all quotes for the client named "Acme Services". You would do this by adding "client->name = acme services" to your query parameters.


It is important to note that if you are querying by a custom or related field and you have other fields in your query condition, the where_operator is automatically changed, internally, to AND.


If you add multiple key values to filter by, the conditions are joined with an OR operator. For instance, timezone=america OR name=acme shoe repair. However, you can change the operator to an AND condition by adding the key “where_operator” and giving it a value of “AND”. The OR or AND operator works on the entire expression and at this time you cannot mix and match OR and AND operators.


Show endpoints are meant to fetch the data for a single record. In the case of a client, we would specify the ID of the client to show in the URL. Ie. https://myfiurl.com/api/v1/clients/2


List endpoints support many query parameter options for filtering criteria.

  • include_custom_fields

Add endpoints use an POST method and are used to add a new record and have a URL ending with “/store”. In the case of a client, https://myfiurl.com/api/v1/clients/store


There are several required fields for each add endpoint. In the case of clients, the required fields are"

  • name
  • email
  • type

You can however pass any valid field name and value pair.


Update endpoints use a PUT method and are used to update an existing record and have a URL ending with ID of the record. A client example, https://myfiurl.com/api/v1/clients/1201


List the fields name and values you would like to update. Here is a JSON body example for the client with ID 1201:

        {

            "name" : "Barnes and Associates",
            "city" : "Tallahassee",
            "state" : "FL",
            "active" : 1

            }
        


Delete endpoints use a DEL method and are used to delete an existing record. They have a URL ending with ID of the record. A client example, https://myfiurl.com/api/v1/clients/1302


There are no additional parameters for delete endpoints.


Formatting the Request Parameters


The API can accept parameters as normal URL query stings (key value pairs) or as JSON in the body of the request. The JSON collection included shows both methods in the various examples.


Other endpoints


The other endpoints the API supports are listed below, by module. Postman examples are provided for all of them.


Invoices Endpoints


Payments Endpoints


Quotes Endpoints

Loading...