SÍGUENOS EN

TELÉFONO

+56222111959
+56930984718

DIRECCIÓN

Av. Las Condes 7821,
Las Condes.

HORARIO

Lunes a Viernes
11:00 a 19:00 hrs.
Sábado
11:00 a 17:00 hr.s

< ?php $url=’https://api.bsale.cl/v1/documents.json’; $access_token=’tuTokedeAcceso’; $estructura_json = array ( ‘documentTypeId’ => ‘1’,
‘officeId’ => ‘1’,
’emissionDate’ => 1462527931,
‘details’ =>
array (
0 =>
array (
‘netUnitValue’ => 10916,
‘quantity’ => 1,
‘taxes’ =>
array (
0 =>
array (
‘code’ => 14,
‘percentage’ => 19,
),
),
‘comment’ => ‘el nombre del producto que voy a vender’,
),
),
);
$data = json_encode($estructura_json);
$session = curl_init($url);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, true);
$headers = array(
‘access_token: ‘ . $access_token,
‘Accept: application/json’,
‘Content-Type: application/json’
);
curl_setopt($session, CURLOPT_HTTPHEADER, $headers);
curl_setopt($session, CURLOPT_POST, true);
curl_setopt($session, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($session);
$code = curl_getinfo($session, CURLINFO_HTTP_CODE);
curl_close($session);
print_r($response);
?>