Create a subscription item
curl --request POST \
--url https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"item": {
"autoUpdateFromProduct": true,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"couponRef": "<string>",
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": true,
"customStart": true,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": true,
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"ezeepBlueGroupRef": "<string>",
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
}
}
],
"kisiGroupRef": 123,
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"saltoksAccessGroupRef": "<string>",
"setupFee": 123,
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
}
'import requests
url = "https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items"
payload = { "item": {
"autoUpdateFromProduct": True,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"couponRef": "<string>",
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": True,
"customStart": True,
"customTax": {
"enabled": True,
"rate": 123
},
"dayPasses": 123,
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": True,
"exclusiveAccess": { "resourceRefs": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] },
"ezeepBlueGroupRef": "<string>",
"grantedDiscounts": [{ "coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
} }],
"kisiGroupRef": 123,
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"saltoksAccessGroupRef": "<string>",
"setupFee": 123,
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
item: {
autoUpdateFromProduct: true,
avigilonAltaGroupRef: 123,
brivoGroupRef: 123,
commitmentCycles: 123,
couponRef: '<string>',
createDate: '2023-11-07T05:31:56Z',
credits: 123,
customEnd: true,
customStart: true,
customTax: {enabled: true, rate: 123},
dayPasses: 123,
discounts: {
creditPackages: 123,
desks: 123,
equipment: 123,
events: 123,
rooms: 123,
shop: 123
},
endDate: '2023-11-07T05:31:56Z',
entire: true,
exclusiveAccess: {resourceRefs: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']},
ezeepBlueGroupRef: '<string>',
grantedDiscounts: [
{
coupon: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amountOff: 123,
currencyCode: '<string>',
percentOff: 123,
productTypes: []
}
}
],
kisiGroupRef: 123,
planRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 123,
productRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
resourceRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
saltoksAccessGroupRef: '<string>',
setupFee: 123,
startDate: '2023-11-07T05:31:56Z',
tapkeyGroupRef: '<string>',
tierRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>'
}
})
};
fetch('https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items', 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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items",
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([
'item' => [
'autoUpdateFromProduct' => true,
'avigilonAltaGroupRef' => 123,
'brivoGroupRef' => 123,
'commitmentCycles' => 123,
'couponRef' => '<string>',
'createDate' => '2023-11-07T05:31:56Z',
'credits' => 123,
'customEnd' => true,
'customStart' => true,
'customTax' => [
'enabled' => true,
'rate' => 123
],
'dayPasses' => 123,
'discounts' => [
'creditPackages' => 123,
'desks' => 123,
'equipment' => 123,
'events' => 123,
'rooms' => 123,
'shop' => 123
],
'endDate' => '2023-11-07T05:31:56Z',
'entire' => true,
'exclusiveAccess' => [
'resourceRefs' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'ezeepBlueGroupRef' => '<string>',
'grantedDiscounts' => [
[
'coupon' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amountOff' => 123,
'currencyCode' => '<string>',
'percentOff' => 123,
'productTypes' => [
]
]
]
],
'kisiGroupRef' => 123,
'planRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 123,
'productRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'resourceRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'saltoksAccessGroupRef' => '<string>',
'setupFee' => 123,
'startDate' => '2023-11-07T05:31:56Z',
'tapkeyGroupRef' => '<string>',
'tierRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items"
payload := strings.NewReader("{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"addPendingItemsToInvoice": true,
"advanceInvoicing": {
"days": 123
},
"assignments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource": {
"id": "<string>",
"title": "<string>",
"type": "<string>",
"coverUrl": "<string>"
},
"title": "<string>",
"entire": true,
"quantity": 123
}
],
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customerRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dayPasses": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"autoUpdateFromProduct": true,
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": true,
"customStart": true,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"endFixed": true,
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"enabledForCredits": true,
"limitedItems": {
"enabled": true,
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
]
},
"limitedRedemption": {
"enabled": true,
"usage": 123,
"value": 123
},
"percentOff": 123,
"productTypes": []
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"quantity": 123,
"setupFee": 123,
"startFixed": true,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"commitmentEndDate": "2023-11-07T05:31:56Z",
"couponRef": "<string>",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": true,
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"ezeepBlueGroupRef": "<string>",
"kisiGroupRef": 123,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"resourceRef": "<string>"
},
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"type": "<string>",
"imageUrl": "<string>"
},
"resourceRef": "<string>",
"saltoksAccessGroupRef": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
],
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"networkRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payWithInvoice": {
"creditPackages": true,
"desks": true,
"events": true,
"rooms": true,
"shop": true,
"equipment": true,
"parking": true
},
"price": 123,
"startDate": "2023-11-07T05:31:56Z",
"startFixed": true,
"timezoneId": "<string>",
"company": {
"createDate": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"logo": {
"key": "<string>",
"url": "<string>"
},
"metadata": {},
"notes": "<string>",
"publicLogoUrl": "<string>"
},
"companyRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
},
"currentInterval": {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"futureIntervalItemsCreated": true
},
"deleteDate": "2023-11-07T05:31:56Z",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"membershipRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextInterval": {
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"pausePaymentCollection": {
"createDate": "2023-11-07T05:31:56Z",
"resumesAt": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "<string>",
"request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}
},
"purchaseDate": "2023-11-07T05:31:56Z",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"about": "<string>",
"email": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"photoUrl": "<string>",
"surname": "<string>"
},
"userCreator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"about": "<string>",
"email": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"photoUrl": "<string>",
"surname": "<string>"
},
"userRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"message": "<string>",
"type": "<string>"
}Subscriptions
Create a subscription item
Create a subscription item.
OAuth
Required scopes:subscriptionsPOST
/
subscriptions
/
v1
/
{subscriptionId}
/
items
Create a subscription item
curl --request POST \
--url https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"item": {
"autoUpdateFromProduct": true,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"couponRef": "<string>",
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": true,
"customStart": true,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": true,
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"ezeepBlueGroupRef": "<string>",
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
}
}
],
"kisiGroupRef": 123,
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"saltoksAccessGroupRef": "<string>",
"setupFee": 123,
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
}
'import requests
url = "https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items"
payload = { "item": {
"autoUpdateFromProduct": True,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"couponRef": "<string>",
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": True,
"customStart": True,
"customTax": {
"enabled": True,
"rate": 123
},
"dayPasses": 123,
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": True,
"exclusiveAccess": { "resourceRefs": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] },
"ezeepBlueGroupRef": "<string>",
"grantedDiscounts": [{ "coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"percentOff": 123,
"productTypes": []
} }],
"kisiGroupRef": 123,
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"resourceRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"saltoksAccessGroupRef": "<string>",
"setupFee": 123,
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
} }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({
item: {
autoUpdateFromProduct: true,
avigilonAltaGroupRef: 123,
brivoGroupRef: 123,
commitmentCycles: 123,
couponRef: '<string>',
createDate: '2023-11-07T05:31:56Z',
credits: 123,
customEnd: true,
customStart: true,
customTax: {enabled: true, rate: 123},
dayPasses: 123,
discounts: {
creditPackages: 123,
desks: 123,
equipment: 123,
events: 123,
rooms: 123,
shop: 123
},
endDate: '2023-11-07T05:31:56Z',
entire: true,
exclusiveAccess: {resourceRefs: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']},
ezeepBlueGroupRef: '<string>',
grantedDiscounts: [
{
coupon: {
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
amountOff: 123,
currencyCode: '<string>',
percentOff: 123,
productTypes: []
}
}
],
kisiGroupRef: 123,
planRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
price: 123,
productRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
resourceRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
saltoksAccessGroupRef: '<string>',
setupFee: 123,
startDate: '2023-11-07T05:31:56Z',
tapkeyGroupRef: '<string>',
tierRef: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
title: '<string>'
}
})
};
fetch('https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items', 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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items",
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([
'item' => [
'autoUpdateFromProduct' => true,
'avigilonAltaGroupRef' => 123,
'brivoGroupRef' => 123,
'commitmentCycles' => 123,
'couponRef' => '<string>',
'createDate' => '2023-11-07T05:31:56Z',
'credits' => 123,
'customEnd' => true,
'customStart' => true,
'customTax' => [
'enabled' => true,
'rate' => 123
],
'dayPasses' => 123,
'discounts' => [
'creditPackages' => 123,
'desks' => 123,
'equipment' => 123,
'events' => 123,
'rooms' => 123,
'shop' => 123
],
'endDate' => '2023-11-07T05:31:56Z',
'entire' => true,
'exclusiveAccess' => [
'resourceRefs' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
],
'ezeepBlueGroupRef' => '<string>',
'grantedDiscounts' => [
[
'coupon' => [
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'amountOff' => 123,
'currencyCode' => '<string>',
'percentOff' => 123,
'productTypes' => [
]
]
]
],
'kisiGroupRef' => 123,
'planRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'price' => 123,
'productRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'resourceRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'saltoksAccessGroupRef' => '<string>',
'setupFee' => 123,
'startDate' => '2023-11-07T05:31:56Z',
'tapkeyGroupRef' => '<string>',
'tierRef' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'title' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items"
payload := strings.NewReader("{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://api.spacebring.com/subscriptions/v1/{subscriptionId}/items")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacebring.com/subscriptions/v1/{subscriptionId}/items")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"item\": {\n \"autoUpdateFromProduct\": true,\n \"avigilonAltaGroupRef\": 123,\n \"brivoGroupRef\": 123,\n \"commitmentCycles\": 123,\n \"couponRef\": \"<string>\",\n \"createDate\": \"2023-11-07T05:31:56Z\",\n \"credits\": 123,\n \"customEnd\": true,\n \"customStart\": true,\n \"customTax\": {\n \"enabled\": true,\n \"rate\": 123\n },\n \"dayPasses\": 123,\n \"discounts\": {\n \"creditPackages\": 123,\n \"desks\": 123,\n \"equipment\": 123,\n \"events\": 123,\n \"rooms\": 123,\n \"shop\": 123\n },\n \"endDate\": \"2023-11-07T05:31:56Z\",\n \"entire\": true,\n \"exclusiveAccess\": {\n \"resourceRefs\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n },\n \"ezeepBlueGroupRef\": \"<string>\",\n \"grantedDiscounts\": [\n {\n \"coupon\": {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"amountOff\": 123,\n \"currencyCode\": \"<string>\",\n \"percentOff\": 123,\n \"productTypes\": []\n }\n }\n ],\n \"kisiGroupRef\": 123,\n \"planRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"price\": 123,\n \"productRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"resourceRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"saltoksAccessGroupRef\": \"<string>\",\n \"setupFee\": 123,\n \"startDate\": \"2023-11-07T05:31:56Z\",\n \"tapkeyGroupRef\": \"<string>\",\n \"tierRef\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"title\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"addPendingItemsToInvoice": true,
"advanceInvoicing": {
"days": 123
},
"assignments": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource": {
"id": "<string>",
"title": "<string>",
"type": "<string>",
"coverUrl": "<string>"
},
"title": "<string>",
"entire": true,
"quantity": 123
}
],
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customerRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dayPasses": 123,
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"items": [
{
"autoUpdateFromProduct": true,
"createDate": "2023-11-07T05:31:56Z",
"credits": 123,
"customEnd": true,
"customStart": true,
"customTax": {
"enabled": true,
"rate": 123
},
"dayPasses": 123,
"endFixed": true,
"grantedDiscounts": [
{
"coupon": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountOff": 123,
"currencyCode": "<string>",
"enabledForCredits": true,
"limitedItems": {
"enabled": true,
"values": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
]
},
"limitedRedemption": {
"enabled": true,
"usage": 123,
"value": 123
},
"percentOff": 123,
"productTypes": []
}
}
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"price": 123,
"quantity": 123,
"setupFee": 123,
"startFixed": true,
"avigilonAltaGroupRef": 123,
"brivoGroupRef": 123,
"commitmentCycles": 123,
"commitmentEndDate": "2023-11-07T05:31:56Z",
"couponRef": "<string>",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"entire": true,
"exclusiveAccess": {
"resourceRefs": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
},
"ezeepBlueGroupRef": "<string>",
"kisiGroupRef": 123,
"optionRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"resourceRef": "<string>"
},
"planRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"productRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"resource": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"type": "<string>",
"imageUrl": "<string>"
},
"resourceRef": "<string>",
"saltoksAccessGroupRef": "<string>",
"startDate": "2023-11-07T05:31:56Z",
"tapkeyGroupRef": "<string>",
"tier": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
},
"tierRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>"
}
],
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"networkRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payWithInvoice": {
"creditPackages": true,
"desks": true,
"events": true,
"rooms": true,
"shop": true,
"equipment": true,
"parking": true
},
"price": 123,
"startDate": "2023-11-07T05:31:56Z",
"startFixed": true,
"timezoneId": "<string>",
"company": {
"createDate": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"locationRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"title": "<string>",
"logo": {
"key": "<string>",
"url": "<string>"
},
"metadata": {},
"notes": "<string>",
"publicLogoUrl": "<string>"
},
"companyRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"contract": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
},
"currentInterval": {
"endDate": "2023-11-07T05:31:56Z",
"startDate": "2023-11-07T05:31:56Z",
"futureIntervalItemsCreated": true
},
"deleteDate": "2023-11-07T05:31:56Z",
"discounts": {
"creditPackages": 123,
"desks": 123,
"equipment": 123,
"events": 123,
"rooms": 123,
"shop": 123
},
"endDate": "2023-11-07T05:31:56Z",
"membershipRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nextInterval": {
"startDate": "2023-11-07T05:31:56Z",
"endDate": "2023-11-07T05:31:56Z"
},
"pausePaymentCollection": {
"createDate": "2023-11-07T05:31:56Z",
"resumesAt": "2023-11-07T05:31:56Z"
},
"payment": {
"status": "<string>",
"request": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>"
}
},
"purchaseDate": "2023-11-07T05:31:56Z",
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"about": "<string>",
"email": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"photoUrl": "<string>",
"surname": "<string>"
},
"userCreator": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"about": "<string>",
"email": "<string>",
"name": "<string>",
"phoneNumber": "<string>",
"photoUrl": "<string>",
"surname": "<string>"
},
"userRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"message": "<string>",
"type": "<string>"
}Authorizations
BasicAuthOAuth2
See our authentication documentation for how to authorize your requests
Headers
The id of the network. Required when using bearer token authentication
Path Parameters
The id of the subscription.
Body
application/json
Subscription item to create.
Show child attributes
Show child attributes
Response
Created
Show child attributes
Show child attributes
Was this page helpful?
⌘I