---
title: "Hosted Subscription Checkout Page"
source_url: https://docs.rapyd.net/en/hosted-subscription-checkout-page.html
lang: en
---

# Hosted Subscription Checkout Page

A secured page to accept your subscriptions payments.

Subscriptions are recurring transactions based on predefined billing cycles. Subscriptions work well for businesses that offer a service that can be renewed on a regular basis.

The Hosted Subscriptions Checkout Page enables you to collect recurring payments for products through the Fixed Price Plan. This hosted solution can allow you to effectively manage subscriptions for your organization, and more easily collect payments from customers by directing them to the Hosted Subscriptions Checkout Page.

Common use cases may include:

- Accepting recurring payments from your customers without having to handle their credit card information.
- Offering a subscriptions solution to other businesses or merchants without a [PCI-DSS](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_dss "Payment Card Industry Data Security Standard") certification.
- A no-code solution to generate a subscriptions page via the Client Portal.

### Hosted Subscriptions Page Example

1. Enter your payment information.
2. Enter your address and billing address.
3. Click **Subscribe**.

   ![648083a011d45.png](image/img-a72d153082c750a125bf313c7b69ff59.png)
4. Complete 3DS Verification.

   ![648083a2efec3.png](image/img-2779d5c8edba93af1c7caf0418318614.png)
5. Redirect to the **subscription success** page.
6. Click **Finish**.

> **Note:**
>
> The following payment methods are supported for the Hosted Subscription Checkout Page:
>
> - Cards
> - Bank Redirect

### Create A Subscription Page Workflow

### Step 1: Create a Product for Your Subscription

![643e7dcc20aad.jpg](image/img-4465eaf5afc27fa35438350e0f29ca4c.jpg)

1. Decide the product to use for your subscription.
2. Use [Create Product](https://docs.rapyd.net/en/create-product.md "Create Product") to generate the product that will be used in the description. See [Subscriptions - Create a Product](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") for more detail about parameters.

   **Note**: A product used in pricing plans must have their  `type` set to **service**.
3. Rapyd generates a product ID.
4. Rapyd sends a webhook response.

### Step 2: Create a Plan for Your Subscription

![643e7dcdcb593.png](image/img-7ad11efb2762d3f9d8887ef1773b4e94.jpg)

1. You decide the pricing settings for your pricing plan.
2. Use [Create Plan](https://docs.rapyd.net/en/create-plan.md "Create Plan") to generate your plan. See [Subscriptions - Create a Plan](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") for more details about parameters.
3. Rapyd generates a plan ID.
4. Rapyd sends a webhook reponse.

   **Note**: The Hosted Subscription page can only be generated with the Fixed Price Plan.

### Step 3: Create a Customer for Your Subscription.

![643e7dcf9f8b3.png](image/img-218e6aaddbd66ef2262a57701c82eb88.jpg)

1. Use [Create Customer](https://docs.rapyd.net/en/create-customer.md "Create Customer") to generate a customer through the API for your subscription.
2. You ask Rapyd to generate a customer ID. See [Subscriptions - Create a Customer Profile](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") for more details about parameters.
3. Rapyd generates a unique customer ID.

   **Note**: See Create Subscription by Hosted Page for more information on how to generate a Hosted Subscription Checkout page without Customer ID.

### Step 4: Generate a Hosted Checkout Page for Subscriptions

![643e7dd1aceb0.png](image/img-1d3462b1cf4787fa9339bd2c3aec628a.jpg)

1. You request Rapyd to generate a Hosted Subscription Checkout Page.
2. Rapyd processes your request and sends the response with the redirect URL.
3. You display the redirect URL to the customer.
4. The customer completes the payment on the hosted page.

### Hosted Subscriptions Page Message Sequences

The message sequence diagrams below describe how information is exchanged between Rapyd, the merchant, the merchant's customers, and the card network.

Create Hosted Subscription Page

![subscription-hosted-card-payment-with-automatic-capture.svg](image/img-aca8edd9e4aabf6959bb068f2ce83acf.svg)

### How the Hosted Subscriptions Page Works

Subscription payment information is collected by Rapyd through a generated hosted page. If a customer does not have a card on file, you can direct them to the Hosted Subscriptions Checkout page to collect their payment information for the subscription. In addition, you can generate multiple hosted pages and send them to different customers.

You can customize the look and feel of your page to match your brand and website experience as described in [Customizing Your Hosted Page](https://docs.rapyd.net/en/customizing-your-hosted-page.md "Customizing Your Hosted Page")

You need to complete the following steps in order to generate a Hosted Subscriptions Checkout Page:

1. [Create a Product](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") (API integration)
2. [Create a Plan](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") (Create a pricing plan for the product through API integration)
3. [Create a Customer](https://docs.rapyd.net/en/subscriptions-369196.md "Subscriptions") (API Integration or via the Client Portal)
4. Generate a Hosted Checkout Page for Subscriptions (API Integration or via the Client Portal)

### Hosted Subscriptions Page Request Parameters

The Create Subscription by Hosted Page describes the parameters in the request in greater detail.

| Body Parameter | Required | Description | Relates To |
| --- | --- | --- | --- |
| subscription_items | yes | Array of subscription items. Each item contains a plan (required) and a quantity (optional).  - Default Quantity is 1 - Quantity is relevant for licensed usage_type | Subscription Object |
| customer | yes | ID of the customer who pays for this subscription. String starting with **cus_** |  |
| billing | yes | Determines the method of billing. Set to **pay_automatically** |  |

### Generate Hosted Subscription Page Request

- - Request

    - ```
      // Request URL: GET https://sandboxapi.rapyd.net/v1/checkout/subscription
                                              
      // Message body: 
      {

          "subscription_items": [
       
              {
                  "plan": "plan_9d7bc847f1ad3fe36f389273f5e22b56",
                  "quantity": 1
              }
       
          ],
       
          "country": "US",
          "language": "EN",
          "customer": "cus_49ea9673acfbe53fac114fbf4bd94be3",
          "coupon": "coupon_da009d56dd6b7fdf4de28af673430a63",
          "billing": "pay_automatically",
          "tax_percent": 3,
          "trial_period_days": 7,
       
                  "metadata": [{
       
              "my_meta_data_key": "metadata_value"
       
          }]
       
       }
      ```

> **Note:**
>
> The `merchant_main_button` parameter in the request allows you to define the text for the main button for the Hosted Subscription page. This is for subscriptions that do not have trials.
>
> The options for the button text are:
>
> - Subscribe
> - Purchase
> - Pay
>
> When a subscription with a trial is used for the Hosted Subscription page, the default option of **Start trial** is used.

### Generate Hosted Subscriptions Page Response

Create Subscription by Hosted Page describes the fields in the response.

- - Response

    - ```
      {

      "status": {
                                                   
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "9e7ede34-9c44-494f-b833-c1734afee646"
                                                   
      },
                                                   
      "data": {
                                                   
          "id": "hp_sub_f477f7b37e66ffef1b4be5becfccea46",
          "status": "NEW",
          "cancel_url": "https://www.rapyd.net",
          "complete_url": "https://www.rapyd.net",
          "language": "en",
          "merchant_color": "",
          "merchant_logo": "",
          "merchant_website": "https://www.rapyd.net",
          "merchant_customer_support": {},
          "merchant_alias": "rap",
          "merchant_terms": "",
          "merchant_privacy_policy": "",
          "page_expiration": 1701594560,
          "redirect_url": "https://sandboxcheckout.rapyd.net/subscription?token=hp_sub_f477f7b37e66ffef1b4be5becfccea46",
          "merchant_main_button": "start_trial",
                                                   
          "subscription_items": [
                                                   
              {
                                                   
                  "id": "",
                  "plan": {
                                                   
                      "id": "09de6170-d76b-4450-8dcb-7833f5706384",
                      "tiers": [],
                      "token": "plan_9d7bc847f1ad3fe36f389273f5e22b56",
                      "amount": 100,
                      "product": null,
                      "interval": "day",

                      "metadata": {
                                                   
                          "merchant_defined": true
                                                   
                      },
                                                   
                      "nickname": "hcp",
                      "created_at": 1700384490,
                      "deleted_at": 0,
                      "tiers_mode": "",
                      "usage_type": "licensed",
                      "product_name": "HCP",
                      "product_type": "service",
                      "currency_code": "USD",
                      "product_token": "product_eb45c8152bede037911d5e99ee4bc116",
                      "billing_scheme": "per_unit",
                      "interval_count": 20,
                      "aggregate_usage": "sum",
                      "organization_id": "",
                      "transform_usage": {},
                      "product_is_active": 1,
                      "trial_period_days": 0,
                      "transform_usage_round": "up",
                      "transform_usage_divide_by": 1
                                                   
                  },
                                                   
                  "token": "",
                  "created": 0,
                  "deleted": false,
                  "prorate": true,
                  "quantity": 1,
                  "plan_token": "plan_9d7bc847f1ad3fe36f389273f5e22b56",
                  "clear_usage": false,
                  "proration_date": 0
                                                   
              }
                                                   
          ],
                                                   
          "customer": "cus_49ea9673acfbe53fac114fbf4bd94be3",
          "customer_payment_methods": [],
          "bank_redirect_customer_payment_methods": [],
          "country": "US",
          "trial_from_plan": false,
          "trial_period_days": 7,
          "tax_percent": 3,
          "billing_cycle_anchor": 0,
          "billing": "pay_automatically",
          "cancel_checkout_url": "https://www.rapyd.net",
          "complete_checkout_url": "https://www.rapyd.net",
                                                   
          "payment": {
                                                   
              "amount": null,
              "original_amount": 0,
              "is_partial": false,
              "currency_code": "",
              "country_code": "",
              "status": "",
              "description": "",
              "merchant_reference_id": "",
              "customer_token": "",
              "payment_method": "",
              "payment_method_data": {},
              "expiration": 0,
              "captured": false,
              "refunded": false,
              "refunded_amount": 0,
              "receipt_email": "",
              "complete_payment_url": "",
              "error_payment_url": "",
              "receipt_number": "",
              "flow_type": "",
              "address": null,
              "statement_descriptor": "",
              "transaction_id": "",
              "metadata": null,
              "failure_code": "",
              "failure_message": "",
              "paid": false,
              "paid_at": 0,
              "dispute": null,
              "refunds": null,
              "order": null,
              "outcome": null,
              "visual_codes": {},
              "textual_codes": {},
              "instructions": {},
              "ewallet_id": null,
              "ewallets": [],
              "payment_method_options": {},
              "payment_method_type": "",
              "payment_method_type_category": "",
              "fx_rate": "",
              "merchant_requested_currency": null,
              "merchant_requested_amount": null,
              "fixed_side": "",
              "payment_fees": null,
              "invoice": "",
              "escrow": null,
              "group_payment": "",
              "cancel_reason": null,
              "initiation_type": "",
              "mid": "",
              "next_action": "not_applicable"
                                                   
          },
                                                   
          "metadata": [
                                                   
              {
                                                   
                  "my_meta_data_key": "metadata_value"
                                                   
              }
                                                   
          ],
                                                   
          "custom_elements": {
                  
              "save_card_default": false,
              "display_description": false,
              "payment_fees_display": true,
              "merchant_currency_only": false,
              "billing_address_collect": false,
              "dynamic_currency_conversion": false
                                                   
          },
                                                   
          "payment_method_type": "",
          "coupon": "coupon_da009d56dd6b7fdf4de28af673430a63",
                                       
      }
                                                   
      }
      ```

The data for this section shows:

- The id of the subscription is **sub_f477f7b37e66ffef1b4be5becfccea46**.
- The customer’s payment method will be charged every 20 days for the units they use for the subscription service.
- The coupon ID is **coupon_da009d56dd6b7fdf4de28af673430a63**.

> **Note:**
>
> Coupons are supported for Hosted Subscription pages. Pass the ‘coupon’ parameter in the request of Create Subscription by Hosted Page with the coupon ID, starting with **coupon_**.
>
> You can also add a coupon by passing the ‘coupon’ parameter in the request of Create Customer. You then pass the Customer ID when creating the Hosted Subscription Page.
