Import invoice https://api.rrr.lt/crm/importInvoice

POST variables

Name Type Required Data
username Text varchar(50) YES Username
password Text varchar(100) YES Password
user_token Text YES Token provided
order_id Numeric YES Order id
is_credit_invoice Numeric 1-true, 0-false YES Invoice type
file PDF file YES Invoice file
invoice_number Text varchar(50) YES Full invoice number

PHP Curl example code

$post = [
'username' => '',
'password' => '',
'user_token' => '',
'order_id' => 555,
'invoice_number' => 'ABC12345',
'is_credit_invoice' => 0,
'file' => new CurlFile('/path/to/invoice_123_ABC.pdf', 'application/pdf', 'invoice_123_ABC.pdf'),
];

$ch = curl_init('https://api.rrr.lt/crm/importInvoice');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
$response = curl_exec($ch);
curl_close($ch);

Output

{"msg":"OK","status_code":"R200"}

Attention

Only one invoice per order is allowed. Multiple credit invoices are allowed.