# Inqud Hosted

Users can be directed from your website or mobile application to the Inqud Hosted Page to complete subscription process.

## Prerequisites

* Your business account with Inqud is set up, complete with API tokens configured.
* The Crypto Recurring Project has been established and configured within the Inqud platform.
* Plans are created within project.

If you don't have the prerequisites in place yet, please refer to the following page:

{% content-ref url="../get-started" %}
[get-started](https://docs.inqud.com/crypto-recurring/get-started)
{% endcontent-ref %}

{% hint style="info" %}
There are two types of recurring plans: On-demand and Subscription. The integration method is different for each type, ensuring that the specific needs of each plan are met efficiently.
{% endhint %}

For details about the different plan types, please refer to the following page:

{% content-ref url="../explore/plan" %}
[plan](https://docs.inqud.com/crypto-recurring/explore/plan)
{% endcontent-ref %}

### Plan link

{% hint style="success" %}
This step applies to both subscription and on-demand plans.
{% endhint %}

Once you have created a plan, you can share a link with the end user you want to subscribe. Each plan has a unique plan ID in the following format:

```
PLAN-195cd70d-4d82-41d6-90aa-897c28126ddf
```

To create a link with this plan ID, use the following format:

```
https://recurring.inqud.com/plans/{planId}
```

For example, using the plan ID `PLAN-195cd70d-4d82-41d6-90aa-897c28126ddf`, the link would be:

<pre><code><strong>https://recurring.inqud.com/plans/PLAN-195cd70d-4d82-41d6-90aa-897c28126ddf
</strong></code></pre>

Optionally, you can pass an `orderId` within the  plan link to later distinguish between subscriptions and authorizations.

To create a link with this plan ID and order ID , use the following format:

```
https://recurring.inqud.com/plans/{planId}?orderId={orderId}
```

For example, using the plan ID `PLAN-195cd70d-4d82-41d6-90aa-897c28126ddf`  and order ID `order28126`, the link would be:

<pre><code><strong>https://recurring.inqud.com/plans/PLAN-195cd70d-4d82-41d6-90aa-897c28126ddf?orderId=order28126
</strong></code></pre>

You can share this link with your end user to allow them to subscribe to the plan directly.

### Subscription plan integration

{% hint style="info" %}
You can use "hourly" subscription plans for testing purposes
{% endhint %}

After sharing the plan link with the user and they subscribe, you will begin receiving **Subscription** webhook notifications. If you included an `orderId` in the plan link, the created **Subscription** will have this ID specified. Webhooks are triggered by any change in subscription status, so ensure you handle all subscription statuses appropriately.\
\
Subscription webhook details:

{% content-ref url="web-hooks/subscription-web-hook" %}
[subscription-web-hook](https://docs.inqud.com/crypto-recurring/integration/web-hooks/subscription-web-hook)
{% endcontent-ref %}

{% hint style="info" %}
The Subscription object and its status provide all the information you need to integrate with Inqud Recurring Subscription. Inqud will handle all recurring charge processing for you.
{% endhint %}

### On demand plan integration

After sharing the plan link with the user and they authorize spending, an **Authorization** object is created. You can receive webhook notifications for new **Authorizations**. If you included an `orderId` in the plan link, the created **Authorization** object will have this ID specified. Webhooks are triggered by any change in authorization status, so ensure you handle all authorization statuses appropriately.

Authorization webhook details:

{% content-ref url="web-hooks/authorization-web-hook" %}
[authorization-web-hook](https://docs.inqud.com/crypto-recurring/integration/web-hooks/authorization-web-hook)
{% endcontent-ref %}

You can check the current **transferable authorization balance** via the Inqud API:\
\
[Authorizations API](https://apireference.inqud.com/#tag/crypto-recurring-authorizations/operation/user_crypto-recurring_get-authorization-balance)\
\
Once you have an authorization with the status '**GRANTED**,' you can create **Invoice** to charge the user via the Inqud API:\
\
[Invoices API](https://apireference.inqud.com/#tag/crypto-recurring-invoices/operation/user_crypto-recurring_create-invoice)\
\
As invoices are processed asynchronously, you can track their status either by polling the API or by receiving invoice notifications through Webhooks.

Invoice webhook details:

{% content-ref url="web-hooks/invoice-web-hook" %}
[invoice-web-hook](https://docs.inqud.com/crypto-recurring/integration/web-hooks/invoice-web-hook)
{% endcontent-ref %}
