POST
/
subscriptions
/
from-plan
curl -X POST \
 /subscriptions/from-plan \
 --header "Content-Type: application/json" \
 --header "Authorization: Bearer <token>" \
 --data '{
    "paymentMethod": "ad8f1b9e-1b1a-4c5a-8b9a-0b9e1a8d1f8a",
    "name": "My subscription",
    "number": "#12345678",
    "planCode": "my-plan",
    "planItemSelections": [
        []
    ],
    "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",
  "billingGroup": {},
  "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",
  "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.

Body

The new Subscription resource

Response

201
application/json

Subscription resource created