Kibo Commerce API Developer Guide for OMS Implementations
Understanding Order Imports in Kibo
For businesses using Kibo’s Order Management System (OMS) with a separate, external e-commerce front-end, the primary goal is not to process transactions in real-time but to import completed orders for fulfillment. In this context, an “Order” is a record of a transaction that has already occurred elsewhere. Kibo’s API is specifically designed for this. Instead of a multi-step cart-to-checkout process, you use a single, powerful API call to create a complete order record. The key is providing all necessary information—customer details, pre-calculated pricing, and pre-authorized payment details—in one request. This is achieved by using thePOST /commerce/orders endpoint with the required isImport=true flag, which tells Kibo to accept the order as a historical record rather than processing it as a new transaction.
How This Domain Fits Into Kibo
The Commerce domain is the entry point for all order data into the Kibo platform. For an OMS-only implementation, this is where your external systems hand off completed sales to Kibo for subsequent management.- Fulfillment: Once an order is imported, it enters the Kibo fulfillment workflow, where it can be routed to the appropriate warehouse or location.
- Customer Service: Imported orders are visible to customer service representatives, who can then manage returns, refunds, and cancellations using Kibo’s tools.
- Inventory: Subsequent actions on an imported order, like fulfillment, will correctly decrement stock levels within Kibo.
Prerequisites
- Kibo API credentials and basic setup
- Node.js 16+ with TypeScript
- Familiarity with REST APIs and constructing complex JSON objects
- Access to pre-authorized payment transaction details from your external payment gateway.
- API Reference: /api-overviews/openapi_overview_overview (bookmark this - you’ll reference it constantly)
What You’ll Learn
After completing this guide, you’ll understand:- How to structure a complete JSON payload to import an order into Kibo’s OMS.
- The key patterns for providing pre-authorized credit card, PayPal, and other payment details.
- How to correctly structure item-level pricing, taxes, and shipping to avoid validation errors.
- How to include external fraud check results with an imported order.
- How to read and navigate the official Orders API documentation for OMS-specific use cases.
Kibo OMS Import Fundamentals
How Kibo Organizes Imported Order Data
For an OMS import, you are essentially building the finalOrder object yourself. The core data structures you must provide are:
isImport: true: This boolean field is mandatory and signals to Kibo that you are importing a completed order.items: An array of line items. For imported orders, you must provide the final, calculated pricing components for each item, including tax, shipping, and discounts.payments: An array of payment objects. Since the payment was authorized on your external system, you must provide the gateway’s transaction details, tokenized card information, and authorization codes.billingInfo: The customer’s billing address and contact information. This object must be populated on both the order level and within each payment object.fulfillmentInfo: The customer’s shipping address and chosen shipping method.emailandcustomerAccountId: Identifiers for the customer.
Key Kibo Patterns You’ll See Everywhere
Authentication Pattern: The Kibo SDK manages authentication for you. You create a singleConfiguration object containing your credentials (Client ID, Shared Secret, etc.). This object is then passed to the constructor of the OrderApi client, which handles the OAuth 2.0 token exchange for every API call.
Error Handling Approach:
Kibo provides structured errors. For OMS imports, the most common error is a VALIDATION_ERROR, often with a message like “The order totals do not match the sum of the item totals.” This means you must carefully verify your pricing calculations.
POST /commerce/orders.Find complete specs at: Create Order
Importing an Order: The Kibo OMS Way
When You Need This
This is the core workflow for any OMS-only Kibo client. You use this process to feed orders from your website, mobile app, or other point-of-sale systems into Kibo for centralized fulfillment and management.API Documentation Reference
Endpoint:POST /commerce/ordersMethod:
POSTAPI Docs: Create Order
Understanding the Kibo Approach
Kibo’s import functionality is built on trust. By settingisImport=true, you are telling the system: “Trust me. This transaction is complete, the payment is authorized, and the prices are final.” Kibo will bypass its internal pricing and payment processing engines and instead record the exact data you provide. This makes the accuracy of your payload important, especially the financial details. The sum of all item-level pricing components must precisely match the overall order total.
Code Structure Walkthrough
We’ll build this step by step:
- Configuration: Create a central Configuration instance.
- API Client Instantiation: Create a dedicated client for the Order API.
- Data Preparation: Meticulously construct the entire Order object, including items with broken-down pricing and payments with gateway authorization details.
- API Call: Use the
createOrdermethod to import the order.
Step-by-Step Implementation
Step 1: Setting Up the FoundationAdvanced Import Patterns
Pattern 1: Importing an Order with a PayPal Payment
Business Scenario: Your website uses PayPal Express 2. You need to import the completed order into Kibo, including the necessary PayPal transaction details so you can capture funds later. Kibo’s Architecture Consideration: Kibo has a specific structure for PayPal Express 2 payments. You must provide thepayerId, the externalTransactionId (which is the PayPal EC- token), and the gatewayTransactionId from the authorization.
Pattern 2: Importing an Order with Fraud Review
Business Scenario: Your e-commerce front-end uses a service like Kount for fraud detection. An order is flagged for manual review. You need to import this order into Kibo and ensure it is also placed in a “Pending Review” state. Kibo’s Architecture Consideration: You can pass external fraud results directly into the order payload using thevalidationResults object. By setting the status within this object to Review, Kibo will automatically place the imported order into a Pending status, preventing it from being fulfilled until it is manually accepted.
Troubleshooting Your OMS Import
Common Import Issues
Issue 1: ThecreateOrdercall fails with aVALIDATION_ERRORand a “totals do not match” message.
- Why it happens: This is the most common import error. The sum of all item-level pricing fields (
discountTotal,itemTaxTotal,shippingTotal,shippingTaxTotal,handlingAmount, etc.) across all items does not exactly equal the top-levelorder.total. This often happens due to floating-point math rounding errors or misinterpreting which fields are additive.- How to fix it: Before sending the request, programmatically sum all the calculated pricing fields from your
itemsarray and ensure the result is used to setorder.total,order.subtotal,order.taxTotal, etc. Do not assume they will be calculated for you.
Issue 2: The order is imported, but subsequent payment capture fails.
- Why it happens: The authorization details provided in the
payment.interactionsobject were incorrect or insufficient. For gateways like Cybersource or Authorize.net, specific keys and tokens from the original authorization are required to link a future capture or credit action.- How to fix it: Double-check the required
gatewayResponseDatafor your specific payment gateway. Ensure you are storing and passing the correct transaction IDs, request tokens, and auth codes from your e-commerce front-end’s payment authorization step. Make sure you are correctly mapping gateway fields, such asCustomerProfileIdtocardNumberPartOrMaskfor Authorize.net.

