> For the complete documentation index, see [llms.txt](https://docs.8pay.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.8pay.network/api/on-demand.md).

# On Demand

The On Demand feature facilitates customizable recurring transactions. Buyers and sellers can establish a recurring payment agreement, with the option for users to exit the arrangement at any time. Similar to a bank direct debit, this feature grants the merchant the ability to withdraw funds from the user's wallet based on agreed-upon terms, offering convenience and flexibility.

## Plans

Plans define the minimum allowance, token and reset period for subscriptions to on-demand services and products. You can create a plan using the web app or directly interacting with our smart contracts.

{% content-ref url="/pages/-Mam72LGjrA2jhFSlinb" %}
[Plans](/api/on-demand/plans.md)
{% endcontent-ref %}

## Subscriptions

Subscriptions allow you to charge customers on a recurring basis. Customers can subscribe through 8Pay’s hosted checkout pages that can be reached by embedded buttons, short urls and QR codes.

Subscriptions can be in two different statuses:

* **`ACTIVE`**: user can be charged for its usage
* **`CANCELLED`**: the subscription was cancelled by the user
* **`TERMINATED`**: the subscription was terminated by the vendor

{% content-ref url="/pages/-Mam726E\_WLIelfSwcSM" %}
[Subscriptions](/api/on-demand/subscriptions.md)
{% endcontent-ref %}

## Allowances

The allowance represents the maximum amount that can be charged for the service during each cycle.

{% content-ref url="/pages/-Mam71qEyYM9BK65SWm1" %}
[Allowances](/api/on-demand/allowances.md)
{% endcontent-ref %}

## Billings

Throughout a subscription’s cycle, the vendor can perform an unlimited number of billings as long their total sum doesn’t exceed the maximum allowance set by the user. Billings can be triggered from the webapp or the 8Pay Javascript SDK.

Billings can fail if the subscriber hasn’t got enough funds on his wallet, hasn’t enabled the token or his spending limit fo the token is too low. They can be retried at a later time.

{% content-ref url="/pages/-Mam71aC1-r5UnRHeT6M" %}
[Billings](/api/on-demand/billings.md)
{% endcontent-ref %}

## Cancellations

Customers can cancel a subscription anytime from the web app and will not be charged again. A subscription can be terminated (forcefully cancelled) anytime by plan’s admin or operational accounts, using the web app or the 8Pay Javascript SDK.

{% content-ref url="/pages/-Mam71JfM3d4YfENyYYr" %}
[Cancellations](/api/on-demand/cancellations.md)
{% endcontent-ref %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.8pay.network/api/on-demand.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
