The interface for your projects and apps!
Introduction
The FastBill API was created as an XML/JSON Web Service. All of its resources are operated by a central URL. All API requests are sent as POST requests with either an XML- or JSON-formatted Body to the Service-URL. These documents describe the communication in XML Format.
https://my.fastbill.com/api/1.0/api.php
Every request is encrypted with SSL when it is transmitted.
Authentication
The Standard-Authentication occurs through the existing FastBill User (E-Mail Address) und the API-Key of the respective FastBill Account. In this way, users have simple access to their own account.
API-Accesses are stateless; that means no sessions are saved. The email address and API-Key must be submitted for every request.
The authentication is conducted using HTTP Basic Authentication:
curl -v -X POST \
-u {E-Mail-Adresse}:{API-Key} \
-H 'Content-Type: application/xml' \
-d '{xml body}' \
https://my.fastbill.com/api/1.0/api.php
For providers of Add-ons or Mobile Apps, it is possible to conduct authentication using the email address and password of a current user. These external tools accept separate “Add-On Access Information” (their own E-Mail Address and API-Key). However, in order to authenticate the service, the users’ access information must be submitted separately.
API-Accesses are stateless; that means no sessions are saved. The access information for the Add-On, as well as the access information of the user, must be submitted for every request.
The Authentication is conducted using HTTP Basic Authentication, as well as additional HTTP Header-Data:
curl -v -X POST \
-u {E-Mail-Adresse}:{API-Key} \
-H 'X-Username: {E-Mail Adresse des Benutzers}'\
-H 'X-Password: {Passwort des Benutzers}' \
-H 'Content-Type: application/xml' \
-d '{xml body}' \
https://my.fastbill.com/api/1.0/api.php
Request structure
The header always inconcludes:
Example:
curl -v -X POST \
-u {E-Mail-Adresse}:{API-Key} \
-H 'Content-Type: application/xml' \
-d '{xml body}' \
https://my.fastbill.com/api/1.0/api.php
The body of a request / a response always follows the same pattern. The following compo-nents constitute the frameworks:
Example of a successful retrieval of data for a client:
Request
<?xml version="1.0" encoding="utf-8"?> <FBAPI> <SERVICE>customer.get</SERVICE> <FILTER> <CUSTOMER_ID>5376</CUSTOMER_ID> </FILTER> </FBAPI>
Response
<?xml version="1.0" encoding="utf-8"?> <FBAPI> <REQUEST> <SERVICE>customer.get</SERVICE> <FILTER> <CUSTOMER_ID>5376</CUSTOMER_ID> </FILTER> </REQUEST> <RESPONSE> <CUSTOMERS> <CUSTOMER> ... </CUSTOMER> </CUSTOMERS> </RESPONSE> </FBAPI>
Example of a wrong declaration to create a new customer:
Request
<?xml version="1.0" encoding="utf-8"?> <FBAPI> <SERVICE>customer.create</SERVICE> <DATA> ... </DATA> </FBAPI>
Response
<?xml version="1.0" encoding="utf-8"?> <FBAPI> <REQUEST> <SERVICE>customer.create</SERVICE> <DATA> ... </DATA> </REQUEST> <RESPONSE> <ERRORS> <ERROR> ... </ERROR> </ERRORS> </RESPONSE> </FBAPI>
Further comments:
Limitations
The maximum number of calls depends on your subscription:
However, the maximum number of elements for the retrieval is 100.
Webhooks: the use of webhooks is only supported in the Pro and Premium plans.