<?php
$invoice = array(
'customer_id' => '198938000001208463',
'contact_persons' => array("198938000001222003"),
'invoice_number' => 'TEST-00001',
'reference_number' => '123456',
'template_id' => '198938000000124001',
'date' => '2015-11-23',
'payment_terms' => 0,
'payment_terms_label' => 'Pagadero a la recepcion',
'due_date' => '2015-11-28',
'discount' => '0%',
'is_discount_before_tax' => true,
'discount_type' => 'item_level',
'is_inclusive_tax' => false,
'exchange_rate' => 0.103627,
'recurring_invoice_id' => '',
'invoiced_estimate_id' => '',
'salesperson_name' => '',
'custom_fields' => array(),
'line_items' => array(
array(
'item_id'=>'198938000000021015',
'project_id'=>'',
'expense_id'=>'',
'salesorder_item_id'=>'',
'name'=>'GATE-IN',
'description'=>'',
//'item_order'=>0,
'rate'=>241.25,
'unit'=>'CONTAINER',
'quantity'=>2.0,
'discount'=>'0%',
'tax_id'=>'198938000000023286'
)
),
'payment_options' => array('payment_gateways' => array()),
'allow_partial_payments' => false,
'custom_body' => '',
'custom_subject' => '',
'notes' => 'T.C. $ 9,65',
'terms' => '',
'shipping_charge' => 0.0,
'adjustment' => 0.0,
'adjustment_description' => 'Ajuste'
);
$jsonInvoice = json_encode($invoice);
$data = array(
'authtoken' => '[Auth Token]',