curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"active": true
}'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status"
payload = { "active": True }
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({active: true})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status', 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}/business-models/{businessModelId}/status",
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([
'active' => true
]),
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}/business-models/{businessModelId}/status"
payload := strings.NewReader("{\n \"active\": true\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}/business-models/{businessModelId}/status")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status")
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 \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "SERVICE_BUSINESS_MODEL",
"projectId": "<string>",
"serviceId": "<string>",
"businessModelId": "<string>",
"type": "SINGLE_BOOKING",
"paymentOptions": [
"PAY_WHILE_BOOKING"
],
"config": {},
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"fees": [
{
"feeId": "fee_booking",
"name": {
"en": "Booking fee"
},
"calculation": "FLAT",
"amount": 2500,
"taxable": false
},
{
"feeId": "fee_admin",
"name": {
"en": "Admin fee"
},
"calculation": "PERCENT",
"percentage": 5,
"taxable": true
}
]
}
}{
"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"
}Toggle business model active status
Turns a selling model on or off without deleting it, which is how you retire one while keeping its history. Deactivating the PACKAGE model blocks NEW packages from being created against the service, but does nothing to packages that already exist — they keep selling until you archive them individually, so do both if you mean to stop package sales entirely. Toggling status never modifies the model itself: type, paymentOptions and fees are all left exactly as they were, so deactivating preserves configured fees and reactivating restores creation with them intact. Note a fee on an inactive model is stored but never charged, because order lines only resolve against ACTIVE business models. An unknown businessModelId is a 404, and nothing is written.
curl --request POST \
--url https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '{
"active": true
}'import requests
url = "https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status"
payload = { "active": True }
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({active: true})
};
fetch('https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status', 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}/business-models/{businessModelId}/status",
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([
'active' => true
]),
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}/business-models/{businessModelId}/status"
payload := strings.NewReader("{\n \"active\": true\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}/business-models/{businessModelId}/status")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"active\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiv2.gomarketbox.com/v1/projects/{projectId}/services/{serviceId}/business-models/{businessModelId}/status")
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 \"active\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"entityType": "SERVICE_BUSINESS_MODEL",
"projectId": "<string>",
"serviceId": "<string>",
"businessModelId": "<string>",
"type": "SINGLE_BOOKING",
"paymentOptions": [
"PAY_WHILE_BOOKING"
],
"config": {},
"active": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"createdBy": "<string>",
"updatedBy": "<string>",
"fees": [
{
"feeId": "fee_booking",
"name": {
"en": "Booking fee"
},
"calculation": "FLAT",
"amount": 2500,
"taxable": false
},
{
"feeId": "fee_admin",
"name": {
"en": "Admin fee"
},
"calculation": "PERCENT",
"percentage": 5,
"taxable": true
}
]
}
}{
"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.