curl --request PUT \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": {},
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"value": {},
"valueId": "<string>"
}
],
"skillIds": [
"<string>"
],
"locationIds": [
"<string>"
],
"holdDurationMinsOverride": 1
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}"
payload = {
"name": {},
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": ["<string>"]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"value": {},
"valueId": "<string>"
}
],
"skillIds": ["<string>"],
"locationIds": ["<string>"],
"holdDurationMinsOverride": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: {},
pricing: [
{
ruleId: '<string>',
price: {amount: 1, currency: '<string>'},
country: '<string>',
state: '<string>',
postalCodes: ['<string>']
}
],
duration: {type: 'FIXED', minutes: 1},
attributeValues: [
{
attributeId: '<string>',
attributeNameSnapshot: {},
value: {},
valueId: '<string>'
}
],
skillIds: ['<string>'],
locationIds: ['<string>'],
holdDurationMinsOverride: 1
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}', 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}/services/{serviceId}/offerings/{offeringId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => [
],
'pricing' => [
[
'ruleId' => '<string>',
'price' => [
'amount' => 1,
'currency' => '<string>'
],
'country' => '<string>',
'state' => '<string>',
'postalCodes' => [
'<string>'
]
]
],
'duration' => [
'type' => 'FIXED',
'minutes' => 1
],
'attributeValues' => [
[
'attributeId' => '<string>',
'attributeNameSnapshot' => [
],
'value' => [
],
'valueId' => '<string>'
]
],
'skillIds' => [
'<string>'
],
'locationIds' => [
'<string>'
],
'holdDurationMinsOverride' => 1
]),
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}/services/{serviceId}/offerings/{offeringId}"
payload := strings.NewReader("{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "SERVICE_OFFERING",
"projectId": "<string>",
"serviceId": "<string>",
"offeringId": "<string>",
"pricing": [
{
"ruleId": "<string>",
"scope": "DEFAULT",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
],
"tax": {
"taxable": true,
"taxPercentage": 1
}
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"attributeType": "STRING",
"value": {},
"valueId": "<string>"
}
],
"status": "ACTIVE",
"deleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"name": {},
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
}{
"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"
}Update an offering
A partial update despite the verb: only the fields you send are written and the rest are left alone. Where a field is an array — pricing, skillIds, locationIds, attributeValues — sending it replaces the whole array, so add to a set by sending the full new one, never just the delta. Supplying pricing re-runs the same hierarchy and ISO coercion rules as create, so a partial rule set that drops the DEFAULT rule is a 400. An unknown or soft-deleted offeringId is a 404, and nothing is written.
curl --request PUT \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": {},
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"value": {},
"valueId": "<string>"
}
],
"skillIds": [
"<string>"
],
"locationIds": [
"<string>"
],
"holdDurationMinsOverride": 1
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}"
payload = {
"name": {},
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": ["<string>"]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"value": {},
"valueId": "<string>"
}
],
"skillIds": ["<string>"],
"locationIds": ["<string>"],
"holdDurationMinsOverride": 1
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: {},
pricing: [
{
ruleId: '<string>',
price: {amount: 1, currency: '<string>'},
country: '<string>',
state: '<string>',
postalCodes: ['<string>']
}
],
duration: {type: 'FIXED', minutes: 1},
attributeValues: [
{
attributeId: '<string>',
attributeNameSnapshot: {},
value: {},
valueId: '<string>'
}
],
skillIds: ['<string>'],
locationIds: ['<string>'],
holdDurationMinsOverride: 1
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}', 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}/services/{serviceId}/offerings/{offeringId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => [
],
'pricing' => [
[
'ruleId' => '<string>',
'price' => [
'amount' => 1,
'currency' => '<string>'
],
'country' => '<string>',
'state' => '<string>',
'postalCodes' => [
'<string>'
]
]
],
'duration' => [
'type' => 'FIXED',
'minutes' => 1
],
'attributeValues' => [
[
'attributeId' => '<string>',
'attributeNameSnapshot' => [
],
'value' => [
],
'valueId' => '<string>'
]
],
'skillIds' => [
'<string>'
],
'locationIds' => [
'<string>'
],
'holdDurationMinsOverride' => 1
]),
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}/services/{serviceId}/offerings/{offeringId}"
payload := strings.NewReader("{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}")
req, _ := http.NewRequest("PUT", 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.put("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings/{offeringId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": {},\n \"pricing\": [\n {\n \"ruleId\": \"<string>\",\n \"price\": {\n \"amount\": 1,\n \"currency\": \"<string>\"\n },\n \"country\": \"<string>\",\n \"state\": \"<string>\",\n \"postalCodes\": [\n \"<string>\"\n ]\n }\n ],\n \"duration\": {\n \"type\": \"FIXED\",\n \"minutes\": 1\n },\n \"attributeValues\": [\n {\n \"attributeId\": \"<string>\",\n \"attributeNameSnapshot\": {},\n \"value\": {},\n \"valueId\": \"<string>\"\n }\n ],\n \"skillIds\": [\n \"<string>\"\n ],\n \"locationIds\": [\n \"<string>\"\n ],\n \"holdDurationMinsOverride\": 1\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "SERVICE_OFFERING",
"projectId": "<string>",
"serviceId": "<string>",
"offeringId": "<string>",
"pricing": [
{
"ruleId": "<string>",
"scope": "DEFAULT",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
],
"tax": {
"taxable": true,
"taxPercentage": 1
}
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"attributeValues": [
{
"attributeId": "<string>",
"attributeNameSnapshot": {},
"attributeType": "STRING",
"value": {},
"valueId": "<string>"
}
],
"status": "ACTIVE",
"deleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"name": {},
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
}{
"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
Update data