Skip to main content

API Response Schemas

This document provides the exact structure of API responses. All monetary values are in cents (smallest currency unit).
Critical: Currency ConversionSome fields are returned already converted to the customer’s target currency. Others are in the merchant’s base currency. The tables below indicate which is which. Never double-convert.

Products API

GET /products

Product Object

ShippingRuleDestinations Object

Returned on physical products. Use this to build shipping selectors.

Cart Validation API

POST /cart/validate

Validates cart contents and calculates shipping based on delivery address.

Request Body

CartItem Object

DeliveryDetails Object

The location fieldFor specific_locations shipping rules, pass the merchant-defined area in location. This is separate from city:
  • city: Customer’s actual city (for receipts, orders)
  • location: Merchant-defined area for shipping rule matching (e.g., “Ikeja”, “Dallas”)

Response

Response Fields (Money)

CartDetailItem Object

Line items with accurate backend-calculated prices.

PricingSummary Object

ShippingDetails Object

MatchedShippingRule Object

Rules that matched the customer’s address, with calculated fees.

Shipping Rule Priority

When multiple rules could match, the backend selects by priority:

Payment Intent API

POST /payment/intent

Creates a payment intent for processing payment.

Request Body

Response

Response Fields (Money)


Pricing Calculation API

GET /pricing/calculate

Converts amounts to customer’s currency with live exchange rates.

Query Parameters

Response


SDK Methods

Khaime.confirmPayment()

Renders the payment form and processes payment.
React Timing IssueThe container element must exist in the DOM before calling confirmPayment. Use useEffect to ensure the container is rendered:

Error Responses

All endpoints return errors in this format:

Common HTTP Status Codes