Last updated

Set up Add-ons with Rebilly Instruments

This topic describes how to set up add-ons for use with the Rebilly Instruments JavaScript library.

Important

Add-ons only works together with the items property.

Add-ons setup

If you have not already done so, complete the basic setup tutorial.

The add-ons will show up at the bottom of the confirmation screen.

  1. JavaScript
  2. HTML
import RebillyInstruments from '@rebilly/instruments';

RebillyInstruments.mount({
  organizationId: 'test-org-2019-12-07',
  publishableKey: 'pk_sandbox_WcUZLs3xwB7dubewna3zJA75wdMBEHeWHOyQww8',
  websiteId: 'ach-example',
  apiMode: "sandbox",
  items: [
    {
      planId: 'my-plan-id',
      quantity: 1
    },
  ],
  addons: [
    {
      planId: 'my-addon-plan-id',
      quantity: 1
    },
  ],
});