> ## Documentation Index
> Fetch the complete documentation index at: https://docs.developers.mijnklantportaal.nl/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Customer Subscription

> Add a new Customer Subscription.



## OpenAPI

````yaml /openapi.yaml post /customer-subscriptions
openapi: 3.1.1
info:
  title: MijnKlantportaal API
  version: v1
servers:
  - url: https://api.mijnklantportaal.nl/v1
security:
  - APIKey: []
tags:
  - name: Agreements API
  - name: Appointments API
  - name: Customers API
  - name: Customer Groups API
  - name: Customer Invoices API
  - name: Customer Offers API
  - name: Customer Subscriptions API
  - name: Customer Subscription Packages API
  - name: Files API
  - name: File Request API
  - name: File Share API
  - name: Invoices API
  - name: Payment Links API
  - name: Punch Cards API
  - name: Tickets API
  - name: Webhooks API
paths:
  /customer-subscriptions:
    post:
      tags:
        - Customer Subscriptions API
      summary: Create Customer Subscription
      description: Add a new Customer Subscription.
      operationId: create-customer-subscription
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - customerId
                - description
                - startDate
                - interval
                - amount
                - vatRate
              properties:
                customerId:
                  type: string
                  example: cst_abc12345def678
                  description: ID of the customer this offer is meant for
                description:
                  type: string
                  example: Contribution costs
                  description: Description of the Subscription
                startDate:
                  type: string
                  example: '2024-05-04'
                  description: >-
                    Date the subscription should or has started, as format
                    `YYYY-mm-dd`.
                interval:
                  type: string
                  example: 1 year
                  description: >-
                    The interval of which the subscription will be extended. Can
                    be `14 days`, `1 month`, `2 months`, `6 months` or `1 year`.
                amount:
                  type: string
                  example: '12.95'
                  description: Amount to be charged in Euro (EUR), as `string`.
                vatRate:
                  type: integer
                  example: 21
                  description: The VAT rate percentage as integer. Can be `0`, `9` or `21`.
                createInvoice:
                  type: boolean
                  example: true
                  description: >-
                    Indicates if MijnKlantportaal should create an invoice in
                    the connected bookkeeping integration. Can only be set to
                    `true` when an integration has been set up already.
                invoiceDescription:
                  type: string
                  example: Extending subscription
                  description: >-
                    The string which will be added as row on the created
                    invoice. Will be ignored when `createInvoice` is set to
                    `false` or omitted.
      responses:
        '201':
          description: The created Customer Subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerSubscription'
        '412':
          description: No Payment Provider or Bookkeeping is set up
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_ApiError'
        '422':
          description: Something is wrong with the posted data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error_ApiError'
components:
  schemas:
    CustomerSubscription:
      type: object
      description: Customer Subscription
      properties:
        id:
          type: string
          example: sub__abc12345def678
          description: ID of the subscription, always starting with `sub_`.
        customerId:
          type: string
          example: cst_abc12345def678
          description: ID of the customer which the subscription belongs to.
        description:
          type: string
          example: Website maintenance contract
          description: Description of the subscription
        startsAt:
          type: string
          example: '2024-04-29'
          description: Start date of the subscription. Formatted as `YYYY-mm-dd`.
        interval:
          type: string
          example: 1 year
          description: >-
            The interval of which the subscription will be extended. Can be `14
            days`, `1 month`, `2 months`, `6 months` or `1 year`.
        renewsAt:
          type: string
          example: '2025-04-29'
          description: >-
            Date of when the subscription will be renewed next. Formatted as
            `YYYY-mm-dd`.
        currency:
          type: string
          example: EUR
          description: Currency of the subscription amount.
        amount:
          type: string
          example: '12.95'
          description: Amount value as `string`.
        vatRate:
          type: integer
          example: 21
          description: The VAT rate percentage as integer. Can be `0`, `9` or `21`.
        status:
          type: string
          example: in_progress
          description: >-
            The current status of the subscription. Can be `planned`,
            `in_progress`, `terminated` or `ended`.
        options:
          type: object
          description: Settings of the subscription
          properties:
            createInvoice:
              type: boolean
              example: true
              description: >-
                Indicates if MijnKlantportaal should create an invoice in the
                connected bookkeeping integration.
            invoiceDescription:
              type: string
              example: Extending subscription
              nullable: true
              description: >-
                The string which will be added as row on the created invoice.
                This will be omitted when `createInvoice` is `false`.
        terminatedAt:
          type: string
          example: '2024-04-29T21:00:00+02:00'
          description: >-
            Date and time when the subscription was terminated. Written in ATOM
            format.
        createdAt:
          type: string
          example: '2024-04-29T21:00:00+02:00'
          description: >-
            Date and time when the subscription was added to MijnKlantportaal.
            Written in ATOM format.
    Error_ApiError:
      type: object
      properties:
        message:
          type: string
          description: Explanation what went wrong
  securitySchemes:
    APIKey:
      type: http
      scheme: bearer

````