You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »

The Fakturia API is an open interface using the REST standard. It allows developers to directly interact with our application via HTTPS exchanging data in the JSON format.

Endpoint for all API calls: https://api.fakturia.de/v1/

Prerequisites

The API can only be accessed if the following conditions are true:

  • Your Fakturia plan includes API access
  • The API is activated in the backend for at least one project
  • An API-Key has been generated in the backend
  • The IP address of your client has been added to the IP whitelist for the project

Authorization

Include the following HTTP-Header variables in every request to authorize against our service:

Header variable namevalue
api-key{your api key - see project settings in the backoffice}

 

Resources Overview

URLGETPOSTPUTPATCHDELETEStatus
/Customersretrieve all customerscreate a new customer   (tick)
/Customers/:CustomerNumberretrieve one customer udpate existing customer (minus)  (tick)
/Customers/:CustomerNumber/Contractsget all contracts for a customer    (tick)
/Contractsget all contractscreate a new contract   

(tick)

/Contracts/:ContractNumberretrieve one contract update existing contract (minus)  (tick)
/Contracts/:ContractNumber/Activitiesget all activities for a given contractcreate a new activity record for a contract   (minus)
/Contracts/:ContractNumber/Subscriptionget the subscription for a contractcreate a new subscription for a contract   (minus)
/Invoicesretrieve all invoices    (minus)
/Projectsretrieve all projects    (tick)

Errors

The API returns standard HTTP status codes to indicate that something went wrong.

Status codePossible reasons
400 Bad RequestYou have sent an invalid JSON format or invalid data. Validation errors will be printed into the body of the response.
404 Not FoundThe request resource could not be found
500 Internal Server ErrorWe got the correct data but the server got an unknown error while processing your request. You will find detailed information about the error in the body of the response.

Example error result:

{"errorKey":"INCORRECT_INPUT_DATA","errorMessage":"invalid item number: xd004"}

 

ENum Values

All possible values of our Enum types are described here.

EnumValuesUsage example
TimeUnit

DAY
WEEK
MONTH
YEAR

Due period for customer
SalutationMR
MRS
COMPANY
Salutation of customer
PaymentMethodBANKTRANSFER
PAYPAL
MONEYBOOKERS
SOFORTUEBERWEISUNG
SEPA_DEBIT
Type of payment for customer or contract
ItemUnitPIECE
DAY
WEEK
MONTH
YEAR
unit of a item, e.g. fee per MONTH

Resource Reference

POST /Customers

Create a new customer.

Example request:

{
        "salutation": "MR",
        "firstName": "John",
        "lastName": "Doe",
        "companyName": "MegaCorp",
        "locale": "de_DE",
        "websiteUri": "",
        "phone1": "+49 89 224433",
        "phone2": "",
        "telefax": "",
        "mobile": "",
        "email": "info@megacorp.com",
        "birthdate": "1980-11-02",
        "euTaxId": "",
        "taxNumber": "",
        "noteText": null,
        "postalAddress": null,
        "billingAddress": {
            "addressLine1": "Arlington Road 1",
            "addressLine2": "",
            "addressLine3": "",
            "zipCode": "80333",
            "cityName": "Example Town",
            "state": "",
            "country": "DE"
        },
        "paymentMethod": null,
        "emailInvoice": "",
        "taxRegion": "NATIONAL",
        "duePeriod": "0",
        "dueUnit": "DAY"
    }

 

POST /Contracts

Create a new contract for a customer. Adding a subscription is optional.

accountNumber only required if multiple accounts for customer exist.

 

Example request with subscription:

{
        "accountNumber": 2,
        "customerNumber": "CUST1001",
        "projectName": "Projekt1",
        "subscription": {
            "termPeriod": 1,
            "termUnit": "MONTH",
            "noticePeriod": 4,
            "noticeUnit": "WEEK",
            "continuePeriod": 1,
            "continueUnit": "MONTH",
            "billedInAdvance": true,
            "subscriptionItems": [{
                    "quantity": 1,
                    "extraDescription": "",
                    "itemNumber": "item001"
                }
            ]
            
        },
        
        "issueDate": "2016-11-14",
        "recur": 6,
        "recurUnit": "MONTH",
        "duePeriod": null,
        "dueUnit": null,
        "paymentMethod": null
    }

 

 

  • No labels