Zum Hauptinhalt springen
POST
Create subscription

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

The new Subscription resource

periods
object[]
erforderlich

The contract period terms of the subscription.

Minimum array length: 1
customer
string<uuid>
erforderlich

The customer who owns the subscription.

Beispiel:

"ad8c7c0e-3b1a-4f5c-8b7a-5d5b6a4b2f1e"

billingGroup
string<uuid> | null

The billing group of the subscription.

Beispiel:

"b3e1f9a2-4c6d-4e8f-9a1b-2c3d4e5f6a7b"

billingStart
string<date-time> | null

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

Beispiel:

"2025-01-01T00:00:00+00:00"

startDate
string<date-time> | null

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

Beispiel:

"2025-01-01T00:00:00+00:00"

endDate
string<date-time> | null

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

Beispiel:

"2026-01-01T00:00:00+00:00"

poNumber
string | null

The po number of the subscription.

Maximum string length: 255
Beispiel:

"PO-2025-001"

paymentMethod
string<uuid> | null

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

Beispiel:

"ad8f1b9e-1b1a-4c5a-8b9a-0b9e1a8d1f8a"

invoiceAddress
string<uuid> | null

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

Beispiel:

"ad8f1b9e-1b1a-4c5a-8b9a-0b9e1a8d1f8a"

name
string | null

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

Maximum string length: 255
Beispiel:

"My subscription"

number
string | null

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 string length: 255
Beispiel:

"#12345678"

externalId
string | null

The external id of the subscription in the external system.

Maximum string length: 255
Beispiel:

"12345678"

products
object[]

The product selections which defines the items of the subscription.

customFields
object | null

Custom fields for the entity. The keys are the field names and the values are the field values. They need to be configured under "/custom-fields" in the API documentation. The input is validated against the configuration. For more details see Custom Fields Guide

Beispiel:
deliveryAddress
string<uuid> | null

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

Beispiel:

"ad8f1b9e-1b1a-4c5a-8b9a-0b9e1a8d1f8a"

Antwort

Subscription resource created

id
string
read-only
Beispiel:

"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"

externalId
string | null
paymentMethod
object | null

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

invoiceAddress
object | null

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

number
string

The number of the subscription.

Beispiel:

"S-00000001"

customer
object
plan
object | null

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.

Beispiel:

"Fitness M"

items
object[]

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

billingGroup
object | null

The billing group defines the billing cycle of the subscription.

periods
object[]
status
any
read-only

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.
Beispiel:

"active"

activatedAt
string<date-time> | null
read-only

The date the subscription was activated.

Beispiel:

"2021-01-01T00:00:00+00:00"

poNumber
string | null

The po number of the subscription.

Beispiel:

"PO-00000001"

contractDetails
object

The contract details of the subscription.

trialEndsOn
string<date-time> | null
read-only

The date the trial period ends.

Beispiel:

"2021-01-01T00:00:00+00:00"

customFields
object | null

Custom fields for the entity. The keys are the field names and the values are the field values. They need to be configured under "/custom-fields" in the API documentation. The input is validated against the configuration. For more details see Custom Fields Guide

Beispiel:
createdAt
string<date-time>
read-only

The date and time when the resource was created.

Beispiel:

"2021-01-01T00:00:00+00:00"

updatedAt
string<date-time>
read-only

The date and time when the resource was last updated.

Beispiel:

"2021-01-01T00:00:00+00:00"

defaultPaymentMethod
boolean
read-only

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

defaultInvoiceAddress
boolean
read-only

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

nextBillingDate
string<date-time> | null
read-only

The next billing date of the subscription.

lastBillingAt
string<date-time> | null
read-only

The last billing date of the subscription.

cancellationDate
string<date-time> | null
read-only

The date the subscription will be cancelled.

cancelledAt
string<date-time> | null
read-only

The date when the subscription was cancelled.

cancellationReason
object | null

The reason why the subscription was cancelled.

isCancellationPending
boolean
read-only

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
read-only
partner
object | null

The partner of the customer.