# Basic integration This topic describes a basic means of integrating Rebilly into your application and is aimed at a non-developer audience. For all other integrations, see [Developer docs — Get started](/docs/dev-docs#get-started). If Rebilly is already integrated into your application, website, or checkout flow, and you would like to learn how to use it, see [Usage guides](/docs/tutorials/tutorials#usage-guides). This tutorial describes how to create a subscription product for an internet service, which is prepaid at a fee of $50.00 per month for 12 months, and includes a setup fee and a 2-week free trial. This tutorial also describes how to create a one-time sale item for an internet router with a shipping rate in USD. This sale is separate from the subscription. In this tutorial, you create an order, collect payment, and view the related invoice. ## Step 1: Log in or sign up 1. [Log in or sign up](https://app.rebilly.com/) to Rebilly. 2. Select an environment: In the top right corner of the page, press your initials and then select **Sandbox** or **Live** environment. Rebilly environments are separate and do not share data or settings. For example, if you create a hosted payment form and add a payment gateway in the sandbox environment, you must repeat this process in the live environment. - Sandbox: Use this environment to test and experiment without creating any real charges. - Live: Use this environment to create a live checkout that is used by your customers. ## Step 2: Add a payment gateway This step describes how to add a payment gateway account to Rebilly and configure it to accept payments made using a payment card. A [payment gateway](/docs/glossary#payment-gateway) is a service which enables a business to receive payments from customers to their [merchant bank account](/docs/glossary#merchant-account). For more information on gateway accounts, and how to configure them, see [Gateway accounts](/docs/settings/payment-gateway). - This step is optional in the sandbox environment. The sandbox environment is pre-configured with a test gateway account. If you want to experiment in the sandbox and do not want to add a payment gateway, skip this step and proceed to [Step 3](#step-3-create-a-subscription-product-and-pricing-plan). - To complete this tutorial in the live environment, you must have payment gateway account credentials. 1. In the left navigation bar, press . 2. In the **Configuration** section, press **Gateway accounts**. 3. Press **Add gateway account**, then select a gateway account. 4. In the **Gateway account ID** field, enter a unique alphanumeric value. Use a value that is recognizable in your reports. 5. Enter your gateway account credentials. 6. In the **Payment methods** section, in the **Select a payment method** dropdown, select **payment-card**. 7. Optionally, [Configure advanced gateway settings](/docs/settings/set-up-a-gateway). 8. Press **Save gateway account**. ## Step 3: Create a subscription product and pricing plan This step creates a subscription product and pricing plan for an internet subscription service, which is prepaid at a fee of $50.00 per month for 12 months. This subscription includes a set up fee of $50 and a free trial period of 2 weeks. In Rebilly, products are the items that your business sells. Pricing plans are how your customers pay for the products. For more information, see [Products & pricing plans](/docs/settings/products-and-pricing). ### 3.1: Create a subscription product 1. In the left navigation bar, press . 2. In the **Pricing** section, press **Product & pricing plans**. 3. On the right of the screen, press **Add product**. 4. In the Product name field, enter `Internet subscription`. 5. In the Description field, enter `Internet subscription that is charged monthly.`. 6. Select the **Taxes** checkbox. 7. In the **Tax category ID** field, select **Software as a service (30070)**. 8. Press **Create pricing plan**. You are redirected to the **Create pricing plan** page. ### 3.2: Create a subscription pricing plan If you are not redirected to the **Create pricing plan** page: In the left navigation bar, press , **Products & pricing plans**, press the **Internet subscription** product, then press **Create pricing plan**. 1. In the **Name** field, enter `Monthly internet subscription & free trial + install fee`. 2. Select **Recurring**. 3. In the **Pricing formula** dropdown, select **Fixed fee**. For detailed information on pricing plans, see [Pricing formulas](/docs/settings/pricing-formulas). 4. In the **Price** field, enter `50.00`. 5. In the **Recurring settings** section, under **Recurs** select **Limited to**, and in the **Periods** field, enter `12`. This specifies that there are a total of 12 payments in the subscription. 6. In the **Recurring period** field, enter `1` and in the dropdown, select **Month**. This specifies that the subscription is billed each month. 7. In the **Trial** section, select the **Activate trial** checkbox. 8. In the **Trial period** field, enter `2`. 9. In the dropdown, select **Weeks**. 10. In the **Trial price** field, enter `0`. The above four steps add a free trial of two weeks. 11. In the **Setup fee** section, select the **Use setup fee** checkbox. 12. In the **Setup price** field, enter `25.00`. This specifies a one-time set up fee of 25.00. 13. Press **Create pricing plan**. ## Step 4: Create a one-time sale product and pricing plan This step creates a one-time sale item for the sale of a router, which includes a shipping rate for orders made in US dollars, and also includes US taxes. ### 4.1: Create a one-time sale product 1. In the left navigation bar, press . 2. In the **Pricing** section, press **Product & pricing plans**. 3. On the right of the screen, press **Add product**. 4. In the Product name field, enter `Router`. 5. In the Description field, enter `Internet router.`. 6. Select the **Taxes** checkbox. 7. In the **Tax category ID** field, select **Digital goods (31000)**. 8. In the **Fulfillment** section, select the **Shippable** checkbox. 9. Press **Create pricing plan**. You are redirected to the **Create pricing plan** page. ### 4.2: Create a one-time pricing plan This step describes how to create a one-time pricing plan for the product you added in the [previous step](#4.1-create-a-one-time-sale-product). 1. In the **Name** field, enter `Internet router`. 2. Under **Type**, select the **One time sale option**. 3. In the **Pricing** section, in the **Pricing formula** dropdown, select **Flat rate**. For detailed information on pricing plans, see [Products & pricing plans](/docs/settings/products-and-pricing). 4. In the **Price** field, enter `60.00`. This is the sale price of the router. 5. Press **Create pricing plan**. ## Step 5: Create an order and collect payment This step describes how to create an order and pay the related invoice. Rebilly enables merchants to manage and automate recurring payments, products and pricing, invoicing, and subscriptions. ### 5.1: Create a customer This step describes how to add a new customer to Rebilly. For a complete list of customer interactions, and how to complete them, see [Manage customers](/docs/data-tables/manage-customers). 1. In the left navigation bar, click , then click **Customers**. 2. In the right of the page, click **Add customer**. 3. Enter the following customer details: - ID: `charlie-sullivan` - First name: `Charlie` - Last name: `Sullivan` - Organization: `Sullivan Inc` - Address line 1: `34 South Independence Mall West` - City: `Philadelphia` - Country: `United States` - Region: `Pennsylvania` - Postal/Zip code: `19106` - Email: `charlie.sullivan@gmail.com` 4. In the **Default payment instrument** section, select **None**. 5. At the bottom the page, click **Save customer**. ### 5.2: Create an order on a customer's account This step describes how to add an order to a customer's account. It creates an invoice with an `unpaid` status. For more information on the invoice cycle and statuses, see [Invoice lifecycle](/docs/dev-docs/invoices#invoice-lifecycle). An order is a customer's request to purchase items. It can contain subscription and one-time sale items. For a complete list of billing interactions, and how to complete them, see [Billing](/docs/data-tables/manage-billing). 1. In the left navigation bar, click , then click **Customers**. 2. Click **Customers**, then in the **Name** column, click **Charlie Sullivan**. 3. In the top right of the screen, click , then click **Create order**. 4. In the **Order type** section, select **Subscription order**. 5. In the **Products and plans** section, in the **Products** dropdown, select **Internet subscription**. 6. Click **+ Select a plan**, then select **Monthly internet subscription & free trial + install fee**. 7. Click **+Add another product and plan**. 8. In the **Products** dropdown, select **Router**. 9. Click **+ Select a plan**, then select **Internet router**. 10. In the **Shipping** section, in the **Amount** field, enter `10.00`. For more information on shipping rates, and how to configure them, see [Shipping rates](/docs/settings/shipping). 11. At the bottom of the page, click **Save order**. ### 5.3: Collect payment for the invoice This step describes how to access an unpaid invoice and collect payment from a customer using a hosted payment form. 1. In the left navigation bar, click . 2. Click **Billing**, then click **Unpaid invoices**. 3. In the **Customer** column, locate **Charlie Sullivan**. Then, in the corresponding **Invoice number** column, click the number. The invoice is displayed with an **unpaid** status. For information on how to edit and manage invoices, see [Manage invoices](/docs/data-tables/manage-invoices). 4. On the invoice, click **Pay invoice**. 5. Select **Pay with Rebilly hosted payment form**, then click **Submit**. 6. To open the payment form in your web browser, click , or copy the URL and open it in your browser. 7. In the **Payment card** field, enter the following card details: **Note:** This card does not generate a real charge. - Card number: `4111 1111 1111 1111`. - Expiration date: any future date. - CVV: any 3 digits. 8. Click **Continue**, then click **Confirm**. ## Step 6: View the paid invoice and transaction This step describes how to view a completed billing transaction. For a complete list of billing interactions, and how to complete them, see [Billing](/docs/data-tables/manage-billing). This step describes how to view the newly created customer and the related transaction. In the customer detail view, all customer information is displayed, such as: address, email, length of time as a customer, payment instruments, subscription information, and timeline. Timeline describes all interactions with the customer including payment transactions. 1. View customer interactions and most recent payment: 1. In the left navigation bar, click . 2. Click **Customer** and then click **Customers**. 3. In the **Name** column, click **Charlie Sullivan**. 4. Scroll down to **Timeline**. A record of the transaction is displayed. To view payment gateway information for the transaction, click the message with the **approved** status. To view the invoice, click the invoice number. 2. View subscription information: 1. In the right of the screen, in the **Active subscriptions** section, view the active subscription information, including: date created and last renewed, products in the subscription, and the subscription plan. 2. In the right of the screen, in the **Active subscription** section, click , then click **View**. Detailed information on the subscription is displayed. On this page, you can edit all subscription information, add new items, cancel or pause the subscription, apply coupons, change trial end date, and view paid invoices. 3. In the **Invoices for this order** section, press an invoice number. The details of the last paid invoice is displayed along with subscription manage options and a timeline. 4. In the **Upcoming invoices for this order** section, under **To be issued**, press the date of the next invoice. Information on the upcoming subscription invoice is displayed. ## Related automations The following are automations that you may need when processing payments and managing invoices: - [Send a welcome email to new customers](/docs/tutorials/automate-emailing-invoices#send-a-welcome-email-to-new-customers): Describes how to send new customers a welcome email which includes dynamically added content, such as: their first name, last name, or other related customer information. - [Send an upcoming invoice by email to customers](/docs/tutorials/automate-emailing-invoices#send-an-upcoming-renewal-notification): Describes how to send a customer an invoice by email in advance of the renewal date. - [Send paid invoice email notifications](/docs/tutorials/automate-emailing-invoices#send-a-paid-invoice-notification): Describes how to send the customer an email when an invoice is paid. - [Send declined payment notifications](/docs/tutorials/automate-emailing-invoices#send-a-declined-payment-notification): Describes how to send a declined payment email to a customer. - [Send past due invoice email notifications](/docs/tutorials/automate-emailing-invoices#send-a-past-due-invoice-notification): Describes how to send the customer a payment past due email notification. ## Related topics - [Test payment transactions](/docs/tutorials/test-transactions)