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

# List subscriptions

> Returns a list of subscriptions.



## OpenAPI

````yaml openapi-admin.json GET /subscriptions
openapi: 3.1.0
info:
  version: 8.15.0
  title: '@fastify/swagger'
servers:
  - url: https://api.juo.io/admin/v1
security:
  - AdminApiKey: []
paths:
  /subscriptions:
    get:
      tags:
        - api.admin.v1
      description: Lists subscriptions
      parameters:
        - schema:
            type: string
          in: query
          name: query
          required: false
          description: >-
            The search query string. See [search query
            language](/docs/api-reference/admin/introduction#search-query-language)
            for information how to build the search query. Supported fields are
            listed
            [here](/docs/api-reference/admin/subscriptions/resource#search-query-fields).
        - schema:
            minimum: 1
            maximum: 100
            default: 20
            type: integer
          in: query
          name: limit
          required: false
          description: >-
            See [pagination](/docs/api-reference/admin/introduction#pagination)
            for more details on how to paginate the results.
        - schema:
            minLength: 1
            type: string
          in: query
          name: after
          required: false
          description: >-
            See [pagination](/docs/api-reference/admin/introduction#pagination)
            for more details on how to paginate the results.
        - schema:
            minLength: 1
            type: string
          in: query
          name: before
          required: false
          description: >-
            See [pagination](/docs/api-reference/admin/introduction#pagination)
            for more details on how to paginate the results.
        - schema:
            default: createdAt:asc
            type: string
          in: query
          name: sort
          required: false
          description: >-
            See [sorting](/docs/api-reference/admin/introduction#sorting) for
            more details on how to sort the results.
        - schema:
            type: array
            items:
              type: string
              enum:
                - customer
          in: query
          name: expand
          required: false
          description: >-
            Specify which related resources to include in the response.
            Currently supports 'customer'.
        - schema:
            default: false
            type: boolean
          in: query
          name: includeCanceledItems
          required: false
          description: Whether to include canceled subscriptions in the results.
        - $ref: '#/components/parameters/TenantHeader'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  resource:
                    type: string
                    enum:
                      - list
                  hasNextPage:
                    type: boolean
                  hasPrevPage:
                    type: boolean
                  endCursor:
                    type:
                      - 'null'
                      - string
                  startCursor:
                    type:
                      - 'null'
                      - string
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscription'
                required:
                  - resource
                  - hasNextPage
                  - hasPrevPage
                  - endCursor
                  - startCursor
                  - data
components:
  parameters:
    TenantHeader:
      name: X-Tenant-ID
      x-speakeasy-name-override: tenant
      x-speakeasy-globals-hidden: true
      in: header
      schema:
        type: string
      required: false
      description: >-
        Unique identifier of the tenant in the system (usually a store
        identifier)
  schemas:
    Subscription:
      type: object
      properties:
        id:
          format: uuid
          type: string
        resource:
          type: string
          enum:
            - subscription
        serial:
          minLength: 1
          description: >-
            Unique serial number that increments sequentially with each new
            subscription within a store.
          type: string
        status:
          type: string
          enum:
            - active
            - paused
            - canceled
            - failed
            - expired
            - merged
        createdAt:
          format: date-time
          description: Purchase date of the subscription.
          type: string
        updatedAt:
          format: date-time
          description: Last update date of the subscription.
          type: string
        canceledAt:
          format: date-time
          description: Cancellation date of the subscription.
          type:
            - 'null'
            - string
        nextBillingDate:
          format: date-time
          description: >-
            The next billing date determines when the renewal process begins its
            billing phase. When billing succeeds, it creates one order—or
            multiple orders for prepaid subscriptions.
          type:
            - 'null'
            - string
        currentCycle:
          minimum: 0
          description: >-
            The subscription's billing cycle count. It starts at 0 (before the
            first billing is completed), changes to 1 (after one billing is
            completed), and increases by 1 with each subsequent billing.
          type: integer
        currencyCode:
          minLength: 3
          maxLength: 3
          description: The currency that applies to both item prices and delivery price.
          type: string
        billingPolicy:
          type: object
          properties:
            interval:
              type: string
              enum:
                - DAY
                - MONTH
                - WEEK
                - YEAR
            intervalCount:
              minimum: 1
              type: integer
          required:
            - interval
            - intervalCount
        deliveryPolicy:
          type: object
          properties:
            interval:
              type: string
              enum:
                - DAY
                - MONTH
                - WEEK
                - YEAR
            intervalCount:
              minimum: 1
              type: integer
          required:
            - interval
            - intervalCount
        deliveryMethod:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - shipping
                    - local-delivery
                    - pickup
                title:
                  type:
                    - 'null'
                    - string
                description:
                  type:
                    - 'null'
                    - string
              required:
                - type
                - title
                - description
        customer:
          description: This field is expandable.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
        items:
          minItems: 1
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionItem'
        discounts:
          type: array
          items:
            $ref: '#/components/schemas/SubscriptionDiscount'
        paymentMethod:
          description: This field is expandable.
          anyOf:
            - format: uuid
              type: string
            - $ref: '#/components/schemas/CustomerPaymentMethod'
            - type: 'null'
        deliveryAddress:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                firstName:
                  minLength: 1
                  description: Customer's first name.
                  type:
                    - 'null'
                    - string
                lastName:
                  minLength: 1
                  description: Customer's last name.
                  type:
                    - 'null'
                    - string
                address1:
                  minLength: 1
                  description: Primary street address.
                  type:
                    - 'null'
                    - string
                address2:
                  minLength: 1
                  description: Additional address information (apartment, suite, etc.)
                  type:
                    - 'null'
                    - string
                zip:
                  minLength: 1
                  description: Postal/ZIP code.
                  type:
                    - 'null'
                    - string
                city:
                  minLength: 1
                  description: City name.
                  type:
                    - 'null'
                    - string
                country:
                  minLength: 1
                  description: Full country name.
                  type:
                    - 'null'
                    - string
                countryCode:
                  minLength: 2
                  maxLength: 2
                  description: Two-letter country code (ISO 3166-1).
                  type:
                    - 'null'
                    - string
                provinceCode:
                  minLength: 1
                  description: Province/state code.
                  type:
                    - 'null'
                    - string
                province:
                  minLength: 1
                  description: Full province/state name.
                  type:
                    - 'null'
                    - string
                phone:
                  minLength: 1
                  description: Contact phone number.
                  type:
                    - 'null'
                    - string
                company:
                  minLength: 1
                  description: Company name.
                  type:
                    - 'null'
                    - string
              required:
                - firstName
                - lastName
                - address1
                - address2
                - zip
                - city
                - country
                - countryCode
                - provinceCode
                - province
                - phone
                - company
              title: Address
        deliveryPrice:
          minimum: 0
          description: The delivery price for the upcoming renewal.
          type: number
      required:
        - id
        - resource
        - serial
        - status
        - createdAt
        - updatedAt
        - canceledAt
        - nextBillingDate
        - currentCycle
        - currencyCode
        - billingPolicy
        - deliveryPolicy
        - deliveryMethod
        - customer
        - items
        - discounts
        - paymentMethod
        - deliveryAddress
        - deliveryPrice
      title: Subscription
    Customer:
      type: object
      properties:
        id:
          minLength: 1
          type: string
        resource:
          type: string
          enum:
            - customer
        displayName:
          minLength: 1
          description: Customer's full name.
          type: string
        email:
          format: email
          description: Customer's contact email.
          type:
            - 'null'
            - string
        phone:
          minLength: 1
          description: Customer's contact phone.
          type:
            - 'null'
            - string
      required:
        - id
        - resource
        - displayName
        - email
        - phone
      title: Customer
    SubscriptionItem:
      type: object
      properties:
        id:
          format: uuid
          type: string
        resource:
          type: string
          enum:
            - subscription-item
        title:
          minLength: 1
          type: string
        subtitle:
          minLength: 1
          description: Matches the variant title in most cases
          type:
            - 'null'
            - string
        quantity:
          minimum: 1
          type: integer
        totalPrice:
          minimum: 0
          description: Final item price including all discounts and taxes
          type: number
        recurringCycleLimit:
          minimum: 1
          description: >-
            The number of billing cycles for which this item will be applied.
            After the recurring cycle limit is met the item will be removed from
            the subscription.
          type:
            - 'null'
            - integer
        canceledAt:
          format: date-time
          description: Cancellation date of the item.
          type:
            - 'null'
            - string
        billingPolicy:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                interval:
                  anyOf:
                    - type: string
                      enum:
                        - DAY
                    - type: string
                      enum:
                        - WEEK
                    - type: string
                      enum:
                        - MONTH
                    - type: string
                      enum:
                        - YEAR
                intervalCount:
                  minimum: 1
                  maximum: 365
                  type: integer
                anchors:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - WEEKDAY
                          - type: string
                            enum:
                              - MONTHDAY
                          - type: string
                            enum:
                              - YEARDAY
                      day:
                        minimum: 1
                        maximum: 31
                        type: integer
                      month:
                        minimum: 1
                        maximum: 12
                        type:
                          - 'null'
                          - integer
                      cutoffDay:
                        minimum: 1
                        maximum: 31
                        type:
                          - 'null'
                          - integer
                    required:
                      - type
                      - day
                      - month
                      - cutoffDay
                minCycles:
                  minimum: 1
                  type:
                    - 'null'
                    - integer
                maxCycles:
                  minimum: 1
                  type:
                    - 'null'
                    - integer
              required:
                - interval
                - intervalCount
                - anchors
                - minCycles
                - maxCycles
              title: BillingPolicy
        deliveryPolicy:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                interval:
                  anyOf:
                    - type: string
                      enum:
                        - DAY
                    - type: string
                      enum:
                        - WEEK
                    - type: string
                      enum:
                        - MONTH
                    - type: string
                      enum:
                        - YEAR
                intervalCount:
                  minimum: 1
                  maximum: 365
                  type: integer
                anchors:
                  type: array
                  items:
                    type: object
                    properties:
                      type:
                        anyOf:
                          - type: string
                            enum:
                              - WEEKDAY
                          - type: string
                            enum:
                              - MONTHDAY
                          - type: string
                            enum:
                              - YEARDAY
                      day:
                        minimum: 1
                        maximum: 31
                        type: integer
                      month:
                        minimum: 1
                        maximum: 12
                        type:
                          - 'null'
                          - integer
                      cutoffDay:
                        minimum: 1
                        maximum: 31
                        type:
                          - 'null'
                          - integer
                    required:
                      - type
                      - day
                      - month
                      - cutoffDay
              required:
                - interval
                - intervalCount
                - anchors
              title: DeliveryPolicy
        variant:
          description: This field is expandable.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/ProductVariant'
            - type: 'null'
        product:
          description: This field is expandable.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/Product'
            - type: 'null'
      required:
        - id
        - resource
        - title
        - subtitle
        - quantity
        - totalPrice
        - recurringCycleLimit
        - canceledAt
        - billingPolicy
        - deliveryPolicy
        - variant
        - product
      title: SubscriptionItem
    SubscriptionDiscount:
      type: object
      properties:
        id:
          format: uuid
          type: string
        resource:
          type: string
          enum:
            - subscription-discount
        title:
          minLength: 1
          description: >-
            The title of the discount shown to customers, typically displayed as
            a discount code.
          type:
            - 'null'
            - string
        target:
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - shipping
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - line
                selector:
                  anyOf:
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - all
                      required:
                        - type
                    - type: object
                      properties:
                        type:
                          type: string
                          enum:
                            - some
                        lines:
                          type: array
                          items:
                            format: uuid
                            type: string
                      required:
                        - type
                        - lines
              required:
                - type
                - selector
        value:
          anyOf:
            - type: object
              properties:
                amount:
                  exclusiveMinimum: 0
                  type: number
                type:
                  type: string
                  enum:
                    - fixed-amount
                appliesOnEachItem:
                  description: >-
                    When true, the amount will be proportionally split among all
                    the items.
                  type: boolean
              required:
                - amount
                - type
                - appliesOnEachItem
            - type: object
              properties:
                percentage:
                  exclusiveMinimum: 0
                  maximum: 100
                  type: number
                type:
                  type: string
                  enum:
                    - percentage
              required:
                - percentage
                - type
        recurringCycleLimit:
          minimum: 1
          description: >-
            The number of billing cycles for which this discount will be
            applied. After the recurring cycle limit is met the discount will be
            removed from the subscription.
          type:
            - 'null'
            - integer
      required:
        - id
        - resource
        - title
        - target
        - value
        - recurringCycleLimit
      title: SubscriptionDiscount
    CustomerPaymentMethod:
      type: object
      properties:
        id:
          format: uuid
          type: string
        customer:
          description: This field is expandable.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/Customer'
        instrument:
          anyOf:
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - credit-card
                brand:
                  minLength: 1
                  description: Credit card network name.
                  type: string
                maskedNumber:
                  minLength: 1
                  description: Masked card number.
                  type: string
              required:
                - type
                - brand
                - maskedNumber
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - paypal
                paypalAccountEmail:
                  format: email
                  description: Email of the associated PayPal account.
                  type:
                    - 'null'
                    - string
              required:
                - type
                - paypalAccountEmail
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - shop-pay
                maskedNumber:
                  minLength: 1
                  description: Masked card number.
                  type: string
              required:
                - type
                - maskedNumber
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - sepa-direct-debit
                consumerName:
                  minLength: 1
                  description: Full name of the account holder.
                  type: string
                consumerBic:
                  minLength: 1
                  description: BIC code.
                  type:
                    - 'null'
                    - string
                maskedConsumerAccount:
                  minLength: 1
                  description: Masked IBAN.
                  type: string
              required:
                - type
                - consumerName
                - consumerBic
                - maskedConsumerAccount
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - blik
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - mbway
                phone:
                  minLength: 1
                  type: string
              required:
                - type
            - type: object
              properties:
                type:
                  type: string
                  enum:
                    - bacs
                maskedNumber:
                  minLength: 1
                  description: Masked number.
                  type: string
              required:
                - type
                - maskedNumber
      required:
        - id
        - customer
      title: CustomerPaymentMethod
    ProductVariant:
      type: object
      properties:
        id:
          minLength: 1
          type: string
        title:
          minLength: 1
          type: string
        image:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                id:
                  minLength: 1
                  type: string
                url:
                  format: uri
                  type: string
                altText:
                  minLength: 1
                  type:
                    - 'null'
                    - string
              required:
                - id
                - url
                - altText
        price:
          type: number
        purchaseOptions:
          type: array
          items:
            type: object
            properties:
              name:
                minLength: 1
                type: string
              price:
                type: number
              interval:
                type: object
                properties:
                  intervalCount:
                    type: number
                  interval:
                    type: string
                    enum:
                      - DAY
                      - MONTH
                      - WEEK
                      - YEAR
                required:
                  - intervalCount
                  - interval
            required:
              - name
              - price
              - interval
        product:
          description: This field is expandable.
          anyOf:
            - minLength: 1
              type: string
            - $ref: '#/components/schemas/Product'
        planGroups:
          description: Subscription plan group IDs associated with this variant
          type: array
          items:
            minLength: 1
            type: string
      required:
        - id
        - title
        - image
        - price
        - purchaseOptions
        - product
        - planGroups
      title: ProductVariant
    Product:
      type: object
      properties:
        id:
          minLength: 1
          type: string
        title:
          minLength: 1
          type: string
        image:
          oneOf:
            - type: 'null'
            - type: object
              properties:
                id:
                  minLength: 1
                  type: string
                url:
                  format: uri
                  type: string
                altText:
                  minLength: 1
                  type:
                    - 'null'
                    - string
              required:
                - id
                - url
                - altText
        collections:
          type: array
          items:
            type: object
            properties:
              handle:
                minLength: 1
                type: string
            required:
              - handle
        planGroups:
          description: Subscription plan group IDs associated with this product
          type: array
          items:
            minLength: 1
            type: string
      required:
        - id
        - title
        - image
        - collections
        - planGroups
      title: Product
  securitySchemes:
    AdminApiKey:
      type: apiKey
      name: X-Juo-Admin-Api-Key
      in: header

````