Skip to main content
POST
/
subscriptions
/
v1
Create a subscription
curl --request POST \
  --url https://api.spacebring.com/subscriptions/v1 \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "subscription": {
    "startDate": "2023-11-07T05:31:56Z",
    "companyRef": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "addPendingItemsToInvoice": true,
    "endDate": "2023-11-07T05:31:56Z",
    "items": [
      {
        "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>"
      }
    ]
  },
  "issueFirstInvoice": "auto"
}
'
{
  "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"
  }
}

Authorizations

Authorization
string
header
required

See our authentication documentation for how to authorize your requests

Headers

spacebring-network-id
string<uuid>

The id of the network. Required when using bearer token authentication

Body

application/json
subscription
Company subscription · object
required

Subscription to create. Must include exactly one of companyRef or membershipRef, not both.

issueFirstInvoice
enum<string>
default:auto

If "manual", the first invoice will not be issued. If "auto", the first invoice will be issued automatically.

Available options:
manual,
auto

Response

OK

subscription
object