Update Dealer
curl --request PATCH \
--url https://api.autosnap.com/v1/dealers/{dealership_id} \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"inventory_type": "<string>"
}
'import requests
url = "https://api.autosnap.com/v1/dealers/{dealership_id}"
payload = {
"api_key": "<string>",
"inventory_type": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_key: '<string>', inventory_type: '<string>'})
};
fetch('https://api.autosnap.com/v1/dealers/{dealership_id}', 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.autosnap.com/v1/dealers/{dealership_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'inventory_type' => '<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://api.autosnap.com/v1/dealers/{dealership_id}"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.autosnap.com/v1/dealers/{dealership_id}")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autosnap.com/v1/dealers/{dealership_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Dealers
Update Dealer
Update a dealership’s inventory type filter.
PATCH
/
v1
/
dealers
/
{dealership_id}
Update Dealer
curl --request PATCH \
--url https://api.autosnap.com/v1/dealers/{dealership_id} \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "<string>",
"inventory_type": "<string>"
}
'import requests
url = "https://api.autosnap.com/v1/dealers/{dealership_id}"
payload = {
"api_key": "<string>",
"inventory_type": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_key: '<string>', inventory_type: '<string>'})
};
fetch('https://api.autosnap.com/v1/dealers/{dealership_id}', 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.autosnap.com/v1/dealers/{dealership_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => '<string>',
'inventory_type' => '<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://api.autosnap.com/v1/dealers/{dealership_id}"
payload := strings.NewReader("{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.autosnap.com/v1/dealers/{dealership_id}")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.autosnap.com/v1/dealers/{dealership_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"<string>\",\n \"inventory_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}PATCH /v1/dealers/{dealership_id}
v1.0 schema lock. The response shape on this page is the locked v1.0 contract. We will never remove a documented field, never rename a field, and never change a field’s type without bumping to v2 (see Versioning). New fields may be added additively; your client must tolerate unknown keys.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
dealership_id | string | path | Yes | The dealership’s public ID (e.g. dlr_8cfc0b00a98b) |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string | Yes | Your API key |
inventory_type | string | No | Filter which vehicles are imported. One of: new, used, all |
Inventory Type Values
| Value | Description |
|---|---|
all | Import both new and used vehicles |
new | Import new vehicles only |
used | Import used vehicles only |
Example
curl -X PATCH "https://api.autosnap.com/v1/dealers/dlr_8cfc0b00a98b" \
-H "Content-Type: application/json" \
-d '{
"api_key": "YOUR_API_KEY",
"inventory_type": "all"
}'
Response
{
"success": true,
"dealership_id": "dlr_8cfc0b00a98b",
"updated": [
"inventory_type=all"
]
}
Errors
| Status | Description |
|---|---|
| 400 | Invalid inventory_type value, or no updatable fields provided |
| 404 | Dealership not found or not subscribed under your account |
⌘I