# 2014-11-26

We have launched a new API for the new MoneyBird. All functions of our old API can be found in the new API. Some REST endpoints have been renamed to reflect the new MoneyBird better.

The new API is still a REST API and behaves in a comparable way as our previous API.

### Common

* HTTP Basic authentication is removed, authentication can only be done with OAuth keys. [More information](/authentication)
* JSON is the default data type for all requests and responses. XML is still available by changing the format in the path.
* The API can be found on `https://moneybird.com/api`, versioning is done in the URL. The new API has version `v2`.
* Subdomains for accessing certain administations are removed. The path to a resource contains the id of an administration: `/api/v2/:administration_id.json`
* All primary keys of entities in the API are bigints, for example 107693607045039116. Storing these ids in your own database might need special attention.
* All entities formerly present in the database will have a new primary key. When you have stored ids of entities in your own database, you need to migrate these.

### Sales invoices

* Renamed endpoint from `/invoices` to `/sales_invoices`
* The endpoints for the synchronisation API have been renamed from `/sync_list_ids` and `/sync_fetch_ids` to `/sales_invoices/synchronization`. The HTTP method makes the difference between listing and fetching.
* Changing contact information or adding contacts through the sales invoices endpoints is removed. Upon creation of a new sales invoice, a contact should be provided. This contact needs to be created with the contact endpoints.
* The attribute `description` has been renamed to `payment_conditions`
* The attribute `po-number` has been renamed to `reference`
* The attribute `recurring-template-id` has been renamed to `recurring_sales_invoice_id`
* The attribute `sepa-active` is removed, the workflow now defines the payment process of the sales invoice
* The attribute `invoice-profile-id` is removed. Invoice profiles have been replaced by document styles and workflows. A document style determines the layout of the sales invoice, the workflow determines the process for receiving a payment. Both can be set by `document_style_id` and `workflow_id`.
* Payments for sales invoices no longer store a payment method. The method of payment is determined based on the financial mutation the payment is linked to.

### Documents

* The `/incoming_invoices` endpoints have been removed in favor of a more general `/documents` endpoint. Each document type in MoneyBird has their own endpoints: [purchase invoices](/api/documents_purchase_invoices), [receipts](/api/documents_receipts), [general journal documents](/api/documents_general_journal_documents) and [general documents](/api/documents_general_documents).

### Recurring invoices

* The `/recurring_templates` endpoints have been removed in favor of `/recurring_sales_invoices`. 
* The attribute `frequency-type` now accepts strings describing the frequency. Integer values are not accepted anymore.
* The attribute `invoice-profile-id` has been removed in favor of a `document_style_id` and `workflow_id`.

### Contacts

* The endpoints for the synchronisation API have been renamed from `/sync_list_ids` and `/sync_fetch_ids` to `/contacts/synchronization`. The HTTP method makes the difference between listing and fetching.

### Invoice profiles

* The `/invoice_profiles` endpoints have been removed in favor of the [workflow](/api/workflows) and [document style](/api/document_styles) endpoints.



