const url = new URL(
"{BASE_URI}/api/billing-ar/sale-invoices"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"customer_id":null,
"afip_receipt":6,
"sale_point": 1,
"concept":2,
"mon_id": "DOL",
"mon_exchange_rate": 710.50,
"reference":"REF123456",
"ref_external":"AR9653533",
"create_receipt": true,
"validated": false,
"payment_method_code": "cash",
"customer": {
"name":"Juan Pedro Montaña",
"brand":"",
"external_code":"",
"email":"juanpedro@domain.com",
"phone":"",
"legal_form_code":"6",
"document_type_code":"80",
"document_number":"12345678",
"address":{
"country_code_iso":"AR",
"province_code_iso":"B",
"street_name":"Calle falsa",
"street_number":"345",
"building_floor":"8",
"building_room":"A",
"note":"Golpear 2 veces.",
"zip_code":"1406",
"city":"Floresta",
"longitude":"",
"latitude":""
}
},
"items":
[
{
"description":"IVA Aduanero",
"price":100,
"iva_price":0,
"iva_percent":0,
"total_price":100,
"count":1
},
{
"description":"Tasa estadíastica",
"price":45,
"iva_price":0,
"iva_percent":0,
"total_price":45,
"count":2
}
],
"taxes":[]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());