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

# Update a subscription

> Update a certain subscription. <h3>OAuth</h3>Required scopes: <code>subscriptions</code>



## OpenAPI

````yaml /assets/openapi.json patch /subscriptions/v1/{id}
openapi: 3.0.2
info:
  title: Spacebring
  version: 1.0.0
  termsOfService: https://www.spacebring.com/terms
servers:
  - url: https://api.spacebring.com
security: []
paths:
  /subscriptions/v1/{id}:
    patch:
      tags:
        - Subscriptions
      summary: Update a subscription
      description: >-
        Update a certain subscription. <h3>OAuth</h3>Required scopes:
        <code>subscriptions</code>
      operationId: updateSubscription
      parameters:
        - name: id
          in: path
          description: The id of the subscription.
          schema:
            type: string
            format: uuid
          required: true
        - in: header
          name: spacebring-network-id
          schema:
            type: string
            format: uuid
          required: false
          description: >-
            The id of the network. Required when using bearer token
            authentication
      requestBody:
        $ref: '#/components/requestBodies/patchSubscription'
      responses:
        '204':
          description: No Content
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/responseError'
      security:
        - BasicAuth: []
        - OAuth2:
            - subscriptions
components:
  requestBodies:
    patchSubscription:
      content:
        application/json:
          schema:
            type: object
            properties:
              subscription:
                type: object
                properties:
                  addPendingItemsToInvoice:
                    description: Whether pending items are added to the next invoice.
                    type: boolean
                  advanceInvoicing:
                    description: Advance invoicing settings.
                    type: object
                    properties:
                      days:
                        description: Number of days before renewal to issue an invoice.
                        type: number
                      type:
                        description: Advance invoicing mode.
                        type: string
                        enum:
                          - days
                          - default
                    required:
                      - days
                      - type
                  endDate:
                    description: ISO timestamp when the subscription ends.
                    nullable: true
                    type: string
                    format: date-time
                  items:
                    description: Updated subscription line items.
                    type: array
                    items:
                      type: object
                      properties:
                        autoUpdateFromProduct:
                          description: Whether the item syncs from its linked product.
                          type: boolean
                        avigilonAltaGroupRef:
                          description: Avigilon Alta access group reference.
                          nullable: true
                          type: number
                        brivoGroupRef:
                          description: Brivo access group reference.
                          nullable: true
                          type: number
                        commitmentCycles:
                          description: Number of billing cycles in the commitment period.
                          type: number
                        couponRef:
                          description: ID of the coupon applied to this item.
                          nullable: true
                          type: string
                        createDate:
                          description: ISO timestamp of when the item was created.
                          type: string
                          format: date-time
                        credits:
                          description: Credits included per billing cycle.
                          type: number
                        customEnd:
                          description: Whether the item has a custom end date.
                          type: boolean
                        customStart:
                          description: Whether the item has a custom start date.
                          type: boolean
                        customTax:
                          description: Custom tax settings for this item.
                          type: object
                          properties:
                            enabled:
                              description: Whether custom tax is enabled for this item.
                              type: boolean
                            rate:
                              description: Custom tax rate as a decimal.
                              type: number
                        dayPasses:
                          description: Day passes included per billing cycle.
                          type: number
                        discounts:
                          type: object
                          description: Synthetic discount percentages by product type.
                          deprecated: true
                          properties:
                            creditPackages:
                              description: Discount percentage applied to credit packages.
                              type: number
                            desks:
                              description: Discount percentage applied to desk bookings.
                              type: number
                            equipment:
                              description: >-
                                Discount percentage applied to equipment
                                bookings.
                              type: number
                            events:
                              description: Discount percentage applied to event tickets.
                              type: number
                            rooms:
                              description: Discount percentage applied to room bookings.
                              type: number
                            shop:
                              description: Discount percentage applied to shop products.
                              type: number
                        endDate:
                          description: ISO timestamp when the item ends.
                          type: string
                          format: date-time
                        entire:
                          description: >-
                            Whether the item grants access to the entire
                            resource.
                          type: boolean
                        exclusiveAccess:
                          description: Resources with exclusive access.
                          type: object
                          properties:
                            resourceRefs:
                              description: Resource IDs with exclusive access.
                              type: array
                              items:
                                type: string
                                format: uuid
                        ezeepBlueGroupRef:
                          description: Ezeep Blue group reference.
                          nullable: true
                          type: string
                        grantedDiscounts:
                          description: Coupons granted to this item.
                          type: array
                          items:
                            type: object
                            properties:
                              coupon:
                                type: object
                                properties:
                                  amountOff:
                                    description: Fixed discount amount.
                                    type: number
                                  currencyCode:
                                    description: Currency code for fixed discount amounts.
                                    type: string
                                  id:
                                    description: Unique identifier of the coupon.
                                    type: string
                                    format: uuid
                                  percentOff:
                                    description: Percentage discount amount.
                                    type: number
                                  productTypes:
                                    description: Product types the coupon applies to.
                                    type: array
                                    items:
                                      type: string
                                required:
                                  - id
                            required:
                              - coupon
                        kisiGroupRef:
                          description: Kisi access group reference.
                          nullable: true
                          type: number
                        plan:
                          description: Linked plan details.
                          type: object
                          properties:
                            id:
                              description: Unique identifier of the plan.
                              type: string
                            title:
                              description: Display name of the plan.
                              type: string
                          required:
                            - id
                        planRef:
                          description: ID of the linked plan.
                          type: string
                          format: uuid
                        price:
                          description: Price per billing cycle.
                          type: number
                        productRef:
                          description: ID of the linked product.
                          type: string
                          format: uuid
                        quantity:
                          description: Quantity of this item.
                          type: number
                        resourceRef:
                          description: Reference to the linked resource.
                          nullable: true
                          type: string
                          format: uuid
                        saltoksAccessGroupRef:
                          description: Salto KS access group reference.
                          nullable: true
                          type: string
                        setupFee:
                          description: One-time setup fee for this item.
                          type: number
                        startDate:
                          description: ISO timestamp when the item starts.
                          type: string
                          format: date-time
                        tapkeyGroupRef:
                          description: Tapkey access group reference.
                          nullable: true
                          type: string
                        tier:
                          description: Linked tier details.
                          type: object
                          properties:
                            id:
                              description: Unique identifier of the tier.
                              type: string
                            title:
                              description: Display name of the tier.
                              type: string
                          required:
                            - id
                        tierRef:
                          description: ID of the linked tier.
                          type: string
                          format: uuid
                        title:
                          description: Display title of the item.
                          type: string
                        type:
                          description: Billing type of the item.
                          type: string
                          enum:
                            - oneOff
                            - recurring
                        id:
                          description: >-
                            Unique identifier of the subscription item when
                            updating via subscription patch.
                          type: string
                          format: uuid
                  pausePaymentCollection:
                    description: Payment collection pause settings.
                    nullable: true
                    type: object
                    properties:
                      behavior:
                        description: Behavior while payment collection is paused.
                        type: string
                        enum:
                          - draft
                          - void
                      resumesAt:
                        description: ISO timestamp when payment collection resumes.
                        type: string
                        format: date-time
                    required:
                      - behavior
                  payWithInvoice:
                    description: Invoice payment settings by product type.
                    type: object
                    properties:
                      creditPackages:
                        description: Whether credit packages are invoiced.
                        type: boolean
                      desks:
                        description: Whether desk bookings are invoiced.
                        type: boolean
                      equipment:
                        description: Whether equipment bookings are invoiced.
                        type: boolean
                      events:
                        description: Whether events are invoiced.
                        type: boolean
                      parking:
                        description: Whether parking bookings are invoiced.
                        type: boolean
                      rooms:
                        description: Whether room bookings are invoiced.
                        type: boolean
                      shop:
                        description: Whether shop purchases are invoiced.
                        type: boolean
                  startDate:
                    description: ISO timestamp when the subscription starts.
                    type: string
                    format: date-time
            required:
              - subscription
      required: true
  schemas:
    responseError:
      type: object
      properties:
        message:
          type: string
        type:
          type: string
  securitySchemes:
    BasicAuth:
      type: http
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#basic-authentication)
        for how to authorize your requests
      scheme: basic
    OAuth2:
      type: oauth2
      description: >-
        See our [authentication
        documentation](https://www.spacebring.com/docs/api-reference/authentication#oauth2)
        for how to authorize your requests
      flows:
        authorizationCode:
          authorizationUrl: https://api.spacebring.com/oauth2/authorize
          tokenUrl: https://api.spacebring.com/oauth2/token
          refreshUrl: https://api.spacebring.com/oauth2/token
          scopes:
            benefits.readonly: Read benefits and applications
            benefits: Read and write benefits and applications
            community.readonly: Read community companies and memberships
            community: Read and write community companies and memberships
            events.readonly: Read events and tickets
            events: Read and write events and tickets
            feed.readonly: Read feed posts
            feed: Read and write feed posts
            invoices.readonly: Read invoices
            invoices: Read and write invoices
            locations.readonly: Read locations
            locations: Read and write locations
            plans.readonly: Read plans
            plans: Read and write plans
            resources.readonly: Read resources and bookings
            resources: Read and write resources and bookings
            subscriptions.readonly: Read subscriptions
            subscriptions: Read and write subscriptions
            shop.readonly: Read products and orders
            shop: Read and write products and orders
            support.readonly: Read support tickets
            support: Read and write support tickets
            transactions.readonly: Read transactions
            transactions: Read and write transactions
            visitors.readonly: Read visitors
            visitors: Read and write visitors

````