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

# Update a subscription

> Updates a subscription's status or variant



## OpenAPI

````yaml https://swish.app/api/2026-07/.well-known/openapi patch /subscriptions/{id}
openapi: 3.0.0
info:
  title: Swish API
  description: >-
    The Swish API provides endpoints for managing profiles, lists, items,
    subscriptions, notifications, orders, etc. All endpoints require
    authentication using a Bearer token. Responses follow a consistent structure
    with a `data` wrapper for successful responses and standardized error
    formats.
  version: 2026-07
  contact: {}
servers:
  - url: https://swish.app/api/2026-07
security: []
tags: []
paths:
  /subscriptions/{id}:
    patch:
      tags:
        - Subscriptions
      summary: Update a subscription
      description: Updates a subscription's status or variant
      operationId: SubscriptionsController_update
      parameters:
        - name: id
          required: true
          in: path
          description: The ID of the subscription to update
          schema:
            example: 67a61d5561e4f9de302c02a1
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateSubscription'
      responses:
        '200':
          description: The subscription has been successfully updated.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Response'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Subscription'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Validation failed
                              error:
                                type: string
                                example: Bad Request
                              statusCode:
                                type: number
                                example: 400
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: Failed to authenticate request
                              error:
                                type: string
                                example: Unauthorized
                              statusCode:
                                type: number
                                example: 401
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: >-
                                  You do not have permission to access this
                                  resource
                              error:
                                type: string
                                example: Forbidden
                              statusCode:
                                type: number
                                example: 403
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: The requested resource was not found
                              error:
                                type: string
                                example: Not Found
                              statusCode:
                                type: number
                                example: 404
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - properties:
                      error:
                        allOf:
                          - $ref: '#/components/schemas/Error'
                          - properties:
                              message:
                                type: string
                                example: An unexpected error occurred
                              error:
                                type: string
                                example: Internal Server Error
                              statusCode:
                                type: number
                                example: 500
                              requestId:
                                type: string
                                example: 123e4567-e89b-12d3-a456-426614174000
      security:
        - Swish API key: []
        - bearer: []
components:
  schemas:
    UpdateSubscription:
      type: object
      properties:
        status:
          type: string
          description: The status of the subscription.
          enum:
            - active
            - cancelled
          example: cancelled
        variantId:
          type: string
          description: >-
            The Shopify variant ID. Subscriptions are variant-level only —
            cannot be unset.
          example: '456789123'
    Response:
      type: object
      properties:
        data:
          type: object
          description: Response data
      required:
        - data
    Subscription:
      type: object
      properties:
        id:
          type: string
          description: The ID of the subscription
          example: 550e8400-e29b-41d4-a716-446655440000
        contact:
          type: string
          description: The contact information for the subscription (phone or email)
          example: customer@example.com
        productId:
          type: string
          description: The Shopify product ID
          example: '123456799'
        variantId:
          type: string
          description: The Shopify variant ID
          example: '456789123'
        type:
          type: string
          description: The type of subscription
          enum:
            - back_in_stock
          example: back_in_stock
        channel:
          type: string
          description: The channel for the subscription
          enum:
            - email
            - sms
            - whatsapp
          example: email
        status:
          type: string
          description: The status of the subscription
          enum:
            - active
            - cancelled
          example: active
        createdAt:
          type: string
          description: The date and time the subscription was created
          example: '2025-01-01T10:00:00.000Z'
        updatedAt:
          type: string
          description: The date and time the subscription was last updated
          example: '2025-01-01T10:00:00.000Z'
        cancelledAt:
          type: object
          description: The date and time the subscription was cancelled
          example: '2025-01-01T10:00:00.000Z'
          nullable: true
        marketContextType:
          type: string
          description: The market context type for the subscription
          enum:
            - country
          nullable: true
        marketContextValue:
          type: object
          description: The market context value for the subscription (e.g. 'IE')
          example: IE
          nullable: true
      required:
        - id
        - contact
        - productId
        - variantId
        - type
        - channel
        - status
        - createdAt
        - updatedAt
    ErrorResponse:
      type: object
      properties:
        error:
          description: Error details
          allOf:
            - $ref: '#/components/schemas/Error'
      required:
        - error
    Error:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Something went wrong
        error:
          type: string
          description: The error type
          example: Not Found
        statusCode:
          type: number
          description: The HTTP status code of the error
          example: 404
        requestId:
          type: string
          description: The ID of the request that caused the error
          example: 123e4567-e89b-12d3-a456-426614174000
      required:
        - message
        - error
        - statusCode
        - requestId
  securitySchemes:
    Swish API key:
      scheme: Bearer
      bearerFormat: JWT
      type: http
      description: Enter your JWT token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.