curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/billing/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"receiver_rut": "<string>",
"receiver_address": "<string>",
"receiver_ciudad": "<string>",
"receiver_comuna": "<string>",
"receiver_giro": "<string>",
"payment_terms_days": 10,
"concept": "<string>",
"internal_notes": "<string>",
"public_notes": "<string>",
"dte_type": "<string>",
"billing_client_id": "<string>",
"receiver_name": "<string>",
"receiver_email": "<string>",
"issue_date": "<string>",
"due_date": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 1,
"unit_price": 123,
"discount_pct": 0,
"unit_price_uf": 123,
"source_type": "<string>",
"source_id": "<string>",
"position": 0
}
],
"tax_amount_override": {},
"total_amount_override": {}
}
'import requests
url = "https://api.raul.ugps.io/api/v1/billing/invoices/{id}"
payload = {
"receiver_rut": "<string>",
"receiver_address": "<string>",
"receiver_ciudad": "<string>",
"receiver_comuna": "<string>",
"receiver_giro": "<string>",
"payment_terms_days": 10,
"concept": "<string>",
"internal_notes": "<string>",
"public_notes": "<string>",
"dte_type": "<string>",
"billing_client_id": "<string>",
"receiver_name": "<string>",
"receiver_email": "<string>",
"issue_date": "<string>",
"due_date": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 1,
"unit_price": 123,
"discount_pct": 0,
"unit_price_uf": 123,
"source_type": "<string>",
"source_id": "<string>",
"position": 0
}
],
"tax_amount_override": {},
"total_amount_override": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
receiver_rut: '<string>',
receiver_address: '<string>',
receiver_ciudad: '<string>',
receiver_comuna: '<string>',
receiver_giro: '<string>',
payment_terms_days: 10,
concept: '<string>',
internal_notes: '<string>',
public_notes: '<string>',
dte_type: '<string>',
billing_client_id: '<string>',
receiver_name: '<string>',
receiver_email: '<string>',
issue_date: '<string>',
due_date: '<string>',
line_items: [
{
description: '<string>',
quantity: 1,
unit_price: 123,
discount_pct: 0,
unit_price_uf: 123,
source_type: '<string>',
source_id: '<string>',
position: 0
}
],
tax_amount_override: {},
total_amount_override: {}
})
};
fetch('https://api.raul.ugps.io/api/v1/billing/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.raul.ugps.io/api/v1/billing/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'receiver_rut' => '<string>',
'receiver_address' => '<string>',
'receiver_ciudad' => '<string>',
'receiver_comuna' => '<string>',
'receiver_giro' => '<string>',
'payment_terms_days' => 10,
'concept' => '<string>',
'internal_notes' => '<string>',
'public_notes' => '<string>',
'dte_type' => '<string>',
'billing_client_id' => '<string>',
'receiver_name' => '<string>',
'receiver_email' => '<string>',
'issue_date' => '<string>',
'due_date' => '<string>',
'line_items' => [
[
'description' => '<string>',
'quantity' => 1,
'unit_price' => 123,
'discount_pct' => 0,
'unit_price_uf' => 123,
'source_type' => '<string>',
'source_id' => '<string>',
'position' => 0
]
],
'tax_amount_override' => [
],
'total_amount_override' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.raul.ugps.io/api/v1/billing/invoices/{id}"
payload := strings.NewReader("{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.raul.ugps.io/api/v1/billing/invoices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/billing/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"receiver_name": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"subtotal": 123,
"discount_total": 123,
"net_amount": 123,
"tax_rate": 123,
"tax_amount": 123,
"total_amount": 123,
"amount_paid": 123,
"client_credit_balance": 123,
"payment_terms_days": 123,
"invoice_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_id": {},
"receiver_rut": {},
"receiver_email": {},
"receiver_address": {},
"receiver_ciudad": {},
"receiver_comuna": {},
"receiver_giro": {},
"tax_amount_override": {},
"total_amount_override": {},
"uf_value_at_creation": {},
"folio_prefix": {},
"folio_number": {},
"internal_notes": {},
"public_notes": {},
"concept": {},
"periodo": {},
"credit_note_for_id": {},
"credit_note_reason": {},
"factura_id": {},
"parent_client_id": {},
"billing_client_id": {},
"oc_number": {},
"hes_number": {},
"requires_oc": true,
"requires_hes": true,
"detail_xlsx_url": {},
"last_dte_error": {},
"dte_retry_count": 123,
"dte_local_status": {},
"sii_status_detail": {},
"created_by": {},
"deleted_at": {}
}Actualizar factura (solo en estado DRAFT)
Operacion: Actualizar factura (solo en estado DRAFT).
curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/billing/invoices/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"receiver_rut": "<string>",
"receiver_address": "<string>",
"receiver_ciudad": "<string>",
"receiver_comuna": "<string>",
"receiver_giro": "<string>",
"payment_terms_days": 10,
"concept": "<string>",
"internal_notes": "<string>",
"public_notes": "<string>",
"dte_type": "<string>",
"billing_client_id": "<string>",
"receiver_name": "<string>",
"receiver_email": "<string>",
"issue_date": "<string>",
"due_date": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 1,
"unit_price": 123,
"discount_pct": 0,
"unit_price_uf": 123,
"source_type": "<string>",
"source_id": "<string>",
"position": 0
}
],
"tax_amount_override": {},
"total_amount_override": {}
}
'import requests
url = "https://api.raul.ugps.io/api/v1/billing/invoices/{id}"
payload = {
"receiver_rut": "<string>",
"receiver_address": "<string>",
"receiver_ciudad": "<string>",
"receiver_comuna": "<string>",
"receiver_giro": "<string>",
"payment_terms_days": 10,
"concept": "<string>",
"internal_notes": "<string>",
"public_notes": "<string>",
"dte_type": "<string>",
"billing_client_id": "<string>",
"receiver_name": "<string>",
"receiver_email": "<string>",
"issue_date": "<string>",
"due_date": "<string>",
"line_items": [
{
"description": "<string>",
"quantity": 1,
"unit_price": 123,
"discount_pct": 0,
"unit_price_uf": 123,
"source_type": "<string>",
"source_id": "<string>",
"position": 0
}
],
"tax_amount_override": {},
"total_amount_override": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
receiver_rut: '<string>',
receiver_address: '<string>',
receiver_ciudad: '<string>',
receiver_comuna: '<string>',
receiver_giro: '<string>',
payment_terms_days: 10,
concept: '<string>',
internal_notes: '<string>',
public_notes: '<string>',
dte_type: '<string>',
billing_client_id: '<string>',
receiver_name: '<string>',
receiver_email: '<string>',
issue_date: '<string>',
due_date: '<string>',
line_items: [
{
description: '<string>',
quantity: 1,
unit_price: 123,
discount_pct: 0,
unit_price_uf: 123,
source_type: '<string>',
source_id: '<string>',
position: 0
}
],
tax_amount_override: {},
total_amount_override: {}
})
};
fetch('https://api.raul.ugps.io/api/v1/billing/invoices/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.raul.ugps.io/api/v1/billing/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'receiver_rut' => '<string>',
'receiver_address' => '<string>',
'receiver_ciudad' => '<string>',
'receiver_comuna' => '<string>',
'receiver_giro' => '<string>',
'payment_terms_days' => 10,
'concept' => '<string>',
'internal_notes' => '<string>',
'public_notes' => '<string>',
'dte_type' => '<string>',
'billing_client_id' => '<string>',
'receiver_name' => '<string>',
'receiver_email' => '<string>',
'issue_date' => '<string>',
'due_date' => '<string>',
'line_items' => [
[
'description' => '<string>',
'quantity' => 1,
'unit_price' => 123,
'discount_pct' => 0,
'unit_price_uf' => 123,
'source_type' => '<string>',
'source_id' => '<string>',
'position' => 0
]
],
'tax_amount_override' => [
],
'total_amount_override' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.raul.ugps.io/api/v1/billing/invoices/{id}"
payload := strings.NewReader("{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.raul.ugps.io/api/v1/billing/invoices/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/billing/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"receiver_rut\": \"<string>\",\n \"receiver_address\": \"<string>\",\n \"receiver_ciudad\": \"<string>\",\n \"receiver_comuna\": \"<string>\",\n \"receiver_giro\": \"<string>\",\n \"payment_terms_days\": 10,\n \"concept\": \"<string>\",\n \"internal_notes\": \"<string>\",\n \"public_notes\": \"<string>\",\n \"dte_type\": \"<string>\",\n \"billing_client_id\": \"<string>\",\n \"receiver_name\": \"<string>\",\n \"receiver_email\": \"<string>\",\n \"issue_date\": \"<string>\",\n \"due_date\": \"<string>\",\n \"line_items\": [\n {\n \"description\": \"<string>\",\n \"quantity\": 1,\n \"unit_price\": 123,\n \"discount_pct\": 0,\n \"unit_price_uf\": 123,\n \"source_type\": \"<string>\",\n \"source_id\": \"<string>\",\n \"position\": 0\n }\n ],\n \"tax_amount_override\": {},\n \"total_amount_override\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"status": "<string>",
"receiver_name": "<string>",
"issue_date": "2023-11-07T05:31:56Z",
"due_date": "2023-11-07T05:31:56Z",
"subtotal": 123,
"discount_total": 123,
"net_amount": 123,
"tax_rate": 123,
"tax_amount": 123,
"total_amount": 123,
"amount_paid": 123,
"client_credit_balance": 123,
"payment_terms_days": 123,
"invoice_type": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"client_id": {},
"receiver_rut": {},
"receiver_email": {},
"receiver_address": {},
"receiver_ciudad": {},
"receiver_comuna": {},
"receiver_giro": {},
"tax_amount_override": {},
"total_amount_override": {},
"uf_value_at_creation": {},
"folio_prefix": {},
"folio_number": {},
"internal_notes": {},
"public_notes": {},
"concept": {},
"periodo": {},
"credit_note_for_id": {},
"credit_note_reason": {},
"factura_id": {},
"parent_client_id": {},
"billing_client_id": {},
"oc_number": {},
"hes_number": {},
"requires_oc": true,
"requires_hes": true,
"detail_xlsx_url": {},
"last_dte_error": {},
"dte_retry_count": 123,
"dte_local_status": {},
"sii_status_detail": {},
"created_by": {},
"deleted_at": {}
}Authorizations
Token de sesión Better Auth para rutas de backoffice; las rutas de portal usan su token propio.
Path Parameters
UUID de la factura
Body
RUT del receptor
Dirección del receptor
Ciudad del receptor
Comuna del receptor
Giro del receptor
Días de plazo de pago
Concepto / descripción general
Notas internas
Notas públicas
Tipo de documento DTE: FACTURA o BOLETA
UUID de la empresa legal receptora. Solo se puede modificar en borradores.
Nombre del receptor
Email del receptor
Fecha de emisión (YYYY-MM-DD)
Fecha de vencimiento (YYYY-MM-DD)
Líneas de detalle (reemplaza todas las existentes). Omitir para no modificar.
Show child attributes
Show child attributes
Override manual del monto de IVA (CLP). Usar cuando la OC usa redondeo distinto al estándar. Enviar null para borrar.
Override manual del monto total (CLP). Usar cuando la OC usa redondeo distinto al estándar. Enviar null para borrar.
Response
Saldo a favor disponible del cliente desde sobrepagos de otras facturas
local_status del DTE más reciente (estado del XML ante el SII)
Detalle libre devuelto por el SII para el DTE más reciente