Skip to content

Kustom

The Kustom app integrates Kustom as a Payment Service Provider in Hantera. Kustom is an iframe-based checkout where the provider owns the entire checkout UI — address collection, shipping options, and payment method selection all happen inside an iframe rendered by Kustom.

This is fundamentally different from card-style PSPs where the merchant controls the checkout UI and the PSP only processes the payment. With Kustom, the order summary is rendered inside Kustom's iframe, so the server must keep the Kustom order synchronized with the Hantera cart whenever cart contents change.

What It Provides

HTTP Ingresses

IngressRoutePurpose
checkoutPOST /commerce/carts/{cartId}/payment/kustomIdempotently creates (or returns) a Kustom order for the cart. Returns htmlSnippet for the storefront to render
confirmPOST /commerce/carts/{cartId}/payment/kustom/confirmCalled by the storefront after Kustom redirects to the confirmation URL. Creates the Payment and completes the cart
webhookPOST /kustom/webhook/pushFallback push notification from Kustom (2–5 min after checkout). Completes the cart if the confirm path didn't
validatePOST /kustom/validatePre-completion callback from Kustom. Fires the OnKustomValidation hook

Jobs

JobPurpose
syncKustomOrderPushes an updated order payload to Kustom's API when the cart changes
captureOrderCaptures an authorized Kustom order via the Order Management API

Rules

RuleListens onPurpose
cart-kustom-syncOnCartMutationBuilds the Kustom payload, hashes it, and schedules syncKustomOrder when the hash changes — see Commerce Integration
captureOnPaymentCaptureSchedules captureOrder for Kustom payments

Custom Hook

The Kustom app emits one custom hook:

  • OnKustomValidation — fires when Kustom calls back to validate an order before completing checkout. Merchant rules can return a validationError effect to block completion with a custom error code shown to the customer.

App Settings

Configured in the portal under the Kustom app:

SettingTypeDescription
usernametextKustom API key ID
passwordsecretKustom API password
environmentselectplayground (sandbox) or production

Architecture

When to Use Kustom

Choose Kustom when:

  • You want a fully-managed checkout UI (iframe) and don't want to build your own
  • You operate in markets where Kustom is a popular local payment provider
  • You want pay-later and installment options handled by the provider

For card-only checkouts where you want to control the UI, use a card-style PSP instead.

Getting Started

  1. Install the Kustom app on your Hantera instance.
  2. Configure API credentials and environment in the portal.
  3. Integrate the storefront. Follow the end-to-end guide in the Storefront SDK docs: Kustom Checkout.
  4. (Optional) Add merchant validation rules using the OnKustomValidation hook.

See Also

© 2024 Hantera AB. All rights reserved.