---
updatedAt: 2026-08-20T17:10:47.000Z
agentTools:
  projectIndex: https://docs.stay.ai/llms.txt
---

# Create Subscription

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "subscriptions",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://api.retextion.com/api/v2/subscriptions"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "X-RETEXTION-ACCESS-TOKEN",
        "x-default": "{{APP_API_KEY}}"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/": {
      "post": {
        "summary": "Create Subscription",
        "description": "",
        "operationId": "create-subscription",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customerId",
                  "paymentMethodId",
                  "status",
                  "currencyCode",
                  "nextBillingDate",
                  "deliveryPrice",
                  "billingPolicy",
                  "shippingAddress",
                  "lines"
                ],
                "properties": {
                  "customerId": {
                    "type": "string",
                    "description": "Shopify Customer ID"
                  },
                  "paymentMethodId": {
                    "type": "string",
                    "description": "Shopify Customer Payment Method ID"
                  },
                  "status": {
                    "type": "string",
                    "description": "Subscription Status",
                    "enum": [
                      "ACTIVE",
                      "PAUSED",
                      "CANCELLED"
                    ]
                  },
                  "currencyCode": {
                    "type": "string",
                    "description": "Currency Code"
                  },
                  "nextBillingDate": {
                    "type": "integer",
                    "description": "Next Billing Date",
                    "format": "int64"
                  },
                  "deliveryPrice": {
                    "type": "number",
                    "description": "Delivery Price",
                    "format": "float"
                  },
                  "billingPolicy": {
                    "type": "object",
                    "description": "Billing Policy",
                    "properties": {
                      "interval": {
                        "type": "string",
                        "description": "Billing Interval",
                        "enum": [
                          "DAY",
                          "WEEK",
                          "MONTH",
                          "YEAR"
                        ]
                      },
                      "intervalCount": {
                        "type": "integer",
                        "description": "Interval Count",
                        "format": "int32"
                      }
                    }
                  },
                  "shippingAddress": {
                    "type": "object",
                    "description": "Shipping Address",
                    "required": [
                      "firstName",
                      "lastName",
                      "address1",
                      "city",
                      "provinceCode",
                      "countryCode",
                      "zip"
                    ],
                    "properties": {
                      "firstName": {
                        "type": "string",
                        "description": "First Name"
                      },
                      "lastName": {
                        "type": "string",
                        "description": "Last Name"
                      },
                      "address1": {
                        "type": "string",
                        "description": "Address 1"
                      },
                      "address2": {
                        "type": "string",
                        "description": "Address 2"
                      },
                      "company": {
                        "type": "string",
                        "description": "Company"
                      },
                      "city": {
                        "type": "string",
                        "description": "City"
                      },
                      "provinceCode": {
                        "type": "string",
                        "description": "Province Code"
                      },
                      "countryCode": {
                        "type": "string",
                        "description": "Country Code"
                      },
                      "zip": {
                        "type": "string",
                        "description": "Zip Code"
                      },
                      "phone": {
                        "type": "string",
                        "description": "Phone Number"
                      }
                    }
                  },
                  "lines": {
                    "type": "array",
                    "description": "Subscription Lines",
                    "items": {
                      "properties": {
                        "productVariantId": {
                          "type": "string",
                          "description": "Shopify Product Variant GID"
                        },
                        "currentPrice": {
                          "type": "number",
                          "description": "Unit Price of Product Variant",
                          "format": "float"
                        },
                        "quantity": {
                          "type": "integer",
                          "description": "Quantity of Product Variant",
                          "format": "int32"
                        },
                        "sellingPlanId": {
                          "type": "string",
                          "description": "Shopify Selling Plan GID"
                        },
                        "isOneTime": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "productVariantId",
                        "currentPrice",
                        "quantity"
                      ],
                      "type": "object"
                    }
                  },
                  "orderNotes": {
                    "type": "string",
                    "description": "The contents of the note associated with the order"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"id\": \"gid://shopify/SubscriptionContract/3088646395\",\n  \"createdAt\": \"2021-11-16T16:15:13Z\",\n  \"status\": {\n    \"status\": \"PAUSED\",\n    \"pausedUntil\": \"2022-09-22T00:00:00.000Z\"\n  },\n  \"currencyCode\": \"USD\",\n  \"lineCount\": 1,\n  \"nextBillingDate\": \"2022-09-27T16:00:00.000Z\",\n  \"discounts\": {\n    \"edges\": [\n      {\n        \"node\": {\n          \"value\": {\n            \"percentage\": 100\n          },\n          \"id\": \"gid://shopify/SubscriptionManualDiscount/90fd0695-d3fc-46a6-8eee-6b767d2cfb7c\",\n          \"type\": \"CODE_DISCOUNT\",\n          \"title\": \"MYREDEEMCODE\",\n          \"targetType\": \"LINE_ITEM\"\n        }\n      }\n    ]\n  },\n  \"deliveryPrice\": {\n    \"amount\": \"4.9\",\n    \"currencyCode\": \"USD\"\n  },\n  \"customer\": {\n    \"id\": \"gid://shopify/Customer/5819682554107\",\n    \"firstName\": \"Test\",\n    \"lastName\": \"Customer\",\n    \"email\": \"testcustomer@gmail.com\"\n  },\n  \"billingPolicy\": {\n    \"interval\": \"WEEK\",\n    \"intervalCount\": 1,\n    \"anchors\": []\n  },\n  \"deliveryMethod\": {\n    \"address\": {\n      \"address1\": \"860 Solimar Way 1\",\n      \"address2\": \"\",\n      \"city\": \"Mary Esther\",\n      \"company\": null,\n      \"country\": \"United States\",\n      \"countryCode\": \"US\",\n      \"firstName\": \"Test\",\n      \"lastName\": \"Customer\",\n      \"phone\": \"(555) 555-5555\",\n      \"province\": \"Florida\",\n      \"provinceCode\": \"FL\",\n      \"zip\": \"55555\"\n    }\n  },\n  \"lines\": [\n    {\n      \"id\": \"gid://shopify/SubscriptionLine/5de77699-db23-453c-b5e7-34dff32a8cf3\",\n      \"title\": \"Test Product\",\n      \"quantity\": 1,\n      \"customAttributes\": [],\n      \"currentPrice\": {\n        \"amount\": \"1.0\",\n        \"currencyCode\": \"USD\"\n      },\n      \"lineDiscountedPrice\": {\n        \"amount\": \"0.0\",\n        \"currencyCode\": \"USD\"\n      },\n      \"productId\": \"gid://shopify/Product/7333018239227\",\n      \"sellingPlanId\": \"gid://shopify/SellingPlan/2415165691\",\n      \"variantId\": \"gid://shopify/ProductVariant/41675008704763\",\n      \"variantTitle\": \"Default\",\n      \"variantImage\": {\n        \"altText\": null,\n        \"originalSrc\": \"https://cdn.shopify.com/s/files/1/0604/7111/6027/products/OIP.jpg?v=1639967903\"\n      },\n      \"isOneTime\": false\n    }\n  ],\n  \"assignedPricingPolicy\": null,\n  \"scheduledBillingDate\": \"2022-09-27T16:00:00.000Z\",\n  \"shopifyOrders\": [\n    {\n      \"createdAt\": \"2022-08-30T15:02:35.675Z\",\n      \"shopifyOrderId\": \"gid://shopify/Order/4860061581563\"\n    },\n    ...\n  ],\n  \"sellingPlanGroupData\": {\n    \"id\": \"ckym2ip431698q6oslyyuhti3\",\n    \"createdAt\": \"2022-01-19T21:39:28.803Z\",\n    \"updatedAt\": \"2022-03-07T16:23:13.738Z\",\n    \"customLabel\": \"Test SPG\",\n    \"customDescription\": \"Test SPG\",\n    \"shopifySellingPlanGroupId\": \"gid://shopify/SellingPlanGroup/686620923\",\n    \"bundleMinimum\": 0,\n    \"bundleMaximum\": 0,\n    \"accountId\": \"ckw2ahw5s0002opos991i1num\",\n    \"groupType\": \"STANDARD\",\n    \"anchors\": [],\n    \"sellingPlans\": [\n      {\n        \"id\": \"ckym2ip431699q6os7efxt7b0\",\n        \"createdAt\": \"2022-01-19T21:39:28.803Z\",\n        \"updatedAt\": \"2022-03-07T16:23:14.059Z\",\n        \"shopifySellingPlanId\": \"gid://shopify/SellingPlan/2415165691\",\n        \"billingPolicy\": {\n          \"interval\": \"WEEK\",\n          \"intervalCount\": 1\n        },\n        \"deliveryPolicy\": {\n          \"interval\": \"WEEK\",\n          \"intervalCount\": 1\n        },\n        \"pricingPolicies\": [\n          {\n            \"adjustmentType\": \"FIXED_AMOUNT\",\n            \"adjustmentValue\": {\n              \"amount\": \"0.0\",\n              \"currencyCode\": \"USD\"\n            }\n          }\n        ],\n        \"options\": \"Weekly\",\n        \"sellingPlanGroupId\": \"ckym2ip431698q6oslyyuhti3\"\n      }\n    ]\n  }\n}"
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "x-internal": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```