Actualizar OC/HES de una factura
curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"oc_number": "<string>",
"hes_number": "<string>"
}
'import requests
url = "https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes"
payload = {
"oc_number": "<string>",
"hes_number": "<string>"
}
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({oc_number: '<string>', hes_number: '<string>'})
};
fetch('https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes', 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}/oc-hes",
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([
'oc_number' => '<string>',
'hes_number' => '<string>'
]),
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}/oc-hes"
payload := strings.NewReader("{\n \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\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}/oc-hes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes")
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 \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\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": {}
}Invoices
Actualizar OC/HES de una factura
Operacion: Actualizar OC/HES de una factura.
PATCH
/
api
/
v1
/
billing
/
invoices
/
{id}
/
oc-hes
Actualizar OC/HES de una factura
curl --request PATCH \
--url https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"oc_number": "<string>",
"hes_number": "<string>"
}
'import requests
url = "https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes"
payload = {
"oc_number": "<string>",
"hes_number": "<string>"
}
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({oc_number: '<string>', hes_number: '<string>'})
};
fetch('https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes', 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}/oc-hes",
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([
'oc_number' => '<string>',
'hes_number' => '<string>'
]),
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}/oc-hes"
payload := strings.NewReader("{\n \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\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}/oc-hes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/billing/invoices/{id}/oc-hes")
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 \"oc_number\": \"<string>\",\n \"hes_number\": \"<string>\"\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
Response
200 - application/json
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