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.

Update a subscription

Prev Next
Put
/inventory/subscriptions/{subscriptionId}

Updates the subscription identified by the given id, for instance to change its state, to move it to a different service-level or to postpone the nextPaymentTimestamp.
Being a full update, the payload should provide the complete subscription object.

Required permissions: READ_SUBSCRIPTION, WRITE_SUBSCRIPTION.

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

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

Path parameters
subscriptionId
stringRequired

The subscription identifier.

Minimum1.0
Exampleabcd1234
Body parameters

The details of the subscription being updated.

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
200

Successfully updated.

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
404

Resource was not found.

object
message
string

The error response.

ExampleResource not found
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