Skip to main content
Call kiflo('transaction', ...) each time a sale or payment is completed. Kiflo links the transaction to the customer who made it, traces that customer back to their referring partner, and triggers any reward or commission rules you have configured. Recording transactions is what enables revenue-share and commission-based partner programs in Kiflo.

Syntax

Both callback functions are optional — omit them if you do not need to react to the result.

Example

Parameters

TransactionObject

string
required
The currency of the transaction as an ISO 4217 currency code (e.g., "USD", "EUR", "JPY"). All amounts in properties are interpreted in this currency.
object
required
The properties of the transaction as configured in your Kiflo account properties. Both name and amount are required inside this object.
object
required
Identifies the customer associated with this transaction so Kiflo can look up their partner attribution. Pass at least one identifying property — typically email — that matches the customer record already in Kiflo.

Automating transaction creation

For most production setups, you will not want to call kiflo('transaction', ...) manually on a client-side confirmation page. Instead, trigger transaction recording automatically from your payment provider:
  • Stripe, Recurly, Chargify, Chargebee — use Kiflo’s native payment provider integrations to create transactions automatically whenever a payment succeeds, without writing any additional code.
  • Webhooks / custom backends — call the Kiflo REST API from your server when your payment provider fires a webhook, passing the same currency, properties, and customer fields.
The customer referenced in the customer field must already exist in Kiflo (created via kiflo('customer', ...) or the REST API). Kiflo uses the customer record to find the originating partner and apply the correct reward.
Using the client-side JS call on a purchase-confirmation page is a quick way to get started. Migrate to a server-side webhook integration before going to production to avoid missed transactions if a user closes their browser before the confirmation page loads.