Create a new Deal
curl --request POST \
--url https://commerce.driv.ly/api/deals \
--header 'Content-Type: application/json' \
--data '
{
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/deals"
payload = {
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<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({
vehicle: '<string>',
customer: '<string>',
id: '<string>',
maximumBidPrice: 123,
dealer: '<string>',
currentBidPrice: 123,
minimumBidPrice: 123,
facilitator: '<string>',
coBuyerOrCoSellerCustomer: '<string>'
})
};
fetch('https://commerce.driv.ly/api/deals', 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/deals",
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([
'vehicle' => '<string>',
'customer' => '<string>',
'id' => '<string>',
'maximumBidPrice' => 123,
'dealer' => '<string>',
'currentBidPrice' => 123,
'minimumBidPrice' => 123,
'facilitator' => '<string>',
'coBuyerOrCoSellerCustomer' => '<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/deals"
payload := strings.NewReader("{\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<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/deals")
.header("Content-Type", "application/json")
.body("{\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/deals")
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 \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}{
"error": {
"code": 123,
"message": "<string>"
},
"success": true
}Deals
Create a new Deal
POST
/
deals
Create a new Deal
curl --request POST \
--url https://commerce.driv.ly/api/deals \
--header 'Content-Type: application/json' \
--data '
{
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/deals"
payload = {
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<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({
vehicle: '<string>',
customer: '<string>',
id: '<string>',
maximumBidPrice: 123,
dealer: '<string>',
currentBidPrice: 123,
minimumBidPrice: 123,
facilitator: '<string>',
coBuyerOrCoSellerCustomer: '<string>'
})
};
fetch('https://commerce.driv.ly/api/deals', 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/deals",
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([
'vehicle' => '<string>',
'customer' => '<string>',
'id' => '<string>',
'maximumBidPrice' => 123,
'dealer' => '<string>',
'currentBidPrice' => 123,
'minimumBidPrice' => 123,
'facilitator' => '<string>',
'coBuyerOrCoSellerCustomer' => '<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/deals"
payload := strings.NewReader("{\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<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/deals")
.header("Content-Type", "application/json")
.body("{\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/deals")
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 \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"maximumBidPrice\": 123,\n \"dealer\": \"<string>\",\n \"currentBidPrice\": 123,\n \"minimumBidPrice\": 123,\n \"facilitator\": \"<string>\",\n \"coBuyerOrCoSellerCustomer\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"maximumBidPrice": 123,
"dealer": "<string>",
"currentBidPrice": 123,
"minimumBidPrice": 123,
"facilitator": "<string>",
"coBuyerOrCoSellerCustomer": "<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
Deal buys/sells Vehicle
Deal is made with Customer
Deal is uniquely identified by id
Deal has Maximum Bid Price
Deal sells from Dealer
Deal has Current Bid Price
Deal has Minimum Bid Price
Deal is facilitated by Facilitator
Deal has CoBuyer Or CoSeller Customer
Response
Deal Created
Show child attributes
Show child attributes
Example:
{
"id": "deal_5ksj49dkvdl2",
"dealer": {
"location": {
"id": "loc_8dj39dksm2d9",
"zip": "90210",
"city": {
"name": "Anytown",
"state": { "code": "CA" }
},
"line2": "Suite 100",
"line1": "456 Dealership Blvd",
"latitude": 34.0522,
"longitude": -118.2437
}
},
"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_9kd39fkj4l5d",
"addresses": [
{
"id": "adr_9fdk39dkc9d3",
"city": {
"name": "New City",
"state": { "code": "CA" }
},
"zip": "90212",
"line2": "Apt 202",
"line1": "987 New Address Blvd"
}
],
"phoneNumbers": ["555-456-7890"]
},
"facilitator": {
"id": "fac_6dj39dk3kdl3",
"name": "AutoFacilitators Inc.",
"location": {
"id": "loc_2kj49d1msod2",
"zip": "90310",
"city": {
"name": "Uptown",
"state": { "code": "CA" }
},
"line2": "Floor 3",
"line1": "789 Facilitator Road"
}
},
"maximumBidPrice": 50000,
"currentBidPrice": 45000,
"minimumBidPrice": 30000,
"coBuyerOrCoSellerCustomer": {
"id": "cus_k3j5s9qj3w0d",
"addresses": [
{
"id": "adr_4kj6s9qj3w0d",
"city": {
"name": "Anytown",
"state": { "code": "NY" }
},
"zip": "10001",
"line2": "",
"line1": "123 Customer St"
}
],
"phoneNumbers": ["555-987-6543"]
}
}
⌘I