POST
/
subscriptions

Authorizations

Authorization
string
headerrequired

Value for the Authorization header parameter.

Body

billingGroup
string | null
required

The billing group of the subscription.

billingStart
string | null
required

The billing start date of the subscription. Fallback to the start date if not set.

startDate
string | null
required

The start date of the subscription. If not set, the current date is used.

endDate
string | null
required

The end date of the subscription. If not set, the subscription has no end date.

periods
object[]
required

The contract period terms of the subscription.

poNumber
string | null
required

The po number of the subscription.

Maximum length: 255
customer
string
required

The customer who owns the subscription.

paymentMethod
string | null
required

The payment method id to use for the subscription. If not set, the default payment method of the customer is used.

invoiceAddress
string | null
required

The invoice address of the customer. If not set, the default invoice address of the customer is used.

name
string | null
required

The name of the subscription. If not set, an empty string is used.

Maximum length: 255
number
string | null
required

The number of the subscription. If not set, a unique number is generated. This number is used for the invoice and to display the subscription in the customer portal.

Maximum length: 255
externalId
string | null
required

The external id of the subscription in the external system.

Maximum length: 255
products
object[]

The product selections which defines the items of the subscription.

Response

201 - application/json
id
string
externalId
string | null
paymentMethod
object

The payment method of the subscription. If null, the default payment method of the customer is used.

invoiceAddress
object

The invoice address of the subscription. If null, the default invoice address of the customer is used.

number
string

The number of the subscription.

customer
object
plan
object

The plan this subscription is based on.

name
string | null

The name of the subscription. Defaults to the name of the plan. This will be used in the invoice for the grouping headers.

items
object[]

The selected items of the subscription. Can be charges or addons.

billingGroup
object

The billing group defines the billing cycle of the subscription.

periods
object[]
status
enum<string>

The status of the subscription.

Possible values:

  • draft: The subscription is in draft mode and not active yet.
  • active: The subscription is active and will be billed.
  • paused: The subscription is paused and will not be billed.
  • cancelled: The subscription is cancelled and will not be billed anymore.
  • terminated: The subscription is terminated and will not be billed anymore.
  • offer: The subscription is an offer and waiting for acceptance.
Available options:
draft,
active,
paused,
offer,
cancelled,
terminated
activatedAt
string | null

The date the subscription was activated.

poNumber
string | null

The po number of the subscription.

contractDetails
object

The contract details of the subscription.

trialEndsOn
string | null

The date the trial period ends.

createdAt
string

The date and time when the resource was created.

updatedAt
string

The date and time when the resource was last updated.

defaultPaymentMethod
boolean

The payment method is null, we use the default payment method of the customer.

defaultInvoiceAddress
boolean

The invoice address is null, we use the default invoice address of the customer.

nextBillingDate
string | null

The next billing date of the subscription.

lastBillingAt
string | null

The last billing date of the subscription.

cancellationDate
string | null

The date the subscription will be cancelled.

cancelledAt
string | null

The date when the subscription was cancelled.

cancellationReason
object

The reason why the subscription was cancelled.

isCancellationPending
boolean

Indicates if the subscription is pending for cancellation. If true, the subscription will be cancelled in the future and the cancellation could be revoked.

nextPossibleCancellationDate
string[] | null