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.
To authenticate with our API you should always include the X-API-KEY header in your requests.
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]"
}
$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]')
));