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

# Create or update subscription method

> Creates or updates a subscription method for a product.



## OpenAPI

````yaml https://app.supercycle.com/docs/openapi-v1.yml post /products/{productId}/subscription_method
openapi: 3.1.0
info:
  title: Supercycle API
  version: 1.0.0
  contact:
    name: Supercycle Support
    email: support@supercycle.com
  description: >+
    The Supercycle API provides comprehensive endpoints designed to streamline
    inventory, rental, and return management for merchants using the Supercycle
    platform. This API facilitates the integration with external systems such as
    Shopify, enabling seamless synchronization of product data, rental
    operations, and returns processing.

    Key features include: - **Inventory Management:** Endpoints to create,
    update, and retrieve detailed information about items and products. -
    **Rental Operations:** Manage rentals from creation to dispatch, with
    automated serial allocation and synchronization with Shopify orders. -
    **Returns Processing:** Efficiently manage and track returns with the
    ability to update statuses and item conditions. - **Timeline Comments:** Add
    comments to timeline events associated with resources in a shop. -
    **Availability Timelines:** Per-variant day-by-day availability counts for
    back-office and OMS integrations (mirrors the storefront availability
    timeline). - **Blocked Dates:** List, retrieve, and create manually blocked
    date ranges on items, variants, and products that reduce availability.

    **Rate limits:** Requests are throttled per API key (Bearer token). Across
    all endpoints, a key may make at most **120 requests per minute**. The
    availability timeline endpoint (`GET /availability_timelines`) is limited to
    **10 requests per minute** per key because it is computationally
    expensive—cache responses client-side where possible. Requests without a
    Bearer token are limited to **30 requests per minute** per client IP. When
    exceeded, the API returns **429 Too Many Requests** with `Retry-After`,
    `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset`
    headers.

    This API is essential for merchants looking to enhance their operational
    efficiency, providing the tools needed to manage their inventory, rentals,
    returns, timeline events, availability planning, and blocked dates all in
    one place.

    For support or enquiries, please contact [Supercycle
    Support](mailto:support@supercycle.com).

servers:
  - url: https://app.supercycle.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: AvailabilityTimelines
  - name: BlockedDates
  - name: Conditions
  - name: CustomFieldDefinitions
  - name: CustomFields
  - name: Items
  - name: Products
  - name: Variants
  - name: Rentals
  - name: ReturnOrders
  - name: TimelineComments
  - name: Locations
paths:
  /products/{productId}/subscription_method:
    post:
      tags:
        - Products
      summary: Create or update subscription method
      description: Creates or updates a subscription method for a product.
      operationId: postProductSubscriptionMethod
      parameters:
        - name: productId
          in: path
          required: true
          description: The Shopify product ID
          schema:
            type: integer
            format: int64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - enabled
                    - disabled
                optionsAttributes:
                  type: array
                  items:
                    $ref: '#/components/schemas/SubscriptionOptionInput'
      responses:
        '200':
          description: The updated subscription method
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionMethod'
        '201':
          description: The created subscription method
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionMethod'
        '404':
          description: Product not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    SubscriptionOptionInput:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: ID of an existing option to update. Omit when creating a new option.
        name:
          type: string
        recurringPriceCents:
          type: integer
          description: Recurring price in cents.
        checkoutPriceCents:
          type: integer
          description: >-
            Initial checkout price in cents. Can differ from recurringPriceCents
            for introductory pricing.
        billingInterval:
          type: string
          description: >-
            Billing interval in N.unit format. Valid units: second, minute,
            hour, day, week, month, year.
          example: 1.month
          pattern: ^\d+\.(second|minute|hour|day|week|month|year)$
        minimumTerm:
          type: string
          description: >-
            Minimum rental term in N.unit format. Valid units: second, minute,
            hour, day, week, month, year.
          example: 1.month
          pattern: ^\d+\.(second|minute|hour|day|week|month|year)$
        variantApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all variants or only a specific
            subset. Defaults to 'all'.
        marketApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all markets or only a specific
            subset. Defaults to 'all'.
        conditionApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all item conditions or only a
            specific subset. Defaults to 'all'.
        _destroy:
          type: boolean
          description: >-
            When true and id is provided, deletes this option from the
            subscription method.
    SubscriptionMethod:
      type: object
      required:
        - id
        - status
        - createdAt
        - updatedAt
        - options
      properties:
        id:
          type: integer
          format: int64
        status:
          type: string
          enum:
            - enabled
            - disabled
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        options:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionOption'
    SubscriptionOption:
      type: object
      required:
        - id
        - name
        - recurringPriceCents
        - checkoutPriceCents
        - billingInterval
        - minimumTerm
      properties:
        id:
          type: integer
          format: int64
        name:
          type: string
        recurringPriceCents:
          type: integer
          description: Recurring price in cents.
        checkoutPriceCents:
          type: integer
          description: >-
            Initial checkout price in cents. Can differ from recurringPriceCents
            for introductory pricing.
        billingInterval:
          type: string
          description: >-
            Billing interval in N.unit format. Valid units: second, minute,
            hour, day, week, month, year.
          example: 1.month
          pattern: ^\d+\.(second|minute|hour|day|week|month|year)$
        minimumTerm:
          type: string
          description: >-
            Minimum rental term in N.unit format. Valid units: second, minute,
            hour, day, week, month, year.
          example: 1.month
          pattern: ^\d+\.(second|minute|hour|day|week|month|year)$
        depositVariantShopifyId:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Shopify variant ID of the deposit product variant associated with
            this option, if any.
        variantApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all variants or only those listed in
            variantApplicationShopifyIds.
        marketApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all markets or only those listed in
            marketApplicationShopifyIds.
        conditionApplicationType:
          type: string
          enum:
            - all
            - some
          description: >-
            Whether this option applies to all item conditions or only those
            listed in conditionApplicationIds.
        variantApplicationShopifyIds:
          type: array
          description: >-
            Shopify variant IDs this option applies to. Only relevant when
            variantApplicationType is 'some'.
          items:
            type: integer
            format: int64
        marketApplicationShopifyIds:
          type: array
          description: >-
            Shopify market IDs this option applies to. Only relevant when
            marketApplicationType is 'some'.
          items:
            type: integer
            format: int64
        conditionApplicationIds:
          type: array
          description: >-
            Internal Supercycle condition IDs this option applies to. Only
            relevant when conditionApplicationType is 'some'.
          items:
            type: integer
            format: int64
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
  responses:
    UnprocessableEntity:
      description: Invalid request
      content:
        application/json:
          schema:
            type: object
            properties:
              errors:
                type: array
                items:
                  type: string
                  example: Invalid request body
    TooManyRequests:
      description: Rate limit exceeded
      headers:
        Retry-After:
          description: Seconds until the current throttle window resets.
          schema:
            type: integer
            example: 42
        X-RateLimit-Limit:
          description: Maximum requests allowed in the window that triggered this response.
          schema:
            type: integer
            example: 120
        X-RateLimit-Remaining:
          description: >-
            Remaining requests in the window (always 0 when this response is
            returned).
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: ISO 8601 timestamp when the throttle window resets.
          schema:
            type: string
            format: date-time
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                example: Rate limit exceeded. Retry after 42 seconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````