Overview

Transaction API

Transactions are the core mechanism for awarding loyalty points to members. Every purchase, redemption, or manual point adjustment flows through the Transaction API — making it the most frequently called part of the Trifft platform.


How it works

When a sale occurs at a POS, e-commerce checkout, or any other touchpoint, your system sends a Create Transaction request to Trifft. Trifft evaluates the transaction against your active loyalty rules (point multipliers, bonus campaigns, tier thresholds, etc.) and awards points to the member's wallet automatically.

The general flow is:

  1. Member is identified at checkout (by card, phone, email, or custom parameter)
  2. Your system sends POST /v1/transaction with the sale details
  3. Trifft calculates and awards points based on the configured rules
  4. The member's wallet is updated in real time

Member identification

Every transaction must identify the member. Trifft supports five identification strategies via the member_id_type field:

member_id_typemember_id value
TrifftIDMember's internal Trifft UUID
CardIDPhysical or virtual card number
PhoneNumberMember's phone number
EmailMember's email address
CustomParamAny custom parameter in param_slug:value format

Venue identification

Transactions must also be linked to a venue (physical location or e-commerce). Use the venue_id_type field:

venue_id_typevenue_id value
VenueIDTrifft's internal venue UUID
CustomParamCustom parameter in param_slug:value format
EcommerceSet venue_id to null for online transactions

Transaction types

The type field controls how the transaction is processed:

TypeBehavior
standardNormal purchase — points are calculated by Trifft's loyalty rules
walletDirect wallet operation — used for manual point adjustments not tied to a purchase
silentTransaction is recorded but no notification is sent to the member

Amounts and currency

All monetary values use cents to avoid floating-point issues. For example, $12.23 is sent as 1223.

The same applies to redeemed_points — points are expressed in the same unit as the transaction amount.

If you need to override Trifft's automatic point calculation for a specific transaction, pass the points field explicitly. When provided, Trifft skips its internal calculation and awards exactly that many points.


Line items

Passing items is optional but recommended for integrations that want per-product point rules, reporting, or the Points Calculator (see below). Each item includes:

FieldRequiredDescription
nameYesProduct name
typeYesYour product type classification (any string)
qtyYesQuantity (float, e.g. 2.5 for weighted goods)
priceYesUnit price in cents
skuNoUniversal product identifier

Points Calculator

The Points Calculator endpoint lets you preview how many points a member would earn for a given product or full checkout basket — before the actual transaction is submitted.

Use it to display a real-time points preview at the POS or on the product/cart page in your e-commerce frontend.

Typical use cases:

  • "You'll earn 120 points for this purchase" displayed at checkout
  • Per-product points badge on product detail pages
  • Cart summary showing total points for the full basket

The calculator respects all active loyalty rules, multipliers, and the member's current tier — the result reflects exactly what POST /v1/transaction would award.


Endpoints

MethodPathDescription
POST/v1/transactionRecord a new transaction and award points
POST/v1/transaction/{custom_transaction_id}Update custom parameters on an existing transaction
POST/v1/transaction/{custom_transaction_id}/refundRefund a transaction and reverse the awarded points
DELETE/v1/transaction/{custom_transaction_id}Delete a transaction and reverse the awarded points
POST/v1/points-calculatorPreview the points a member would earn for a product or basket

Idempotency

All transaction requests are idempotent by the id field (your custom transaction ID). Submitting the same id twice will not create duplicate transactions or award points twice. Use your POS order number or receipt ID as the id to safely retry on network failures.


Refunds vs. Deletions

Both /refund and DELETE reverse the points awarded by a transaction, but they serve different purposes:

  • Refund — use when a customer returns a product or requests a chargeback. The transaction remains in the history and is marked as refunded and coupons and/or points are reverted.
  • Delete — use to correct data errors (e.g. a transaction sent to the wrong member). The transaction is removed from history entirely.