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

# Create Product Subscription

> Subscribe to a canonical product's offer events; an identical active subscription returns the existing one.



## OpenAPI

````yaml post /v1/product-subscriptions
openapi: 3.1.0
info:
  title: Channel3 API
  version: 0.1.0
servers:
  - url: https://api.trychannel3.com
    description: Production
security: []
paths:
  /v1/product-subscriptions:
    post:
      tags:
        - product-subscriptions
      summary: Create Product Subscription
      description: >-
        Subscribe to a canonical product's offer events; an identical active
        subscription returns the existing one.
      operationId: create_product_subscription_v1_product_subscriptions_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProductSubscriptionRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductSubscriptionResponse'
        '401':
          description: Unauthorized - Invalid or missing authentication
          content:
            application/json:
              examples:
                missing_key:
                  summary: Missing API Key
                  value:
                    detail: >-
                      Unauthorized. Missing authentication key. Make sure to
                      attach an x-api-key with your request. Need help? Reach
                      out to support@trychannel3.com.
                invalid_key:
                  summary: Invalid API Key
                  value:
                    detail: >-
                      API key was provided but is invalid. Need help? Reach out
                      to support@trychannel3.com.
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '402':
          description: Payment required
          content:
            application/json:
              examples:
                credits_exhausted:
                  summary: API key out of credits
                  value:
                    detail: >-
                      You have used all of your free credits. Add a payment
                      method to continue.
                mpp_challenge:
                  summary: MPP Tempo payment required
                  value:
                    detail: >-
                      Payment required. Satisfy the MPP Tempo challenge in
                      WWW-Authenticate.
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              example:
                detail: Canonical product cp_123 not found
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '409':
          description: The product is not available yet
          content:
            application/json:
              example:
                detail: >-
                  Product cp_123 is still being processed from its lookup; retry
                  with the same ID once the lookup resolves
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '422':
          description: Invalid event types, domains, or selection
          content:
            application/json:
              example:
                detail: 'Invalid domain: ''nike''. Pass bare domains like ''nike.com''.'
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/app__routers__utils__ErrorResponse'
              example:
                detail: Internal Server Error
      security:
        - APIKeyHeader: []
components:
  schemas:
    CreateProductSubscriptionRequest:
      properties:
        product_id:
          type: string
          title: Product Id
          description: >-
            Canonical product ID, as returned by /v1/products or /v1/lookup.
            Lookup IDs are canonicalized automatically; if the lookup is still
            processing, creation fails with 409 — retry with the same ID
        events:
          items:
            type: string
            enum:
              - offer.price.changed
              - offer.availability.changed
              - offer.created
              - offer.deleted
          type: array
          minItems: 1
          title: Events
          description: Offer event types to receive.
        domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Domains
          description: >-
            Restrict events to offers on these merchant domains (e.g. nike.com,
            max 25). Omitted = every offer.
        selection:
          anyOf:
            - items:
                $ref: '#/components/schemas/SelectedOption'
              type: array
              minItems: 1
            - type: 'null'
          title: Selection
          description: >-
            Pin the subscription to one variant configuration: one {name, label}
            per configurable dimension, in the shape of `variants.selected` on
            the product detail response.
      type: object
      required:
        - product_id
        - events
      title: CreateProductSubscriptionRequest
      description: >-
        What to subscribe to: a canonical product's offer events, optionally
        narrowed by merchant domains and a variant selection.
    ProductSubscriptionResponse:
      properties:
        subscription_id:
          type: string
          title: Subscription Id
        product_id:
          type: string
          title: Product Id
        events:
          items:
            type: string
            enum:
              - offer.price.changed
              - offer.availability.changed
              - offer.created
              - offer.deleted
          type: array
          title: Events
        domains:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Domains
        selection:
          anyOf:
            - items:
                $ref: '#/components/schemas/StoredSelection'
              type: array
            - type: 'null'
          title: Selection
        locale:
          $ref: '#/components/schemas/WebhookLocale'
        status:
          $ref: '#/components/schemas/ProductSubscriptionStatus'
          description: 'Lifecycle status: "active" or "cancelled"'
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - subscription_id
        - product_id
        - events
        - locale
        - status
        - created_at
      title: ProductSubscriptionResponse
      description: A product subscription's scope and lifecycle state.
    app__routers__utils__ErrorResponse:
      properties:
        detail:
          anyOf:
            - type: string
            - items:
                additionalProperties: true
                type: object
              type: array
          title: Detail
      type: object
      required:
        - detail
      title: ErrorResponse
    SelectedOption:
      properties:
        name:
          type: string
          title: Name
          description: The name of the selected option (e.g. 'Color', 'Size')
        label:
          type: string
          title: Label
          description: The display value of the selected option (e.g. 'Blue', 'XL')
      type: object
      required:
        - name
        - label
      title: SelectedOption
      description: One effective selection on a product, post server-side relaxation.
    StoredSelection:
      properties:
        name:
          type: string
          title: Name
        label:
          type: string
          title: Label
        value_key:
          type: string
          title: Value Key
      type: object
      required:
        - name
        - label
        - value_key
      title: StoredSelection
      description: >-
        One pinned variant dimension (e.g. Size = L); `value_key` is the
        standardized identifier for the value.
    WebhookLocale:
      properties:
        language:
          $ref: '#/components/schemas/LanguageCode'
        country:
          anyOf:
            - $ref: '#/components/schemas/CountryCode'
            - type: 'null'
        currency:
          $ref: '#/components/schemas/CurrencyCode'
      type: object
      required:
        - language
        - currency
      title: WebhookLocale
      description: The locale the subscription reads the product in.
    ProductSubscriptionStatus:
      type: string
      enum:
        - active
        - cancelled
      title: ProductSubscriptionStatus
    LanguageCode:
      type: string
      enum:
        - en
        - de
        - fr
        - it
        - es
        - nl
        - sv
        - fi
        - pt
        - cs
        - el
        - ro
        - pl
      title: LanguageCode
      description: ISO 639-1 language code.
    CountryCode:
      type: string
      enum:
        - US
        - GB
        - EU
        - AU
        - CA
        - IE
        - DE
        - AT
        - FR
        - BE
        - IT
        - ES
        - NL
        - SE
        - FI
        - PT
        - CZ
        - GR
        - RO
        - CH
        - PL
      title: CountryCode
      description: ISO 3166-1 alpha-2 country code (plus the pan-region ``EU``).
    CurrencyCode:
      type: string
      enum:
        - USD
        - CAD
        - AUD
        - GBP
        - EUR
        - SEK
        - CZK
        - RON
        - CHF
        - PLN
      title: CurrencyCode
      description: ISO 4217 currency code.
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````

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