API e-Cont.md is designed for issuing and handling electronic invoices for business (B2B and B2C).

Through the API, you can manage invoicing for various businesses, import and export of invoices for payment, and much more.

List of useful pages for this API reference:

  • Sign up for facturare.md
  • Developer Documentation
  • Facturare.md – Sandbox
  • API Endpoint or “interaction point” when the API interacts with another system

All API calls must be made to https://api.facturare.md

We have a sandbox environment for testing available at https://api.sandbox.facturare.md

Get help or suggestion to improve the API

We have made this document available in the user’s personal account.
In order for you to have access, you need to “register in facturare.md”.

Please report any issues in the API documentation.
Any requests for changes to this document are also welcome!
If you need help using the API or need to discuss something meaningful, please email us at api.facturare.md@gmail.com.


Authentication

The API uses HTTP basic authentication to authenticate users. A valid API key is required for all requests.

Use only HTTPS requests! Any HTTP requests will be ignored.


Getting an API Key

An API key can be obtained by signing into facturare.md and then going to “Settings → Developers → API Keys”.
Each business on facturare.md has its own set of API keys.
We recommend creating a separate API key for each application that will be making calls on your behalf.


Errors

Each API call returns an HTTP status code that reflects the nature of the response. We have done our best to follow the HTTP status code conventions.

The facturare.md API returns the following HTTP status codes:

200 OK – Request succeeded
201 Created – A resource was created
204 No Content – Request succeeded but there is no response body
400 Bad Request – Invalid request parameters
401 Unauthorized – Incorrect or missing API key
403 Forbidden – You do not have permission to view a resource or perform an action
404 Not Found – The specified resource could not be found
429 Too Many Requests – You’re moving too fast! Slow down!
500 Internal Server Error – There was a problem on our end

Any request that did not succeed will return a 4xx or 5xx error. The 4xx range means there was a problem with the request, like a missing parameter. The 5xx range means that something went wrong on our end.

All error responses will contain an object with these attributes

PARAMETER DESCRIPTION
type Type of error, invalid_request or api
message Explanation of the error
param Available when a specific request parameter was responsible


Versioning

Any future changes to the API will be versioned in order to maintain backwards compatibility with existing integrations.


Special Parameters

Expanding Relations

Usually you need to request more than just an invoice. Often, you might want data about the associated customer. There is a built-in way to do this that saves extra API requests.

curl “https://api.facturare.md/invoices/:id?expand=customer” \
-u {API_KEY}:

Certain relational properties can be expanded by passing in a comma-separated list of properties to expand through the expand parameter. For example if you were requesting a payment and wanted to expand the associated customer and invoice objects you would set expand=customer,invoice. This will replace the ID on the customer and invoice properties with expanded objects.

The expand parameter works for any response that has relational properties.

Filter

The filter parameter allows you to search entities based on an exact match. While it is not meant to replace a search API, the filter parameter can be useful if you need to look up a customer by name or want to list all overdue invoices. It can be used on many of the list endpoints.

The filter parameter is an object whose keys are the properties that should be matched.

Example retrieving a list of outstanding invoices for a customer:

curl “https://api.facturare.md/invoices?filter%5Bpaid%5D=0&filter%5Bclosed%5D=0&filter%5Bcustomer%5D=1234” \
-u {API_KEY}:

Metadata Filter

The metadata parameter behaves in a similar fashion to the filter parameter. It allows you to search entities that have an exactly matching metadata value for each constraint given. It can be used on any of the list endpoints for objects that support metadata.

The metadata parameter is an object whose keys should exactly match the metadata of the objects returned. If an object does not have a metadata value for a given key then the object will not be included in the result set, with no error being thrown.

Example retrieving customers with a matching account-rep metadata value:

curl “https://api.facturare.md/customers?metadata%5Baccount-rep%5D=Jan” \
-u {API_KEY}: