PUT
/
subscriptions
/
{id}
curl -X PUT \
 /subscriptions/{id} \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer <token>" \
 --data '{
    "billingGroup": "https:\/\/example.com\/",
    "startDate": "2021-01-01T00:00:00+00:00.000Z",
    "periods": [
        []
    ],
    "poNumber": "",
    "name": "My subscription",
    "number": "#12345678",
    "externalId": "12345678",
    "customFields": {
        "field1": "value1",
        "field2": "value2"
    }
}'
{
  "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
  "externalId": "<string>",
  "paymentMethod": {
    "id": "<string>",
    "gatewayName": "wallet",
    "type": "sepa_debit",
    "default": true,
    "status": "active",
    "enabled": true,
    "name": "<string>",
    "creationDate": "2023-11-07T05:31:56Z",
    "expirationDate": "2023-11-07T05:31:56Z",
    "card": {
      "brand": "Visa",
      "last4": "4242",
      "expMonth": 12,
      "expYear": 2022,
      "cardHolder": "Max Mustermann"
    },
    "sepaDebit": {
      "iban": "DE8937*********3232",
      "bic": "COBADEFFXXX",
      "mandateReference": "MNDT-2021-123456",
      "signingDate": "2021-01-01T00:00:00+00:00"
    },
    "paypal": {
      "email": "max@mustermann.de",
      "billingAgreementId": "I-1J5gqz2eZvKYlo2C2X2X2X2X"
    }
  },
  "invoiceAddress": {
    "id": "<string>",
    "vatId": "DE123456789",
    "type": "TYPE_DEFAULT",
    "default": "true",
    "status": "active",
    "city": "Berlin",
    "zip": "12345",
    "street": "Musterstraße",
    "houseNumber": "1a",
    "countryCode": "DE",
    "companyName": "ACME Inc.",
    "salutation": "Herr",
    "addition": "c/o John Doe",
    "costCentre": "123456789",
    "firstName": "John",
    "lastName": "Doe"
  },
  "number": "S-00000001",
  "customer": {
    "id": "00000000-0000-0000-0000-000000000000",
    "customerNumber": "CUSTOMER-000",
    "timeZone": "Europe/Berlin",
    "firstName": "John",
    "lastName": "Doe",
    "currencyCode": "EUR",
    "companyName": "Acme Inc.",
    "datevId": "123456789",
    "status": "STATUS_ACTIVE"
  },
  "plan": {
    "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
    "family": {
      "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
      "createdAt": "2021-01-01T00:00:00+00:00",
      "updatedAt": "2021-01-01T00:00:00+00:00"
    },
    "code": "basic-m2023",
    "originProduct": {
      "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
      "name": "Basic",
      "description": "For small teams.",
      "internalName": "Basic (Weekly)",
      "type": "product",
      "measurement": {
        "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "unit": {
          "id": {},
          "name": "Stück",
          "createdAt": "2021-01-01T00:00:00+00:00",
          "updatedAt": "2021-01-01T00:00:00+00:00"
        },
        "code": "users",
        "description": "The number of users.",
        "aggregationType": "<any>",
        "fairBilling": true,
        "type": "<any>"
      },
      "invoiceVisibility": "always",
      "costCentre": {},
      "taxGroup": {},
      "customFields": {
        "field1": "value1",
        "field2": "value2"
      }
    },
    "allowCheckout": true,
    "status": "<any>",
    "changeBehaviour": "upgradeable_and_downgradeable",
    "changeApplyBehaviour": "end_of_period",
    "createdAt": "2023-11-07T05:31:56Z",
    "name": "<string>",
    "description": "<string>"
  },
  "name": "Fitness M",
  "items": [
    {
      "id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
      "parent": {},
      "plan": {
        "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "family": {
          "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
          "createdAt": "2021-01-01T00:00:00+00:00",
          "updatedAt": "2021-01-01T00:00:00+00:00"
        },
        "code": "basic-m2023",
        "originProduct": {
          "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
          "name": "Basic",
          "description": "For small teams.",
          "internalName": "Basic (Weekly)",
          "type": "product",
          "measurement": {
            "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
            "unit": {
              "id": {},
              "name": "Stück",
              "createdAt": "2021-01-01T00:00:00+00:00",
              "updatedAt": "2021-01-01T00:00:00+00:00"
            },
            "code": "users",
            "description": "The number of users.",
            "aggregationType": "<any>",
            "fairBilling": true,
            "type": "<any>"
          },
          "invoiceVisibility": "always",
          "costCentre": {},
          "taxGroup": {},
          "customFields": {
            "field1": "value1",
            "field2": "value2"
          }
        },
        "allowCheckout": true,
        "status": "<any>",
        "changeBehaviour": "upgradeable_and_downgradeable",
        "changeApplyBehaviour": "end_of_period",
        "createdAt": "2023-11-07T05:31:56Z",
        "name": "<string>",
        "description": "<string>"
      },
      "measurementValues": [
        {
          "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
          "measurement": {
            "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
            "unit": {
              "id": {},
              "name": "Stück",
              "createdAt": "2021-01-01T00:00:00+00:00",
              "updatedAt": "2021-01-01T00:00:00+00:00"
            },
            "code": "users",
            "description": "The number of users.",
            "aggregationType": "<any>",
            "fairBilling": true,
            "type": "<any>"
          },
          "quantity": 1,
          "measuredAt": "2021-01-01T00:00:00+00:00"
        }
      ],
      "billing": {
        "lastBilledAt": "2023-11-07T05:31:56Z",
        "lastBilledTo": "2023-11-07T05:31:56Z",
        "lastBilledFrom": "2023-11-07T05:31:56Z",
        "nextBillingAt": "2023-11-07T05:31:56Z",
        "billingInterval": "1M"
      },
      "name": "Fitness M",
      "description": "Everything included",
      "furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
      "pricePlan": {
        "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "internalName": "Exclusive pricing for partners.",
        "status": "<any>",
        "type": "<any>",
        "applyTrial": true,
        "payInAdvance": true,
        "proRata": true,
        "freeUnits": {},
        "billingInterval": "1M",
        "showPricePerInterval": "1M",
        "currencyCode": {},
        "price": {
          "amount": 123,
          "createdAt": "2021-01-01T00:00:00+00:00",
          "updatedAt": "2021-01-01T00:00:00+00:00",
          "tenantId": "<string>"
        },
        "custom": true,
        "charge": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "productSetOption": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "inUse": true
      },
      "status": "active",
      "product": {
        "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "name": "Basic",
        "description": "For small teams.",
        "internalName": "Basic (Weekly)",
        "type": "product",
        "measurement": {
          "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
          "unit": {
            "id": {},
            "name": "Stück",
            "createdAt": "2021-01-01T00:00:00+00:00",
            "updatedAt": "2021-01-01T00:00:00+00:00"
          },
          "code": "users",
          "description": "The number of users.",
          "aggregationType": "<any>",
          "fairBilling": true,
          "type": "<any>"
        },
        "invoiceVisibility": "always",
        "costCentre": {},
        "taxGroup": {},
        "customFields": {
          "field1": "value1",
          "field2": "value2"
        }
      },
      "appliedDiscounts": [
        {
          "id": "<string>",
          "coupon": {
            "id": "<string>",
            "code": "10OFF",
            "name": "10% off",
            "type": "<any>",
            "percentage": 10,
            "fixedAmount": {},
            "frequency": "<any>",
            "frequencyInterval": 3,
            "isEnabled": true,
            "createdAt": "2021-01-01T00:00:00+00:00",
            "updatedAt": "2021-01-01T00:00:00+00:00"
          },
          "status": "<any>",
          "discount": {
            "name": "10% off",
            "type": "<any>",
            "percentage": 10,
            "fixedAmount": {},
            "frequency": "<any>",
            "frequencyInterval": 3
          },
          "appliedIntervals": 1
        }
      ],
      "periods": [
        {
          "id": "<string>",
          "contractPeriodCount": 123,
          "contractPeriod": {},
          "cancellationPeriod": {},
          "createdAt": "2023-11-07T05:31:56Z",
          "updatedAt": "2023-11-07T05:31:56Z"
        }
      ],
      "activatedAt": "2021-01-01T00:00:00+00:00",
      "type": "addon",
      "currentMeasurementValue": {
        "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
        "measurement": {
          "id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
          "unit": {
            "id": {},
            "name": "Stück",
            "createdAt": "2021-01-01T00:00:00+00:00",
            "updatedAt": "2021-01-01T00:00:00+00:00"
          },
          "code": "users",
          "description": "The number of users.",
          "aggregationType": "<any>",
          "fairBilling": true,
          "type": "<any>"
        },
        "quantity": 1,
        "measuredAt": "2021-01-01T00:00:00+00:00"
      },
      "inheritedPeriod": true
    }
  ],
  "billingGroup": {
    "id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
    "name": "Billing of payments at the end of the month",
    "type": "<any>",
    "customDay": 31,
    "customMonth": 12
  },
  "periods": [
    {
      "id": "<string>",
      "contractPeriodCount": 123,
      "contractPeriod": {},
      "cancellationPeriod": {},
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "status": "<any>",
  "activatedAt": "2021-01-01T00:00:00+00:00",
  "poNumber": "PO-00000001",
  "contractDetails": {
    "contractStart": "2023-11-07T05:31:56Z",
    "contractEnd": "2023-11-07T05:31:56Z"
  },
  "trialEndsOn": "2021-01-01T00:00:00+00:00",
  "customFields": {
    "field1": "value1",
    "field2": "value2"
  },
  "createdAt": "2021-01-01T00:00:00+00:00",
  "updatedAt": "2021-01-01T00:00:00+00:00",
  "defaultPaymentMethod": true,
  "defaultInvoiceAddress": true,
  "nextBillingDate": "2023-11-07T05:31:56Z",
  "lastBillingAt": "2023-11-07T05:31:56Z",
  "cancellationDate": "2023-11-07T05:31:56Z",
  "cancelledAt": "2023-11-07T05:31:56Z",
  "cancellationReason": {
    "id": "<string>",
    "code": "<string>",
    "name": "<string>",
    "createdAt": "2021-01-01T00:00:00+00:00",
    "updatedAt": "2021-01-01T00:00:00+00:00"
  },
  "isCancellationPending": true,
  "nextPossibleCancellationDate": [
    "<string>"
  ],
  "partner": {
    "id": "ad8f7e7d-3b3b-4b3b-8b3b-3b3b3b3b3b3b",
    "name": "John Doe",
    "number": "123456",
    "email": "partner@example.com"
  }
}

Authorizations

Authorization
string
header
required

Value for the Authorization header parameter.

Path Parameters

id
string
required

Subscription identifier

Body

The updated Subscription resource
periods
object[]
required

The contract period terms of the subscription.

billingGroup
string | null

The billing group of the subscription.

startDate
string | null

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

poNumber
string | null

The po number of the subscription.

Maximum length: 255
name
string | null

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

Maximum length: 255
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 length: 255
externalId
string | null

The external id of the subscription in the external system.

Maximum length: 255
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

Response

200
application/json
Subscription resource updated
id
string
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.

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.

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

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

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

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 | null

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

The partner of the customer.