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

# Create subscription

`POST /2023-10/subscription`

## Request

- Base URL: `https://api.loopsubscriptions.com/admin`
- URL: `https://api.loopsubscriptions.com/admin/2023-10/subscription`
- Auth: API key in header `X-Loop-Token`

## 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, required
    - `type` 'FIXED_AMOUNT' | 'PERCENTAGE', required
    - `value` number, float, required
    - `orderLimit` integer, required
  - `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.dev/loopwork/apis/loop-admin.md) - [All operations](https://skmtc.dev/loopwork/apis/loop-admin/llms.txt) - [OpenAPI document](https://skmtc.dev/loopwork/apis/loop-admin/revisions/1eaf81bcb1ea?raw)
