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

# Update a product

> Partial update — send only the fields to change. The recurring cadence (`recurringInterval`/`recurringIntervalCount`/`recurringCycleCount`) is fixed at create and cannot be changed here.



## OpenAPI

````yaml /v3-beta/api-reference/openapi.yaml patch /v3/products/{id}
openapi: 3.1.0
info:
  title: Suby.fi Merchant API
  version: 3.0.0-beta
  description: >
    The **v3** public merchant API for Suby.fi. RESTful (plural,
    resource-oriented

    endpoints under the `/v3` prefix). Authenticate every request

    with your secret API key in the `X-Suby-Api-Key` header.


    - `sk_live_…` keys operate in **production** (real funds).

    - `sk_sandbox_…` keys operate in a fully simulated **sandbox** (test cards,
      Base Sepolia crypto, no real money). The environment is derived from the
      key prefix.

    All monetary amounts are **integer cents** (except `priceCents` on some

    read shapes, which is a string) — token amounts are strings in the smallest

    unit (sats / lamports / wei). Fees are basis points.
  contact:
    email: dev@suby.fi
    url: https://suby.fi
servers:
  - url: https://api.beta.suby.fi
    description: Production + sandbox (environment selected by API key prefix)
security:
  - ApiKeyAuth: []
tags:
  - name: Products
    description: Manage your product catalog (one-time and recurring).
  - name: Checkout
    description: >-
      Hosted checkout — signed session tokens (`cs_…`) plus branding and
      appearance settings.
  - name: Payments
    description: >-
      Create, capture, void, and retrieve one-time & off-session payments (card,
      APM, and crypto).
  - name: Subscriptions
    description: Start and cancel recurring subscriptions.
  - name: Customers
    description: First-class customer records with billing address.
  - name: Payment Methods
    description: >-
      Save a payment method to a customer and manage saved instruments for
      off-session charges.
  - name: Webhook Endpoints
    description: Register outbound webhook destinations and rotate signing secrets.
  - name: Analytics
    description: Org-wide revenue analytics.
  - name: Health
    description: Unauthenticated liveness probe.
paths:
  /v3/products/{id}:
    patch:
      tags:
        - Products
      summary: Update a product
      description: >-
        Partial update — send only the fields to change. The recurring cadence
        (`recurringInterval`/`recurringIntervalCount`/`recurringCycleCount`) is
        fixed at create and cannot be changed here.
      operationId: updateProduct
      parameters:
        - $ref: '#/components/parameters/ProductId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  maxLength: 200
                description:
                  type: string
                  maxLength: 2000
                  nullable: true
                imageUrl:
                  type: string
                  format: uri
                  nullable: true
                status:
                  type: string
                  enum:
                    - DRAFT
                    - ACTIVE
                    - ARCHIVED
                  description: >-
                    Toggle DRAFT↔ACTIVE to unpublish/publish; ARCHIVED to
                    retire.
                priceCents:
                  type: string
                  pattern: ^\d+$
                  nullable: true
                  description: >-
                    New price in cents (string of digits). Applies to future
                    charges only — existing Payments keep their snapshot.
                currency:
                  type: string
                  nullable: true
                  enum:
                    - EUR
                    - USD
                quantity:
                  type: integer
                  minimum: 0
                  nullable: true
                  description: Stock cap; null = unlimited.
                customFields:
                  $ref: '#/components/schemas/CustomFieldArray'
                paymentMethods:
                  $ref: '#/components/schemas/PaymentMethodOverride'
                  description: >-
                    Replaces the whole whitelist. null/[] clears it (inherit the
                    Org-approved set).
                successUrl:
                  type: string
                  format: uri
                  nullable: true
                cancelUrl:
                  type: string
                  format: uri
                  nullable: true
      responses:
        '200':
          description: Product updated
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - properties:
                      data:
                        $ref: '#/components/schemas/Product'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    ProductId:
      name: id
      in: path
      required: true
      schema:
        type: string
        example: pro_abc123
  schemas:
    CustomFieldArray:
      type: array
      maxItems: 10
      description: Extra fields collected on the hosted checkout page (max 10).
      items:
        $ref: '#/components/schemas/CustomField'
    PaymentMethodOverride:
      type: array
      nullable: true
      description: >-
        Per-product payment-method whitelist. `null` / `[]` / omitted = the
        product accepts every method enabled on the account. A non-empty list
        restricts checkout to these categories (always intersected with the
        account's enabled methods, so listing a disabled method is a harmless
        no-op).
      items:
        type: string
        enum:
          - CARD
          - APPLE_PAY
          - GOOGLE_PAY
          - KLARNA
          - IDEAL
          - BANCONTACT
          - TWINT
          - BLIK
          - AFFIRM
          - MULTIBANCO
          - PAYPAL
          - SEPA_DIRECT_DEBIT
          - ACH_DIRECT_DEBIT
          - STABLECOIN
          - VOLATILE_CRYPTO
    SuccessEnvelope:
      type: object
      required:
        - success
        - data
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
        data:
          description: Endpoint-specific payload.
    Product:
      type: object
      properties:
        id:
          type: string
          example: pro_abc123
        organizationId:
          type: string
        name:
          type: string
        description:
          type: string
          nullable: true
        imageUrl:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - DRAFT
            - ACTIVE
            - ARCHIVED
        priceCents:
          type: string
          nullable: true
          description: Price in cents as a string of digits.
        currency:
          type: string
          nullable: true
          enum:
            - EUR
            - USD
        recurringInterval:
          type: string
          nullable: true
          enum:
            - DAY
            - WEEK
            - MONTH
            - YEAR
          description: Non-null = subscription product.
        recurringIntervalCount:
          type: integer
          nullable: true
        recurringCycleCount:
          type: integer
          nullable: true
          description: Cycle cap; null = open-ended.
        quantity:
          type: integer
          nullable: true
        consumedQuantity:
          type: integer
        customFields:
          type: array
          nullable: true
          items:
            $ref: '#/components/schemas/CustomField'
        paymentMethods:
          $ref: '#/components/schemas/PaymentMethodOverride'
        successUrl:
          type: string
          format: uri
          nullable: true
        cancelUrl:
          type: string
          format: uri
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CustomField:
      type: object
      required:
        - key
        - label
        - type
      properties:
        key:
          type: string
          maxLength: 50
          pattern: ^[a-z0-9_]+$
          description: Response-map key.
        label:
          type: string
          maxLength: 100
        type:
          type: string
          enum:
            - input
            - select
            - checkbox
        required:
          type: boolean
        placeholder:
          type: string
          maxLength: 200
        options:
          type: array
          description: Required (≥1) when `type=select`.
          items:
            type: object
            required:
              - value
              - label
            properties:
              value:
                type: string
                maxLength: 100
              label:
                type: string
                maxLength: 100
        validation:
          type: object
          description: '`type=input` only — client-side regex.'
          properties:
            regex:
              type: string
              maxLength: 500
            errorMessage:
              type: string
              maxLength: 200
        defaultValue:
          type: string
          maxLength: 500
          description: Merchant pre-fill (editable).
    Error:
      type: object
      required:
        - success
        - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          description: Machine-readable error code.
          example: NOT_FOUND
        message:
          type: string
          example: Resource not found
        data:
          description: Optional error detail.
    ValidationErrorEnvelope:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            data:
              type: object
              properties:
                fieldErrors:
                  type: array
                  items:
                    type: object
                    properties:
                      field:
                        type: string
                      message:
                        type: string
  responses:
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: UNAUTHORIZED
            message: Invalid or missing API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            success: false
            error: NOT_FOUND
            message: Resource not found
    ValidationError:
      description: Request failed schema validation
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorEnvelope'
          example:
            success: false
            error: VALIDATION_ERROR
            message: Validation failed
            data:
              fieldErrors:
                - field: method
                  message: method is a required field
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Suby-Api-Key
      description: Secret API key. `sk_live_…` (production) or `sk_sandbox_…` (sandbox).

````