Kibo Subscription API Developer Guide
Subscriptions
Understand subscription architecture and concepts
Product Subscription Dashboard
Manage product subscriptions in the Admin UI
Continuity Orders for Products Dashboard
View and manage continuity orders
Understanding Subscription in Kibo
In Kibo, a Subscription is not just a product type; it’s a standalone commerce entity that represents a customer’s recurring purchase agreement. This is an important architectural difference from many platforms. Instead of selling a “subscription product,” you sell a regular product and then create aSubscription record that says, “this customer wants this product delivered at this frequency.”
This “headless” approach makes Kibo’s subscription capabilities incredibly flexible. A single product can be part of thousands of different subscriptions, each with its own schedule, address, and payment information. The subscription’s main job is to act as a template that generates a new order when the next fulfillment date arrives. For a developer, this means you’ll interact with subscriptions as independent objects that manage the lifecycle of recurring purchases.
How This Domain Fits Into Kibo
The Subscription domain is deeply integrated with the core commerce lifecycle, acting as an automated order-creation engine.- Customer: A subscription is always owned by a
CustomerAccount. All subscription management is done in the context of a specific customer. - Catalog: Subscriptions contain one or more products from your catalog.
- Payment: Subscriptions rely on a customer’s saved, tokenized payment methods (
Card) to process recurring payments when a new order is generated. - Order: The ultimate output of a subscription is a new
Orderplaced into the Kibo system, which then follows the standard fulfillment workflow.
Prerequisites
- Kibo API credentials with Commerce permissions.
- A customer account with a saved payment method for testing.
- Node.js 16+ with TypeScript.
- Familiarity with REST APIs and
async/await.
What You’ll Learn
After completing this guide, you’ll understand:- How Kibo structures Subscription data and its lifecycle (based on official API specs).
- The key patterns Kibo uses for all subscription management APIs (verified from apidocs.kibocommerce.com).
- Common workflows like creating, pausing, updating, and force-generating orders from subscriptions (with accurate, tested examples).
- How to avoid the most common beginner mistakes.
- How to read and navigate the official API documentation for Subscriptions.
Kibo Subscription Fundamentals
How Kibo Organizes Subscription Data
Kibo’s Subscription data is centered around theSubscription object, which acts as the master record for a recurring purchase.
Subscription: The main object.id: The unique identifier for the subscription.customerAccountId: The ID of the customer who owns the subscription.status: The current state of the subscription. The most common values areACTIVE,PAUSED, andCANCELLED.frequency: An object defining the delivery schedule (e.g.,{ "value": 2, "unit": "Week" }). Valid units areDay,Week,Month,Year.nextOrderDate: The ISO 8601 date-time for the next scheduled order generation.items: An array ofSubscriptionItemobjects, detailing the products, quantity, and fulfillment details for the subscription.
Key Kibo Patterns You’ll See Everywhere
Before we write code, understand these patterns that appear in every Kibo API: Authentication Pattern: The Kibo SDK manages authentication for you. You create a singleConfiguration object containing your credentials. This object is then passed to the constructor of the SubscriptionApi client, which will handle the OAuth 2.0 token exchange for every API call.
Request/Response Structure:
When you create a subscription, you provide a SubscriptionInfo object, and the API returns the newly created Subscription object.
VALIDATION_ERROR if you try to create a subscription with an invalid frequency unit or for a product that is not configured to be subscribable.
API Documentation Reference:
Throughout this guide, we’ll reference specific endpoints. Find complete specs under the “Commerce” section at:
/developer-guides/subscription
Common Subscription Workflows
Kibo developers typically work with Subscriptions in these scenarios:- Subscription Creation: A customer chooses a “Subscribe & Save” option during checkout, and you create a new subscription record for them.
- Self-Service Management: Building a “My Subscriptions” page where a logged-in customer can pause, cancel, change the frequency, or update the next shipment date of their subscriptions.
- Automated Order Generation: A backend process that runs daily, finds all subscriptions with a
nextOrderDateof today, and triggers theorderNowaction to convert them into actual orders.
Creating a Subscription: The Kibo Way
When You Need This
This is the starting point for any recurring revenue flow. You use this operation when a customer first signs up for a subscription, typically from a product detail page or in the cart.API Documentation Reference
- Endpoint:
POST /api/commerce/subscriptions/ - Method:
POST - SDK Method:
createSubscription - API Docs: Creates Subscription
Understanding the Kibo Approach
Kibo’s API for creating a subscription requires you to provide all the necessary information upfront in aSubscriptionInfo object. This includes the customer, the items, the frequency, and the fulfillment details. This ensures that a subscription is always created in a valid, ready-to-use state.
Code Structure Walkthrough
Step-by-Step Implementation
Step 1: Setting Up the FoundationWhat Just Happened? (Code Explanation)
- The setup phase created the
Configurationobject. - The API call used an instance of
SubscriptionApi, the dedicated client for these operations. - The payload was a detailed
SubscriptionInfoobject. We provided the customer ID, the recurring items, the frequency, and the payment/shipping details to be used for future orders. This is a key concept: the subscription stores everything it needs to generate an order on its own. - The response handling uses a
try...catchblock. On success, Kibo returns the completeSubscriptionobject that was just created.
Common Beginner Mistakes
Mistake 1: Using an invalidunit for the frequency.
The unit field in the frequency object is a string that must be an exact match for one of the allowed values: Day, Week, Month, Year. Using Months or monthly will result in a VALIDATION_ERROR.
Mistake 2: Not providing valid payment and shipping contact IDs.
The subscription needs to know which saved address and payment card to use for future orders. The IDs you provide in the fulfillmentInfo and payment sections must correspond to real contacts and cards on the customer’s account.
Multiple Real-World Examples
Here are 5 complete, production-ready examples covering the most commonSubscription management tasks.
Example 1: Update a Subscription’s Frequency and Next Order Date
This is a common self-service feature: allowing a customer to get their next order sooner or change their delivery schedule.- API Docs: Update Subscription
Example 2: Pause a Subscription
Temporarily stop a subscription without canceling it.- API Docs: Perform Subscription Action
Example 3: Resume or Cancel a Subscription
The same endpoint used to pause can also be used to resume or permanently cancel a subscription.Example 4: Force an Immediate Order (“Order Now”)
This feature allows a customer to trigger their subscription shipment immediately instead of waiting for thenextOrderDate.
- API Docs: Order Now
Troubleshooting Your Subscription Implementation
Reading Kibo Error Messages
ITEM_NOT_FOUND: ThesubscriptionId,customerAccountId, or a contact/card ID you provided does not exist.VALIDATION_ERROR: The request body is invalid. Common causes include using a disallowedunitin the frequency, or trying to subscribe to a product not marked as subscribable in the Kibo catalog.MISSING_PAYMENT_INFO: You tried to create or activate a subscription without valid, stored payment credentials.
Common Development Issues
Issue 1: My subscription’snextOrderDate passed, but no order was created.
- Why it happens: This is the most common point of confusion for new Kibo developers. Kibo does not have a built-in, automatic job that generates orders from subscriptions. It provides the
orderNowAPI endpoint, but it’s your responsibility to call it. - How to fix it: You must implement your own backend process (e.g., a scheduled task, a serverless function) that runs daily. This process should:
- Query for all active subscriptions where
nextOrderDateis today or in the past. - Loop through the results.
- Call the
orderNow({ subscriptionId })method for each one.
- Query for all active subscriptions where
- How to avoid it: Understand that Kibo provides the tools for subscription, but the orchestration of order generation is left to the implementer for maximum flexibility.
updateSubscription call is deleting fields I didn’t touch.
- Why it happens: The
updateSubscriptionendpoint uses an HTTPPUTmethod, which replaces the entire object. If you send a payload with only thefrequencyfield, Kibo will treat all other fields (likeitems) as null and wipe them out. - How to fix it: You must follow the Read-Modify-Write pattern. First,
GETthe subscription. Then, modify the properties on that retrieved object in your code. Finally,PUTthe entire, modified object back to the API. - API Reference: See Example 1 in this guide for the correct implementation of this pattern.

