> For the complete documentation index, see [llms.txt](https://docs.commercelayer.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.commercelayer.io/how-tos/placing-orders/subscriptions.md).

# Subscriptions

How to generate scheduled recurring orders from a source order

Subscriptions allow merchants to offer regular purchases of a product or group of products, resulting in predictable, recurring revenue and increasing both acquisition and retention. A flexible subscription model provides an affordable way for consumers to access what they want when they want it and a direct-to-consumer experience that attracts, retains, and benefits customers long-term.

Commerce Layer's [subscriptions](https://commercelayer.io/docs/data-model/subscriptions-and-order-copies) are defined by market, thus market-specific subscription strategies. Commerce Layer lets you handle subscription generation both [automatically](/core-api-reference/order_subscriptions.md#automatic-order-subscription-generation) (the recommended and most common usage) and [manually](/core-api-reference/order_subscriptions.md#manual-order-subscription-generation).

<details>

<summary>Data model</summary>

Check the related [ER diagram](https://commercelayer.io/docs/data-model/subscriptions-and-order-copies) and explore the flowchart that illustrates how the order subscription resource relates to the other API entities.

</details>

This guide will walk you through the steps you need to follow to correctly setup the available subscription frequencies and strategies for your markets and trigger **automatic** subscription generation starting from a source order:

1. Create a [subscription model](/core-api-reference/subscription_models.md) and associate it with a market.
2. Create a source order containing at least one line item that has a [frequency](/core-api-reference/line_items.md#choosing-line-items-that-generate-subscriptions) and place it.
3. Update the source order by sending a specific [trigger attribute](/core-api-reference/orders.md#automatic-subscriptions-generation) to start the order subscription generation.
4. Eventually, edit the automatically generated subscriptions to change the next subscription runs.

{% hint style="info" %}
Commerce Layer's subscription management can be offered to [registered customers](/core/roles-and-permissions.md#password) only. All the API calls in this guide are supposed to be authenticated with a **customer token** obtained via the [password flow](/core/authentication/password.md) (unless where specified differently). See the [Authentication](/core/authentication.md) and [Applications](/core/api-credentials.md) sections of our documentation if you need more information on how to get an access token for your client or about the different types of credentials you can get.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.commercelayer.io/how-tos/placing-orders/subscriptions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
