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 cca0a35b-29c5-436b-87f7-2b1feb89068a' \
--data-raw '{
    "name": "filename.pdf",
    "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": "my_awesome_pdf3.pdf", "base64Content": "BASE64 ENCODED STRING OF DATA"}',
    CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'X-API-KEY: cca0a35b-29c5-436b-87f7-2b1feb89068a')
));
                

Other resources

API documentation