Guided Walkthroughs

Create Product Catalog

Follow these steps in order. Each step names the API call it makes; open it in the API Reference to try it out in the API playground.

Product Catalog Management

Introduction

This is a guided walkthrough showcasing the capabilities of Product Catalog in Maxio.

Learn how to set up products and components for use when creating subscriptions.

Prerequisite

Before proceeding, read the How to Get Started guide and generate an API Key for your site.

Additional Resources

To gain a deeper understanding of the concepts presented in this walkthrough, see the following resources:

Step 1: Create Product Family

Products must belong to a product family, which serves as a logical grouping. Use the following endpoint to create one.

Configure your subdomain, and then provide your API key in the Authentication panel of the API playground.

For further information on product families, see Product Family concepts and Product Family help article.

API call: createProductFamily

Example arguments:

{
  body: {
    product_family: {
      name: "Basic",
      handle: "basic-" + Math.floor(Date.now() / 1000).toString(),
      description: "Basic product family",
    },
  },
}

Step 2: Create Product

Once you have a product family, you can create a product with this endpoint.

To learn more about the products, see Product concepts.

API call: createProduct

Example arguments:

{
  product_family_id: step2State?.data?.["product_family"]?.id,
  body: {
    product: {
      name: "Gold Plan",
      handle: "gold-" + Math.floor(Date.now() / 1000).toString(),
      description: "This is our gold plan.",
      accounting_code: "123",
      require_credit_card: true,
      price_in_cents: 1000,
      interval: 1,
      interval_unit: "month",
      auto_create_signup_page: true,
      tax_code: "D0000000",
    },
  },
}

Step 3: Create Metered Component

Next, create a component. Read more about components in Components concepts and Components help article.

In this example, you are creating a \

API call: createMeteredComponent

Example arguments:

{
  product_family_id: step3State?.data?.["product_family"]?.id,
  body: {
    metered_component: {
      name: "Text messages",
      unit_name: "text message",
      pricing_scheme: "per_unit",
      taxable: false,
      prices: [
        {
          starting_quantity: 1,
          unit_price: 1,
        },
      ],
    },
  },
}

Step 4: Create Coupon

You can create coupons, which enable you to provide your customers with discounts. Read more about the coupons in Coupons concepts and Coupons help article.

API call: createCoupon

Example arguments:

{
  product_family_id:
    stateAfterProductFamilyCreation?.data?.["product_family"]?.id,
  body: {
    coupon: {
      name: "15% off",
      code: "15OFF",
      description: "15% off for life",
      percentage: 15,
      allow_negative_balance: false,
      recurring: false,
      stackable: true,
      compounding_strategy: "compound",
      exclude_mid_period_allocations: true,
      apply_on_cancel_at_end_of_period: true,
    },
    restricted_products: {
      [stateAfterProductCreation?.data?.["product"]?.id]: true,
    },
    restricted_components: {
      [stateAfterComponentCreation?.data?.["component"]?.id]: true,
    },
  },
}

You can now create an offer, which is a package combining the previously created product, component, and coupon. Read more about offers in this help article.

That's it! Now that you've created a test Product Catalog using the API, you can try creating a Subscription that will use it. Check out Create Subscription Guided Walkthrough.

API call: createOffer

Example arguments:

{
  body: {
    offer: {
      name: "Solo",
      handle:
        "han_shot_first-" + Math.floor(Date.now() / 1000).toString(),
      description: "A Star Wars Story",
      product_id: stateAfterProductCreation?.data?.["product"]?.id,
      components: [
        {
          component_id:
            stateAfterComponentCreation?.data?.["component"]?.id,
          starting_quantity: 1,
        },
      ],
      coupons: [stateAfterCouponCreation?.data?.["coupon"]?.code],
    },
  },
}

On this page