efacto logo

Getting started with ERPintegrator API

ERPintegrator API is a simple way to send and receive data related to electronic invoicing. The API can be called from command line or from your preferred programming language. In these instructions you find example code for PHP and cURL.

Before continuing make sure you have an efacto account. Go to https://efacto.com/erpintegrator/ and signup for ERPintegrator.

1. Creating an integration

Portal login
Go to https://portal.efacto.com and login to the efacto portal.
Portal navigation ERPintegrator
Navigate to ERPintegrator.
Portal integrations list
Click on the create button (the big plus).
Portal integration create form
Now give your integration a name and click the create button.
Portal integration created
Your integration is now created and you are ready to use the API.
Remember to write down the API key as highlighted on the image, you will need it to call the API.

2. Using the API

To authenticate with our API you should always include the X-API-KEY header in your requests.

Curl example:


curl --location --request POST  \
'https://erpintegrator.efacto.com/api/documents/upload' \
--header 'Content-Type application/json' \
--header 'X-API-KEY [API-KEY. EXAMPLE: 90fedd2f-166e-4be7-83ae-c1b0ad65b3be]' \
--data-raw '{
    "name": "[filename.pdf/filename.csv/filename.json}",
    "base64Content": "[BASE64 ENCODED STRING OF DATA]"
}
                

PHP example:


$curl = curl_init();
curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://erpintegrator.efacto.com/api/documents/upload',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => '{"file": "[filename.pdf/filename.csv/filename.json]", "base64Content": "[BASE64 ENCODED STRING OF DATA]"}',
    CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'X-API-KEY: [API-KEY. EXAMPLE: 90fedd2f-166e-4be7-83ae-c1b0ad65b3be]')
));
                

Other resources

API documentation