curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"name": {},
"attributeValues": [],
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings"
payload = {
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": ["<string>"]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"name": {},
"attributeValues": [],
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
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({
pricing: [
{
ruleId: '<string>',
price: {amount: 1, currency: '<string>'},
country: '<string>',
state: '<string>',
postalCodes: ['<string>']
}
],
duration: {type: 'FIXED', minutes: 1},
name: {},
attributeValues: [],
skillIds: [],
locationIds: [],
holdDurationMinsOverride: 1
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings', 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",
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([
'pricing' => [
[
'ruleId' => '<string>',
'price' => [
'amount' => 1,
'currency' => '<string>'
],
'country' => '<string>',
'state' => '<string>',
'postalCodes' => [
'<string>'
]
]
],
'duration' => [
'type' => 'FIXED',
'minutes' => 1
],
'name' => [
],
'attributeValues' => [
],
'skillIds' => [
],
'locationIds' => [
],
'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"
payload := strings.NewReader("{\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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\n \"holdDurationMinsOverride\": 1\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}/services/{serviceId}/offerings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\n \"holdDurationMinsOverride\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings")
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 \"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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\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"
}Add an offering to a service
The offering is the sellable variant — price and duration live here, not on the service, so this is the call that makes a service purchasable. It is created ACTIVE; there is no draft step. pricing is a rule hierarchy, not a single amount: exactly one DEFAULT rule is required, a STATE rule is rejected without a COUNTRY rule for the same country, and a POSTAL rule is rejected without the matching STATE rule. country and state accept full names and are stored as ISO codes (“Canada” becomes “CA”, “Ontario” becomes “ON”), so read back what you wrote rather than assuming your spelling survived. Anything an order cannot match a region rule for falls through to DEFAULT — including its currency, which is why a catalogue sold abroad needs a COUNTRY rule per currency and not just a translated name. Every id in skillIds and locationIds must already exist and be active in the project, or the whole call is a 400.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": [
"<string>"
]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"name": {},
"attributeValues": [],
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings"
payload = {
"pricing": [
{
"ruleId": "<string>",
"price": {
"amount": 1,
"currency": "<string>"
},
"country": "<string>",
"state": "<string>",
"postalCodes": ["<string>"]
}
],
"duration": {
"type": "FIXED",
"minutes": 1
},
"name": {},
"attributeValues": [],
"skillIds": [],
"locationIds": [],
"holdDurationMinsOverride": 1
}
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({
pricing: [
{
ruleId: '<string>',
price: {amount: 1, currency: '<string>'},
country: '<string>',
state: '<string>',
postalCodes: ['<string>']
}
],
duration: {type: 'FIXED', minutes: 1},
name: {},
attributeValues: [],
skillIds: [],
locationIds: [],
holdDurationMinsOverride: 1
})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings', 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",
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([
'pricing' => [
[
'ruleId' => '<string>',
'price' => [
'amount' => 1,
'currency' => '<string>'
],
'country' => '<string>',
'state' => '<string>',
'postalCodes' => [
'<string>'
]
]
],
'duration' => [
'type' => 'FIXED',
'minutes' => 1
],
'name' => [
],
'attributeValues' => [
],
'skillIds' => [
],
'locationIds' => [
],
'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"
payload := strings.NewReader("{\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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\n \"holdDurationMinsOverride\": 1\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}/services/{serviceId}/offerings")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\n \"holdDurationMinsOverride\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/offerings")
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 \"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 \"name\": {},\n \"attributeValues\": [],\n \"skillIds\": [],\n \"locationIds\": [],\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
Offering data