---
title: "Create subscription"
method: POST
path: "/2023-10/subscription"
---

# Create subscription

`POST /2023-10/subscription`

## Request body

- object
  - `customerShopifyId` integer, required — The unique identifier of the customer in Shopify
  - `nextBillingDateEpoch` integer, required — Next billing date (in epoch seconds) of the subscription.
  - `currencyCode` string, required — Currency code of the subscription
  - `paymentMethodId` integer, required — ID of the payment method of the customer
  - `billingPolicy` object, required — Defines when the customer is billed, including interval (e.g., monthly, yearly), interval count, min and max cycle for billing.
    - `interval` 'DAY' | 'WEEK' | 'MONTH' | 'YEAR', required
    - `intervalCount` integer, required
    - `minCycles` integer
    - `maxCycles` integer
  - `deliveryPolicy` object, required — Specifies how often deliveries occur, including delivery interval and interval count (e.g., every 2 weeks, monthly).
    - `interval` 'DAY' | 'WEEK' | 'MONTH' | 'YEAR', required
    - `intervalCount` integer, required
  - `lines` object[], required — Specifies list of variants to be included in the subscription, each with their variantShopifyId
    - `variantShopifyId` integer, required
    - `quantity` integer, required
    - `customAttributes` object[]
      - `key` string — Key of the attribute
      - `value` string — Value of the attribute
    - `basePrice` number, float
  - `shippingAddress` object — The address where subscription orders will be delivered, including name, street, city, zip code, and country/province codes.It is required if at least one item in the order is a physical product that requires shipping.
    - `firstName` string
    - `lastName` string
    - `phone` string
    - `company` string
    - `address1` string
    - `address2` string
    - `city` string
    - `zip` string
    - `countryCode` string
    - `provinceCode` string
  - `originOrderShopifyId` integer — The Shopify order ID from which the subscription originated, used to link the subscription back to the original purchase.
  - `discountCode` string
  - `manualDiscount` object — Apply manual discount on a subscription contract
    - `title` string
    - `type` 'FIXED_AMOUNT' | 'PERCENTAGE'
    - `value` number, float
    - `orderLimit` integer
  - `customAttributes` object[] — Add subscription attributes while creating subscription
    - `key` string
    - `value` string
  - `paymentMethodShopifyId` string — Unique identifier of payment method id in Shopify.

## Response `200`

200

- object
  - `success` boolean
  - `message` string
  - `data` string
  - `code` string
  - `pageInfo` string

---

[API](https://skmtc.net/loopwork/apis/storefront-api.md) · [All operations](https://skmtc.net/loopwork/apis/storefront-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/loopwork/storefront-api/versions/1524500daa02/schema)
