API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

Add line to invoice

0

Is it possible to add a new line to an existing invoice with the rest api? Is there any documentation on this and if so, where?

or is it possible to update an existing invoice by adding a value to this array?

$data = [
   'AppID'    => 'MYAPPID',
   'AccessID' => 'MYACCESSID',
   'currency' => 'DKK',
   'customer' => [
      'customerNumber' => $customerNumber
   ],
   'date' => $today->format("Y-m-d\TH:i:sP"),
   'layout' => [
      'layoutNumber' => 9
   ],
   'paymentTerms'=> [
      'paymentTermsNumber' => 4,
   ],
   'recipient' => [
      'name' => 'test'
   ],
   'recipient.name' =>[
      'test'
   ],
   'lines'=> [
      [
         "lineNumber"=> 2,
         "product" => [
            "productNumber"=> "500"
         ],
         "quantity"=> 1.00,
         "unitNetPrice"=> 200,
         "productName"=> 'Ur oprettelse'
      ]

   ],


];
created Apr 20, 2015 by Siop
50% Accept Rate

edited Apr 20, 2015 by Siop
Q 2 A 0 C 0

1 Answer

0
Added a line below. PUT to the draft (/invoices/drafts/:id) and it'll be updated. Remember to PUT the whole document with the additional/changed data as PUT overwrites existing.
 
'lines'=> [
[
"lineNumber"=> 2,
"product" => ["productNumber"=> "500"],
"quantity"=> 1.00,
"unitNetPrice"=> 200,
"productName"=> 'Ur oprettelse'
],
"lineNumber"=> 3,
"product" => ["productNumber"=> "500"],
"quantity"=> 2.00,
"unitNetPrice"=> 200,
"productName"=> 'Another line added'
]
],
answered Apr 20, 2015 by olej
Visma e-conomic A/S
...