Create a new Deal
curl --request POST \
--url https://commerce.driv.ly/api/deals \
--header 'Content-Type: application/json' \
--data '
{
"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"
]
}
}
'import requests
url = "https://commerce.driv.ly/api/deals"
payload = {
"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"]
}
}
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({
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']
}
})
};
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([
'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'
]
]
]),
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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"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"
]
}
},
"success": true
}{
"error": {
"code": 400,
"message": "Missing Required Information"
},
"success": false
}{
"error": {
"code": 401,
"message": "Unauthorized"
},
"success": false
}{
"error": {
"code": 429,
"message": "Too Many Requests"
},
"success": false
}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 '
{
"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"
]
}
}
'import requests
url = "https://commerce.driv.ly/api/deals"
payload = {
"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"]
}
}
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({
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']
}
})
};
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([
'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'
]
]
]),
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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\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 \"id\": \"deal_5ksj49dkvdl2\",\n \"dealer\": {\n \"location\": {\n \"id\": \"loc_8dj39dksm2d9\",\n \"zip\": \"90210\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Suite 100\",\n \"line1\": \"456 Dealership Blvd\",\n \"latitude\": 34.0522,\n \"longitude\": -118.2437\n }\n },\n \"vehicle\": {\n \"id\": \"veh_3k12j9qksdf0\",\n \"vin\": \"1C4HJXEN5MW592818\",\n \"year\": 2021,\n \"make\": \"Jeep\",\n \"trim\": \"Sport\",\n \"spec\": \"Off-Road Package\",\n \"model\": \"Wrangler\",\n \"engine\": \"3.6L V6\",\n \"seatCount\": 5,\n \"doorCount\": 4,\n \"bodyStyle\": \"SUV\",\n \"drivetrain\": \"4WD\",\n \"transmission\": \"Automatic\",\n \"interiorColor\": \"Black\",\n \"exteriorColor\": \"Red\"\n },\n \"customer\": {\n \"id\": \"cus_9kd39fkj4l5d\",\n \"addresses\": [\n {\n \"id\": \"adr_9fdk39dkc9d3\",\n \"city\": {\n \"name\": \"New City\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"zip\": \"90212\",\n \"line2\": \"Apt 202\",\n \"line1\": \"987 New Address Blvd\"\n }\n ],\n \"phoneNumbers\": [\n \"555-456-7890\"\n ]\n },\n \"facilitator\": {\n \"id\": \"fac_6dj39dk3kdl3\",\n \"name\": \"AutoFacilitators Inc.\",\n \"location\": {\n \"id\": \"loc_2kj49d1msod2\",\n \"zip\": \"90310\",\n \"city\": {\n \"name\": \"Uptown\",\n \"state\": {\n \"code\": \"CA\"\n }\n },\n \"line2\": \"Floor 3\",\n \"line1\": \"789 Facilitator Road\"\n }\n },\n \"maximumBidPrice\": 50000,\n \"currentBidPrice\": 45000,\n \"minimumBidPrice\": 30000,\n \"coBuyerOrCoSellerCustomer\": {\n \"id\": \"cus_k3j5s9qj3w0d\",\n \"addresses\": [\n {\n \"id\": \"adr_4kj6s9qj3w0d\",\n \"city\": {\n \"name\": \"Anytown\",\n \"state\": {\n \"code\": \"NY\"\n }\n },\n \"zip\": \"10001\",\n \"line2\": \"\",\n \"line1\": \"123 Customer St\"\n }\n ],\n \"phoneNumbers\": [\n \"555-987-6543\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"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"
]
}
},
"success": true
}{
"error": {
"code": 400,
"message": "Missing Required Information"
},
"success": false
}{
"error": {
"code": 401,
"message": "Unauthorized"
},
"success": false
}{
"error": {
"code": 429,
"message": "Too Many Requests"
},
"success": false
}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"] } }