Crear nuevo accesorio
curl --request POST \
--url https://api.raul.ugps.io/api/v1/accessory/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Botón de Pánico",
"description": "Botón de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"requiresInstallation": true,
"currencyId": 1,
"isActive": true,
"isUniversal": false,
"gpsModelIds": [
1,
2,
3
]
}
'import requests
url = "https://api.raul.ugps.io/api/v1/accessory/create"
payload = {
"name": "Botón de Pánico",
"description": "Botón de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"requiresInstallation": True,
"currencyId": 1,
"isActive": True,
"isUniversal": False,
"gpsModelIds": [1, 2, 3]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Botón de Pánico',
description: 'Botón de emergencia para activar alerta',
salePrice: 0.5,
monthlyRent: 0.1,
installationCost: 0.25,
requiresInstallation: true,
currencyId: 1,
isActive: true,
isUniversal: false,
gpsModelIds: [1, 2, 3]
})
};
fetch('https://api.raul.ugps.io/api/v1/accessory/create', 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/accessory/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Botón de Pánico',
'description' => 'Botón de emergencia para activar alerta',
'salePrice' => 0.5,
'monthlyRent' => 0.1,
'installationCost' => 0.25,
'requiresInstallation' => true,
'currencyId' => 1,
'isActive' => true,
'isUniversal' => false,
'gpsModelIds' => [
1,
2,
3
]
]),
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/accessory/create"
payload := strings.NewReader("{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.raul.ugps.io/api/v1/accessory/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/accessory/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"accessoryId": 1,
"name": "Boton de Panico",
"requiresInstallation": true,
"isActive": true,
"isUniversal": false,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"description": "Boton de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"currencyId": 1,
"currencyName": "UF",
"gpsModelIds": [
1,
2,
3
]
}Accessories
Crear nuevo accesorio
Operacion: Crear nuevo accesorio.
POST
/
api
/
v1
/
accessory
/
create
Crear nuevo accesorio
curl --request POST \
--url https://api.raul.ugps.io/api/v1/accessory/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Botón de Pánico",
"description": "Botón de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"requiresInstallation": true,
"currencyId": 1,
"isActive": true,
"isUniversal": false,
"gpsModelIds": [
1,
2,
3
]
}
'import requests
url = "https://api.raul.ugps.io/api/v1/accessory/create"
payload = {
"name": "Botón de Pánico",
"description": "Botón de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"requiresInstallation": True,
"currencyId": 1,
"isActive": True,
"isUniversal": False,
"gpsModelIds": [1, 2, 3]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Botón de Pánico',
description: 'Botón de emergencia para activar alerta',
salePrice: 0.5,
monthlyRent: 0.1,
installationCost: 0.25,
requiresInstallation: true,
currencyId: 1,
isActive: true,
isUniversal: false,
gpsModelIds: [1, 2, 3]
})
};
fetch('https://api.raul.ugps.io/api/v1/accessory/create', 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/accessory/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Botón de Pánico',
'description' => 'Botón de emergencia para activar alerta',
'salePrice' => 0.5,
'monthlyRent' => 0.1,
'installationCost' => 0.25,
'requiresInstallation' => true,
'currencyId' => 1,
'isActive' => true,
'isUniversal' => false,
'gpsModelIds' => [
1,
2,
3
]
]),
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/accessory/create"
payload := strings.NewReader("{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.raul.ugps.io/api/v1/accessory/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.raul.ugps.io/api/v1/accessory/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Botón de Pánico\",\n \"description\": \"Botón de emergencia para activar alerta\",\n \"salePrice\": 0.5,\n \"monthlyRent\": 0.1,\n \"installationCost\": 0.25,\n \"requiresInstallation\": true,\n \"currencyId\": 1,\n \"isActive\": true,\n \"isUniversal\": false,\n \"gpsModelIds\": [\n 1,\n 2,\n 3\n ]\n}"
response = http.request(request)
puts response.read_body{
"accessoryId": 1,
"name": "Boton de Panico",
"requiresInstallation": true,
"isActive": true,
"isUniversal": false,
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z",
"description": "Boton de emergencia para activar alerta",
"salePrice": 0.5,
"monthlyRent": 0.1,
"installationCost": 0.25,
"currencyId": 1,
"currencyName": "UF",
"gpsModelIds": [
1,
2,
3
]
}Authorizations
Token de sesión Better Auth para rutas de backoffice; las rutas de portal usan su token propio.
Body
application/json
Nombre del accesorio
Maximum string length:
255Example:
"Botón de Pánico"
Descripción del accesorio
Maximum string length:
500Example:
"Botón de emergencia para activar alerta"
Precio de venta
Example:
0.5
Renta mensual del accesorio
Example:
0.1
Costo de instalación
Example:
0.25
Indica si requiere instalación
Example:
true
ID de la moneda (1=UF por defecto)
Example:
1
Estado activo/inactivo del accesorio
Example:
true
Indica si es un accesorio universal (compatible con todos los GPS)
Example:
false
IDs de los modelos GPS compatibles
Example:
[1, 2, 3]
Response
201 - application/json
Accesorio creado exitosamente
Example:
1
Example:
"Boton de Panico"
Example:
true
Example:
true
Example:
false
Example:
"2025-01-15T10:30:00.000Z"
Example:
"2025-01-15T10:30:00.000Z"
Example:
"Boton de emergencia para activar alerta"
Example:
0.5
Example:
0.1
Example:
0.25
Example:
1
Example:
"UF"
Example:
[1, 2, 3]