Skip to main content
POST
/
api
/
v1
/
visit_cost
Create a new visit cost
curl --request POST \
  --url https://api.raul.ugps.io/api/v1/visit_cost \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "visit_detail_id": "<string>",
  "technician_cost": 123,
  "cost_per_km_technician": 123,
  "km_traveled": 123,
  "tolls": 123,
  "cost_km_per_km_traveled": 123,
  "additional_cost": 123,
  "cost_type_id": 123,
  "technician_cost_status": true,
  "client_cost_status": true,
  "client_cost": 123,
  "cost_per_km_client": 123,
  "km_traveled_client": 123,
  "client_currency": 123,
  "technician_currency": 123,
  "technician_payed": true
}
'
import requests

url = "https://api.raul.ugps.io/api/v1/visit_cost"

payload = {
"visit_detail_id": "<string>",
"technician_cost": 123,
"cost_per_km_technician": 123,
"km_traveled": 123,
"tolls": 123,
"cost_km_per_km_traveled": 123,
"additional_cost": 123,
"cost_type_id": 123,
"technician_cost_status": True,
"client_cost_status": True,
"client_cost": 123,
"cost_per_km_client": 123,
"km_traveled_client": 123,
"client_currency": 123,
"technician_currency": 123,
"technician_payed": True
}
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({
visit_detail_id: '<string>',
technician_cost: 123,
cost_per_km_technician: 123,
km_traveled: 123,
tolls: 123,
cost_km_per_km_traveled: 123,
additional_cost: 123,
cost_type_id: 123,
technician_cost_status: true,
client_cost_status: true,
client_cost: 123,
cost_per_km_client: 123,
km_traveled_client: 123,
client_currency: 123,
technician_currency: 123,
technician_payed: true
})
};

fetch('https://api.raul.ugps.io/api/v1/visit_cost', 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/visit_cost",
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([
'visit_detail_id' => '<string>',
'technician_cost' => 123,
'cost_per_km_technician' => 123,
'km_traveled' => 123,
'tolls' => 123,
'cost_km_per_km_traveled' => 123,
'additional_cost' => 123,
'cost_type_id' => 123,
'technician_cost_status' => true,
'client_cost_status' => true,
'client_cost' => 123,
'cost_per_km_client' => 123,
'km_traveled_client' => 123,
'client_currency' => 123,
'technician_currency' => 123,
'technician_payed' => true
]),
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/visit_cost"

payload := strings.NewReader("{\n \"visit_detail_id\": \"<string>\",\n \"technician_cost\": 123,\n \"cost_per_km_technician\": 123,\n \"km_traveled\": 123,\n \"tolls\": 123,\n \"cost_km_per_km_traveled\": 123,\n \"additional_cost\": 123,\n \"cost_type_id\": 123,\n \"technician_cost_status\": true,\n \"client_cost_status\": true,\n \"client_cost\": 123,\n \"cost_per_km_client\": 123,\n \"km_traveled_client\": 123,\n \"client_currency\": 123,\n \"technician_currency\": 123,\n \"technician_payed\": true\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/visit_cost")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"visit_detail_id\": \"<string>\",\n \"technician_cost\": 123,\n \"cost_per_km_technician\": 123,\n \"km_traveled\": 123,\n \"tolls\": 123,\n \"cost_km_per_km_traveled\": 123,\n \"additional_cost\": 123,\n \"cost_type_id\": 123,\n \"technician_cost_status\": true,\n \"client_cost_status\": true,\n \"client_cost\": 123,\n \"cost_per_km_client\": 123,\n \"km_traveled_client\": 123,\n \"client_currency\": 123,\n \"technician_currency\": 123,\n \"technician_payed\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.raul.ugps.io/api/v1/visit_cost")

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 \"visit_detail_id\": \"<string>\",\n \"technician_cost\": 123,\n \"cost_per_km_technician\": 123,\n \"km_traveled\": 123,\n \"tolls\": 123,\n \"cost_km_per_km_traveled\": 123,\n \"additional_cost\": 123,\n \"cost_type_id\": 123,\n \"technician_cost_status\": true,\n \"client_cost_status\": true,\n \"client_cost\": 123,\n \"cost_per_km_client\": 123,\n \"km_traveled_client\": 123,\n \"client_currency\": 123,\n \"technician_currency\": 123,\n \"technician_payed\": true\n}"

response = http.request(request)
puts response.read_body
{
  "visit_cost_id": 123,
  "visit_detail_id": "<string>",
  "technician_cost": {},
  "cost_per_km_technician": {},
  "km_traveled": {},
  "tolls": {},
  "cost_km_per_km_traveled": {},
  "additional_cost": {},
  "cost_type_id": {},
  "technician_cost_status": {},
  "client_cost_status": {},
  "client_cost": {},
  "cost_per_km_client": {},
  "km_traveled_client": {},
  "client_currency": {},
  "technician_currency": {},
  "technician_payed": {}
}

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

application/json
visit_detail_id
string
required

Visit detail ID

technician_cost
number

Technician cost

cost_per_km_technician
number

Cost per km for technician

km_traveled
number

Km traveled

tolls
number

Tolls

cost_km_per_km_traveled
number

Cost per km traveled

additional_cost
number

Additional cost

cost_type_id
number

Cost type ID

technician_cost_status
boolean

Technician cost status

client_cost_status
boolean

Client cost status

client_cost
number

Client cost

cost_per_km_client
number

Cost per km for client

km_traveled_client
number

Km traveled for client

client_currency
number

Client currency

technician_currency
number

Technician currency

technician_payed
boolean

Technician payed

Response

201 - application/json

Visit cost created

visit_cost_id
number
required

Visit cost ID

visit_detail_id
string
required

Visit detail ID

technician_cost
object

Technician cost

cost_per_km_technician
object

Cost per km for technician

km_traveled
object

Km traveled

tolls
object

Tolls

cost_km_per_km_traveled
object

Cost per km traveled

additional_cost
object

Additional cost

cost_type_id
object

Cost type ID

technician_cost_status
object

Technician cost status

client_cost_status
object

Client cost status

client_cost
object

Client cost

cost_per_km_client
object

Cost per km for client

km_traveled_client
object

Km traveled for client

client_currency
object

Client currency

technician_currency
object

Technician currency

technician_payed
object

Technician payed