Create a new Service
curl --request POST \
--url https://commerce.driv.ly/api/services \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<string>",
"deal": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/services"
payload = {
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<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({
provider: '<string>',
vehicle: '<string>',
customer: '<string>',
id: '<string>',
destinationAddress: '<string>',
destinationContact: '<string>',
destinationConsumer: '<string>',
originAddress: '<string>',
originContact: '<string>',
originConsumer: '<string>',
deal: '<string>'
})
};
fetch('https://commerce.driv.ly/api/services', 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/services",
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([
'provider' => '<string>',
'vehicle' => '<string>',
'customer' => '<string>',
'id' => '<string>',
'destinationAddress' => '<string>',
'destinationContact' => '<string>',
'destinationConsumer' => '<string>',
'originAddress' => '<string>',
'originContact' => '<string>',
'originConsumer' => '<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/services"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<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/services")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<string>\",\n \"deal\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/services")
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 \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<string>\",\n \"deal\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<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
}Services
Create a new Service
POST
/
services
Create a new Service
curl --request POST \
--url https://commerce.driv.ly/api/services \
--header 'Content-Type: application/json' \
--data '
{
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<string>",
"deal": "<string>"
}
'import requests
url = "https://commerce.driv.ly/api/services"
payload = {
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"id": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<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({
provider: '<string>',
vehicle: '<string>',
customer: '<string>',
id: '<string>',
destinationAddress: '<string>',
destinationContact: '<string>',
destinationConsumer: '<string>',
originAddress: '<string>',
originContact: '<string>',
originConsumer: '<string>',
deal: '<string>'
})
};
fetch('https://commerce.driv.ly/api/services', 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/services",
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([
'provider' => '<string>',
'vehicle' => '<string>',
'customer' => '<string>',
'id' => '<string>',
'destinationAddress' => '<string>',
'destinationContact' => '<string>',
'destinationConsumer' => '<string>',
'originAddress' => '<string>',
'originContact' => '<string>',
'originConsumer' => '<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/services"
payload := strings.NewReader("{\n \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<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/services")
.header("Content-Type", "application/json")
.body("{\n \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<string>\",\n \"deal\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://commerce.driv.ly/api/services")
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 \"provider\": \"<string>\",\n \"vehicle\": \"<string>\",\n \"customer\": \"<string>\",\n \"id\": \"<string>\",\n \"destinationAddress\": \"<string>\",\n \"destinationContact\": \"<string>\",\n \"destinationConsumer\": \"<string>\",\n \"originAddress\": \"<string>\",\n \"originContact\": \"<string>\",\n \"originConsumer\": \"<string>\",\n \"deal\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"provider": "<string>",
"vehicle": "<string>",
"customer": "<string>",
"destinationAddress": "<string>",
"destinationContact": "<string>",
"destinationConsumer": "<string>",
"originAddress": "<string>",
"originContact": "<string>",
"originConsumer": "<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
Service is from Service Provider
Service is performed on Vehicle
Service is sought by Customer
Service is uniquely identified by id
Service is to Destination Address
Service is to Destination Contact
Service is to Destination Consumer
Service is from Origin Address
Service is from Origin Contact
Service is from Origin Consumer
Service is performed for Deal
Response
Service Created
Show child attributes
Show child attributes
Example:
{
"id": "ser_kj93kdl9s3d0",
"type": "Oil Change",
"price": 80,
"provider": {
"id": "ser_kj93kdl9s3d0",
"name": "Auto Shop",
"addresses": [
{
"street": "123 Main St",
"city": "San Francisco",
"state": "CA",
"zip": "94105"
}
]
},
"customer": {
"id": "cus_kj93kdl9s3d0",
"name": "John Doe",
"email": "john@example.com",
"addresses": [
{
"street": "456 Elm St",
"city": "San Francisco",
"state": "CA",
"zip": "94105"
}
],
"phoneNumbers": ["555-555-5555"]
},
"description": "Comprehensive oil change service."
}⌘I