Create a supplier
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressoneline": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"longitude": 123,
"latitude": 123,
"timezone": "America/Toronto",
"bio": "<string>",
"maxTravelTime": 1,
"externalId": "<string>",
"externalData": {},
"active": true,
"serviceIds": [],
"skillIds": [],
"languages": [],
"defaultLocale": "fr-CA"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressoneline": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"longitude": 123,
"latitude": 123,
"timezone": "America/Toronto",
"bio": "<string>",
"maxTravelTime": 1,
"externalId": "<string>",
"externalData": {},
"active": True,
"serviceIds": [],
"skillIds": [],
"languages": [],
"defaultLocale": "fr-CA"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressoneline: '<string>',
street: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
postalcode: '<string>',
longitude: 123,
latitude: 123,
timezone: 'America/Toronto',
bio: '<string>',
maxTravelTime: 1,
externalId: '<string>',
externalData: {},
active: true,
serviceIds: [],
skillIds: [],
languages: [],
defaultLocale: 'fr-CA'
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers', 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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers",
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([
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressoneline' => '<string>',
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalcode' => '<string>',
'longitude' => 123,
'latitude' => 123,
'timezone' => 'America/Toronto',
'bio' => '<string>',
'maxTravelTime' => 1,
'externalId' => '<string>',
'externalData' => [
],
'active' => true,
'serviceIds' => [
],
'skillIds' => [
],
'languages' => [
],
'defaultLocale' => 'fr-CA'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"supplierId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"active": true,
"updatedAt": "<string>",
"avatarUrl": "<string>",
"services": [
{
"serviceId": "<string>",
"name": {}
}
],
"skills": [
{
"skillId": "<string>",
"name": {}
}
],
"locations": [
{
"locationId": "<string>",
"locationType": "PHYSICAL",
"name": "<string>",
"country": "<string>",
"state": "<string>",
"city": "<string>",
"addressOneLine": "<string>",
"street": "<string>",
"latitude": 123,
"longitude": 123,
"travelZoneType": "CIRCULAR"
}
],
"servedRegions": [
"ca/",
"ca/on/",
"ca/on/scarborough/",
"ca/on/toronto/"
],
"languages": [
"<string>"
],
"locales": [
"<string>"
],
"phone": "<string>",
"addressoneline": "<string>",
"longitude": 123,
"latitude": 123,
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"bio": "<string>",
"maxTravelTime": 123,
"externalId": "<string>",
"externalData": {},
"timezone": "America/Toronto",
"defaultLocale": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Suppliers
Create a supplier
Location fields are canonicalised to ISO codes: country is an ISO 3166-1 alpha-2 code (e.g. “CA”), state an ISO 3166-2 subdivision of that country (“CA-ON” or “ON”). Invalid codes return 400. city is free text.
POST
/
v1
/
projects
/
{projectId}
/
suppliers
Create a supplier
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressoneline": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"longitude": 123,
"latitude": 123,
"timezone": "America/Toronto",
"bio": "<string>",
"maxTravelTime": 1,
"externalId": "<string>",
"externalData": {},
"active": true,
"serviceIds": [],
"skillIds": [],
"languages": [],
"defaultLocale": "fr-CA"
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers"
payload = {
"firstName": "<string>",
"lastName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressoneline": "<string>",
"street": "<string>",
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"longitude": 123,
"latitude": 123,
"timezone": "America/Toronto",
"bio": "<string>",
"maxTravelTime": 1,
"externalId": "<string>",
"externalData": {},
"active": True,
"serviceIds": [],
"skillIds": [],
"languages": [],
"defaultLocale": "fr-CA"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: '<string>',
lastName: '<string>',
email: 'jsmith@example.com',
phone: '<string>',
addressoneline: '<string>',
street: '<string>',
city: '<string>',
state: '<string>',
country: '<string>',
postalcode: '<string>',
longitude: 123,
latitude: 123,
timezone: 'America/Toronto',
bio: '<string>',
maxTravelTime: 1,
externalId: '<string>',
externalData: {},
active: true,
serviceIds: [],
skillIds: [],
languages: [],
defaultLocale: 'fr-CA'
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers', 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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers",
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([
'firstName' => '<string>',
'lastName' => '<string>',
'email' => 'jsmith@example.com',
'phone' => '<string>',
'addressoneline' => '<string>',
'street' => '<string>',
'city' => '<string>',
'state' => '<string>',
'country' => '<string>',
'postalcode' => '<string>',
'longitude' => 123,
'latitude' => 123,
'timezone' => 'America/Toronto',
'bio' => '<string>',
'maxTravelTime' => 1,
'externalId' => '<string>',
'externalData' => [
],
'active' => true,
'serviceIds' => [
],
'skillIds' => [
],
'languages' => [
],
'defaultLocale' => 'fr-CA'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers"
payload := strings.NewReader("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/suppliers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"phone\": \"<string>\",\n \"addressoneline\": \"<string>\",\n \"street\": \"<string>\",\n \"city\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"postalcode\": \"<string>\",\n \"longitude\": 123,\n \"latitude\": 123,\n \"timezone\": \"America/Toronto\",\n \"bio\": \"<string>\",\n \"maxTravelTime\": 1,\n \"externalId\": \"<string>\",\n \"externalData\": {},\n \"active\": true,\n \"serviceIds\": [],\n \"skillIds\": [],\n \"languages\": [],\n \"defaultLocale\": \"fr-CA\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"supplierId": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"email": "<string>",
"active": true,
"updatedAt": "<string>",
"avatarUrl": "<string>",
"services": [
{
"serviceId": "<string>",
"name": {}
}
],
"skills": [
{
"skillId": "<string>",
"name": {}
}
],
"locations": [
{
"locationId": "<string>",
"locationType": "PHYSICAL",
"name": "<string>",
"country": "<string>",
"state": "<string>",
"city": "<string>",
"addressOneLine": "<string>",
"street": "<string>",
"latitude": 123,
"longitude": 123,
"travelZoneType": "CIRCULAR"
}
],
"servedRegions": [
"ca/",
"ca/on/",
"ca/on/scarborough/",
"ca/on/toronto/"
],
"languages": [
"<string>"
],
"locales": [
"<string>"
],
"phone": "<string>",
"addressoneline": "<string>",
"longitude": 123,
"latitude": 123,
"city": "<string>",
"state": "<string>",
"country": "<string>",
"postalcode": "<string>",
"bio": "<string>",
"maxTravelTime": 123,
"externalId": "<string>",
"externalData": {},
"timezone": "America/Toronto",
"defaultLocale": "<string>"
}
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}{
"code": "NOT_FOUND",
"message": "Booking not found",
"statusCode": 404,
"requestId": "a3f1c2de-9b64-4a2f-8f0e-5c9d1b7a2e10"
}Authorizations
API key minted in the MarketBox dashboard. Scope is restricted to the projects you select at creation time. Every route needs the key's standard API access (*) except POST /v1/projects/{projectId}/events, which needs events:write; a key without * is refused with 403 CAPABILITY_NOT_GRANTED.
Path Parameters
Body
application/json
Supplier data