Create new subscription

Prev Next
Post
/inventory/subscriptions

Required permissions: READ_SUBSCRIPTION, WRITE_SUBSCRIPTION.

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

The name of the target 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 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 to this Subscription for automatic payment.

Responses
201

Successful 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 exeeded.

object
message
string

The error response.

ExampleAPI call rate limit exeeded
500

Internal server error.

object
message
string

The error response.

ExampleInternal Server Error