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

# Subscription by Shopify Order

> Which subscription a Shopify order belongs to, and which delivery of it the order is.

Use it when your system receives an order tagged `FlowIQ Subscription` and needs the subscription's details.

## Basic Usage

```bash theme={null}
curl "https://api.flowiq.live/v1/subscriptions/by-order/6012345678901" \
  -H "Authorization: Bearer fiq_YOUR_API_KEY"
```

***

## Path Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `order_id` | string | Yes | The numeric Shopify order id (not the order name such as `#35700`). A `gid://shopify/Order/…` id is also accepted |

***

## Response

### Success (200)

```json theme={null}
{
  "organization_id": "a4234f32-…",
  "data": {
    "delivery_number": 1,
    "subscription": {
      "id": "3f2c6a1e-8b0d-4c55-9f7e-1d2a3b4c5d6e",
      "status": "active",
      "rhythm": { "label": "every 6 weeks", "interval_value": 6, "interval_unit": "weeks" },
      "next_delivery": { "delivery_number": 2, "date": "2026-12-07", "scheduled_for": "2026-12-07T08:00:02+00:00", "estimated_total": "1784.00" },
      "schedule": []
    }
  }
}
```

`subscription` is the full [subscription object](https://docs.flowapt.com/flowiq-api-reference/subscriptions.md#the-subscription-object) with its `schedule`.

### Error: Not Found (404)

```json theme={null}
{ "error": "Not found", "message": "This order is not a FlowIQ subscription order in your organization" }
```


## OpenAPI

````yaml flowiq-api-reference/openapi-subscriptions.json GET /v1/subscriptions/by-order/{order_id}
openapi: 3.1.0
info:
  title: FlowIQ Subscriptions API
  version: 1.0.0
  description: >-
    Read-only access to a store's FlowIQ subscriptions, their delivery schedule
    and upcoming deliveries.
servers:
  - url: https://api.flowiq.live
    description: FlowIQ Production API
security:
  - BearerAuth: []
tags:
  - name: Subscriptions
paths:
  /v1/subscriptions/by-order/{order_id}:
    get:
      tags:
        - Subscriptions
      summary: Subscription by Shopify Order
      description: >-
        Which subscription a Shopify order belongs to, and which delivery of it
        the order is.
      operationId: getSubscriptionByOrder
      parameters:
        - name: order_id
          in: path
          required: true
          description: >-
            The numeric Shopify order id (a gid://shopify/Order/… id is also
            accepted)
          schema:
            type: string
          example: '6012345678901'
      responses:
        '200':
          description: The subscription
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization_id:
                    type: string
                    format: uuid
                    example: a4234f32-19d5-4f09-92fe-55f00f94bea8
                  data:
                    type: object
                    properties:
                      delivery_number:
                        type: integer
                        example: 1
                      subscription:
                        type: object
                        properties:
                          test:
                            type: boolean
                            example: false
                            description: >-
                              true for a test subscription (never charged, no
                              Shopify orders)
                          id:
                            type: string
                            format: uuid
                            example: 3f2c6a1e-8b0d-4c55-9f7e-1d2a3b4c5d6e
                          status:
                            type: string
                            enum:
                              - active
                              - paused
                              - cancelled
                            example: active
                          created_at:
                            type: string
                            format: date-time
                            nullable: true
                            example: '2026-10-26T08:00:01+00:00'
                          updated_at:
                            type: string
                            format: date-time
                            nullable: true
                            example: '2026-10-26T08:00:05+00:00'
                          customer:
                            type: object
                            properties:
                              contact_id:
                                type: string
                                format: uuid
                                nullable: true
                                example: 9b8a7c6d-1e2f-4a3b-8c9d-0e1f2a3b4c5d
                              name:
                                type: string
                                nullable: true
                                example: Jane Doe
                              email:
                                type: string
                                nullable: true
                                example: jane@example.com
                              phone:
                                type: string
                                nullable: true
                                example: '27820000000'
                              shopify_customer_id:
                                type: string
                                nullable: true
                                example: '7712345678901'
                          rhythm:
                            type: object
                            properties:
                              label:
                                type: string
                                nullable: true
                                example: every 6 weeks
                              interval_value:
                                type: integer
                                example: 6
                              interval_unit:
                                type: string
                                enum:
                                  - days
                                  - weeks
                                  - months
                                example: weeks
                          items:
                            type: array
                            items:
                              type: object
                              properties:
                                variant_id:
                                  type: string
                                  example: '44112233445566'
                                sku:
                                  type: string
                                  nullable: true
                                  example: LL-MWL-15
                                title:
                                  type: string
                                  nullable: true
                                  example: Men's Weight Loss 15 pack
                                quantity:
                                  type: integer
                                  example: 1
                                unit_price:
                                  type: string
                                  nullable: true
                                  description: Rand amount as a decimal string
                                  example: '1650.00'
                          recurring_amount:
                            type: string
                            nullable: true
                            description: Rand amount as a decimal string
                            example: '1650.00'
                          currency:
                            type: string
                            example: ZAR
                          discount_ladder:
                            type: object
                            nullable: true
                            properties:
                              steps:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    from_delivery:
                                      type: integer
                                      example: 1
                                    percent:
                                      type: number
                                      example: 7.5
                              next_delivery_percent:
                                type: number
                                nullable: true
                                example: 10
                          delivery_fee:
                            type: object
                            nullable: true
                            properties:
                              amount:
                                type: string
                                nullable: true
                                description: Rand amount as a decimal string
                                example: '299.00'
                              free_over:
                                type: string
                                nullable: true
                                description: Rand amount as a decimal string
                                example: null
                          shipping_address:
                            type: object
                            nullable: true
                            description: Shopify address object
                            example:
                              first_name: Jane
                              last_name: Doe
                              address1: 1 Main Road
                              city: Gqeberha
                              province: Eastern Cape
                              zip: '6001'
                              country: South Africa
                              phone: '+27820000000'
                          next_delivery:
                            type: object
                            nullable: true
                            properties:
                              delivery_number:
                                type: integer
                                example: 2
                              date:
                                type: string
                                format: date
                                example: '2026-12-07'
                              scheduled_for:
                                type: string
                                format: date-time
                                example: '2026-12-07T08:00:02+00:00'
                              estimated_total:
                                type: string
                                nullable: true
                                description: Rand amount as a decimal string
                                example: '1784.00'
                          deliveries:
                            type: object
                            properties:
                              completed:
                                type: integer
                                example: 1
                              scheduled:
                                type: integer
                                example: 11
                              skipped:
                                type: integer
                                example: 0
                              paused:
                                type: integer
                                example: 0
                              failed:
                                type: integer
                                example: 0
                          paused_at:
                            type: string
                            nullable: true
                            example: null
                          resume_at:
                            type: string
                            nullable: true
                            example: null
                          cancelled_at:
                            type: string
                            nullable: true
                            example: null
                          cancel_reason:
                            type: string
                            nullable: true
                            example: null
                          card_on_file:
                            type: string
                            nullable: true
                            example: CONSENTED
                          schedule:
                            type: array
                            items:
                              type: object
                              properties:
                                test:
                                  type: boolean
                                  example: false
                                  description: >-
                                    true for a test subscription (never charged,
                                    no Shopify orders)
                                subscription_id:
                                  type: string
                                  format: uuid
                                  example: 3f2c6a1e-8b0d-4c55-9f7e-1d2a3b4c5d6e
                                delivery_number:
                                  type: integer
                                  nullable: true
                                  example: 2
                                  description: 1 = the first delivery
                                date:
                                  type: string
                                  format: date
                                  nullable: true
                                  example: '2026-12-07'
                                  description: South African date
                                scheduled_for:
                                  type: string
                                  format: date-time
                                  nullable: true
                                  example: '2026-12-07T08:00:02+00:00'
                                status:
                                  type: string
                                  enum:
                                    - scheduled
                                    - paused
                                    - skipped
                                    - pending
                                    - processing
                                    - completed
                                    - failed
                                    - cancelled
                                  example: scheduled
                                items:
                                  type: array
                                  items:
                                    type: object
                                    properties:
                                      variant_id:
                                        type: string
                                        example: '44112233445566'
                                      sku:
                                        type: string
                                        nullable: true
                                        example: LL-MWL-15
                                      title:
                                        type: string
                                        nullable: true
                                        example: Men's Weight Loss 15 pack
                                      quantity:
                                        type: integer
                                        example: 1
                                      unit_price:
                                        type: string
                                        nullable: true
                                        description: Rand amount as a decimal string
                                        example: '1650.00'
                                shipping_address:
                                  type: object
                                  nullable: true
                                  description: Shopify address object
                                  example:
                                    first_name: Jane
                                    last_name: Doe
                                    address1: 1 Main Road
                                    city: Gqeberha
                                    province: Eastern Cape
                                    zip: '6001'
                                    country: South Africa
                                    phone: '+27820000000'
                                shopify_order_id:
                                  type: string
                                  nullable: true
                                  example: null
                                shopify_order_name:
                                  type: string
                                  nullable: true
                                  example: null
                                charged_amount:
                                  type: string
                                  nullable: true
                                  description: Rand amount as a decimal string
                                  example: null
                                estimate:
                                  type: object
                                  nullable: true
                                  description: >-
                                    For deliveries still to come: what it would
                                    cost if charged today
                                  properties:
                                    goods:
                                      type: string
                                      nullable: true
                                      description: Rand amount as a decimal string
                                      example: '1485.00'
                                    discount_percent:
                                      type: number
                                      nullable: true
                                      example: 10
                                    discount:
                                      type: string
                                      nullable: true
                                      description: Rand amount as a decimal string
                                      example: '165.00'
                                    delivery_fee:
                                      type: string
                                      nullable: true
                                      description: Rand amount as a decimal string
                                      example: '299.00'
                                    total:
                                      type: string
                                      nullable: true
                                      description: Rand amount as a decimal string
                                      example: '1784.00'
                                failure_reason:
                                  type: string
                                  nullable: true
                                  example: null
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
                  message:
                    type: string
                    example: Invalid API key
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Forbidden
                  message:
                    type: string
                    example: This connection does not have "read" permission
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Not found
                  message:
                    type: string
                    example: >-
                      This order is not a FlowIQ subscription order in your
                      organization
        '429':
          description: Rate limited
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Rate limited
                  message:
                    type: string
                    example: 240 requests per minute per key.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: fiq_ API key
      description: >-
        Your FlowIQ organisation API key (Settings → API Keys), sent as a bearer
        token. Format: `Bearer fiq_YOUR_API_KEY`

````

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