Add a new Trade
curl --request POST \
--url https://commerce.driv.ly/api/trades \
--header 'Content-Type: application/json' \
--data '
{
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/trades"
payload = {
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer: '<string>',
vehicle: '<string>',
netAllowance: 123,
grossAllowance: 123,
odometer: 1,
creditApp: '<string>',
deal: '<string>'
})
};
fetch('https://commerce.driv.ly/api/trades', 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://commerce.driv.ly/api/trades",
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([
'customer' => '<string>',
'vehicle' => '<string>',
'netAllowance' => 123,
'grossAllowance' => 123,
'odometer' => 1,
'creditApp' => '<string>',
'deal' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://commerce.driv.ly/api/trades"
payload := strings.NewReader("{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://commerce.driv.ly/api/trades")
.header("Content-Type", "application/json")
.body("{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}Trades
Add a new Trade
POST
/
trades
Add a new Trade
curl --request POST \
--url https://commerce.driv.ly/api/trades \
--header 'Content-Type: application/json' \
--data '
{
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/trades"
payload = {
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
customer: '<string>',
vehicle: '<string>',
netAllowance: 123,
grossAllowance: 123,
odometer: 1,
creditApp: '<string>',
deal: '<string>'
})
};
fetch('https://commerce.driv.ly/api/trades', 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://commerce.driv.ly/api/trades",
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([
'customer' => '<string>',
'vehicle' => '<string>',
'netAllowance' => 123,
'grossAllowance' => 123,
'odometer' => 1,
'creditApp' => '<string>',
'deal' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://commerce.driv.ly/api/trades"
payload := strings.NewReader("{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://commerce.driv.ly/api/trades")
.header("Content-Type", "application/json")
.body("{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"customer\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"netAllowance\": 123,\n \"grossAllowance\": 123,\n \"odometer\": 1,\n \"creditApp\": \"<string>\",\n \"deal\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"customer": "<string>",
"vehicle": "<string>",
"netAllowance": 123,
"grossAllowance": 123,
"odometer": 1,
"creditApp": "<string>",
"deal": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}Query Parameters
The number of levels of related objects to include in the response
Body
application/json
Customer offers Vehicle for trade
Trade is uniquely identified by Customer
Trade is uniquely identified by Vehicle
Trade provides Net Allowance
Must be a multiple of
0.01Trade provides Gross Allowance
Must be a multiple of
0.01Odometer is read for Trade
Required range:
x >= 0Credit App has Trade
Trade provides assets for Deal
Response
Trade Added
Customer offers Vehicle for trade
Show child attributes
Show child attributes
Example:
{
"deal": "dea_1a2b3c4d5e6f",
"vehicle": {
"id": "veh_3k12j9qksdf0",
"vin": "1C4HJXEN5MW592818",
"year": 2021,
"make": "Jeep",
"trim": "Sport",
"spec": "Off-Road Package",
"model": "Wrangler",
"engine": "3.6L V6",
"seatCount": 5,
"doorCount": 4,
"bodyStyle": "SUV",
"drivetrain": "4WD",
"transmission": "Automatic",
"interiorColor": "Black",
"exteriorColor": "Red"
},
"customer": {
"id": "cus_k3j5s9qj3w0d",
"addresses": ["123 Main St, Anytown, USA"],
"phoneNumbers": ["555-123-4567"]
},
"odometer": 15000,
"creditApp": "cre_5j6k7l8m9n0o",
"netAllowance": 25000,
"grossAllowance": 26000
}
⌘I