Documentation Index

Fetch the complete documentation index at: https://learn.servitly.com/llms.txt

Use this file to discover all available pages before exploring further.

Create new subscription

Prev Next
Post
/inventory/subscriptions

Creates a new subscription binding a customer or a thing to a service-level.
The type field defines the kind of subscription (THING_SERVICE_LEVEL, CUSTOMER_SERVICE_LEVEL, THING_SERVICE, CUSTOMER_SERVICE) and determines whether serviceLevelId or serviceId must be provided, together with thingId or customerId.

Required permissions: READ_SUBSCRIPTION, WRITE_SUBSCRIPTION.

Security
HTTP
Type bearer
Header parameters
X-Servitly-Tenant
stringRequired

The name of the tenant (e.g. acme).

Body parameters

The details of the subscription being created.

object
customerId
string

The customer identifier.

thingId
string

The thing identifier.

activationTimestamp
integer (int64)

The timestamp this subscription has been activated.

nextPaymentTimestamp
integer (int64)

The timestamp indicating how long the subscription is valid.

serviceLevelId
string

The identifier of the subscribed service-level in case of type equal to THING_SERVICE_LEVEL or CUSTOMER_SERVICE_LEVEL.

serviceId
string

The identifier of the subscribed service in case of type equal to THING_SERVICE, or CUSTOMER_SERVICE.

freePeriodAlreadyUsed
boolean

The flag indicating whether the free period has already been used.

type
string

The subscription type (THING_SERVICE_LEVEL, CUSTOMER_SERVICE_LEVEL, THING_SERVICE, CUSTOMER_SERVICE).

stripeSubscriptionId
string

The identifier of the Stripe subscription associated with this Subscription for automatic payment.

Responses
201

Successfully created.

400

Request data not valid.

object
message
string

The error response.

ExampleBad request
401

User not authenticated.

object
message
string

The error response.

ExampleUser not authenticated
403

User not authorized.

object
message
string

The error response.

ExampleUser not authorized
429

API call rate limit exceeded.

object
message
string

The error response.

ExampleAPI call rate limit exceeded
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error