Last updated

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. If Rebilly is already integrated into your application, website, or checkout flow, and you would like to learn how to use it, see Usage.

This tutorial describes how to add a "Buy now" button to your web page. When a customer clicks this button, a Rebilly hosted checkout form, which accepts customer information and processes payment, is displayed. Customer, billing, and payment information is added and securely stored to your Rebilly account. For an interactive example, see hosted checkout example.

This tutorial creates a subscription product for an internet subscription service, which is prepaid at a fee of $50.00 per month for 12 months. The subscription includes a set up fee and a free trial period of 2 weeks.

This tutorial also creates a one-time sale item for the sale for an internet router that includes a shipping rate for purchases made in US Dollars. The internet router is not part of the subscription.

Step 1: Log in or sign up

  1. Log in or sign up to Rebilly.

  2. Select an environment: In the left navigation bar, in the bottom corner, click 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 is a service which enables a business to receive payments from customers to their merchant bank account. For more information on gateway accounts, and how to configure them, see Gateway accounts.

  • 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.

  • To complete this tutorial in the live environment, you must have payment gateway account credentials.

  1. In the left navigation bar, click Settings .
  2. In the Configuration section, click Gateway accounts.
  3. Click 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.
  8. Click 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.

3.1: Create a subscription product

  1. In the left navigation bar, click Settings .
  2. In the Pricing section, click Product & pricing plans.
  3. On the right of the screen, click 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. Click Create pricing plan.
    You are redirected to the Create pricing plan page. Complete the steps described in 3.2.

3.2: Create a subscription pricing plan

If you are not redirected to the Create pricing plan page:
In the left navigation bar, click Settings , Products & pricing plans, click the Internet subscription product, then click 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.
  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 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. Click 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, click Settings .
  2. In the Pricing section, click Product & pricing plans.
  3. On the right of the screen, click 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. Click Create pricing plan.
    You are redirected to the Create pricing plan page. Complete the steps described in 4.2.

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.

  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.
  4. In the Price field, enter 60.00.
    This is the sale price of the router.
  5. Click Create pricing plan.

Step 5: Create a shipping rate

This step creates a shipping rate that is associated with purchases made in US dollars.

  1. In the left navigation bar, click Settings .
  2. In the Pricing section, click Shipping rates.
  3. Click Create shipping rate.
  4. In the Name field, enter Router shipping.
  5. In the Description field, enter Router shipping rate.
  6. In the Currency field, select USD - US Dollars.
    This rate must match the currency of the invoice.
  7. In the Price field, enter 12.95.
    This is the cost for shipping.
  8. Click Save shipping rate.

Step 6: Create a hosted checkout form

This step creates a hosted checkout form. Rebilly hosted checkout forms provide secure and compliant checkouts. Checkout forms are customizable, and use fully responsive design, built-in error messaging, validation, and expedited checkout for returning customers.

  1. In the left navigation bar, click Settings .
  2. In the Payment forms section, click Checkout forms.
  3. Click Create checkout form.
  4. In the Name field, enter Internet product checkout.
  5. In the Order items section, in the Product dropdown, select Internet subscription.
  6. Click Add plan, and select Monthly with install fee.
  7. In the Order item #2 section, in the Product dropdown, select Router.
  8. Click Add plan, and select Router & delivery.
  9. In the Payment methods section, enter your preferred payment method.
    Note: By default, in the sandbox environment, the payment card payment method is active. This relates to the TestProcessor payment gateway account which is added automatically to all new Rebilly accounts. To add payment methods in a live environment, you must add a payment gateway, and add a related payment method in this field. For more information, see Set up a payment gateway.
  10. Optionally, to provide an expedited checkout for returning customers, in the Customer sign-up section, select the Create account. This option prompts customers to set a password and account which they can use to sign in for their next purchase.
  11. In the Customization section, add your company logo and colors.
  12. Optionally, to add footer links to your checkout form, such as: Privacy policy, terms of service, or refund policy. Add these URLs to the Footer links section.
  13. Optionally, to collect data for analytics, turn on the Customer tracking toggle, and provide the details of your analytics software.
  14. Scroll to the bottom of the screen, then click Save checkout form.

Step 7: Test the hosted checkout form

This step describes how to test the hosted checkout form that you created in the previous step.

7.1: Enter customer details and complete a payment

  1. In the left navigation bar, click Settings .
  2. In the Payment forms section, click Checkout forms.
  3. On the right of the Internet product checkout, click Preview .
  4. Complete the checkout form using the following information:
    • First name: Alex
    • Last name: Tester
    • Email: a.tester@gmail.com
    • Address: 1 Goldman Drive, New Egypt, NJ, USA.
    • City: Plumsted
    • Country: United States
    • Region: New Jersey
    • Postal/ZIP code: 08533
    • Card number: 4111 1111 1111 1111
      Note: This card will not generate a real charge in the live or sandbox environment.
    • Expiration date: any future date.
    • CVV: Enter any 3 digits.

7.1: View information

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 the new customer:
    1. In the left navigation bar, click Data tables, then click Customers.
    2. In the name column, click Alex Tester.
  2. View customer interactions and most recent payment:
    1. Scroll down to Timeline. A record of the interactions is displayed.
    2. To view payment gateway information for the transaction, click the message with the approved status.
  3. View subscription information:
    1. On the right of the screen, in the Active subscription section, view the active subscription information, including: date created and last renewed, products in the subscription, and the subscription plan.
    2. In the Active subscription section, click .
      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, click 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, click the date of the next invoice.
      Information on the upcoming subscription invoice is displayed.

Step 8: Add the checkout form to your web page

This step describes how to add the hosted checkout form and a "Buy now" button to add to your website. When a customer clicks this button, the checkout form is displayed. The checkout form accepts customer information and processes payment. When payment is processed, a new customer is created and added to your Rebilly account, along with the customer information.

  1. Obtain the Rebilly checkout form redirect URL:

    1. In the left navigation bar, click Settings .
    2. In the Payment forms section, click Checkout forms.
    3. On the right of your form, click Copy URL.
  2. Create a checkout button, add the URL to the button, and add it to your web page.

    Example:

    <a class="button" href="link-to-checkout-form">Buy now</a>
    
    a.button {
       -webkit-appearance: button;
       -moz-appearance: button;
       appearance: button;
    
       display: inline-block;
       background: #0044d4;
       color: #ffffff;
       padding: 10px 20px;
       border-radius: 6px;
       text-decoration: none;
       color: initial;
    }
    

Rebilly supports the use of custom domains in hosted checkout forms, billing portals, quotes, deposit requests and payouts. Instead of using the default Rebilly domain: portal.secure-payments.app, you can use your own. For more information, see Configure a custom domain.

The following are automations that you may need when using a hosted checkout form.