Tip Adjust
Tip adjust changes gratuity on an existing transaction before settlement, where the processor and merchant configuration support it. Use the transaction ID returned by the original payment. Availability and timing depend on the processor's settlement cutoff.
Run Android reference operations from withContext(Dispatchers.IO). The examples unwrap Result with getOrThrow(); handle thrown errors at the UI boundary. Inspect the returned transaction status and operation amounts before displaying success. See the Android operation helpers.
Fixed Tip
iOS 1.0.21:
let response = try await KoardMerchantSDK.shared.tipAdjust(
transactionId: transactionId,
amount: 3000, // $30.00 tip, not the new transaction total
tipType: .fixed,
eventId: eventId // Persist before submitting this operation
)
Android 1.0.7:
import com.koardlabs.merchant.sdk.domain.AmountType
val transaction = sdk.adjust(
transactionId = transactionId,
type = AmountType.FIXED,
amount = 3000
).getOrThrow()
Inspect the returned transaction and processor response before marking the adjustment successful. The Android method is adjust; the iOS method is tipAdjust. Android 1.0.7 does not expose an eventId argument for adjust.
REST
POST /v1/payments/{transaction_id}/adjust
X-Koard-apikey: YOUR_API_KEY
Content-Type: application/json
For a fixed tip:
{"type": "fixed", "amount": 3000, "event_id": "YOUR_PERSISTED_EVENT_ID"}
For a percentage tip:
{"type": "percentage", "percentage": 18, "event_id": "YOUR_PERSISTED_EVENT_ID"}
REST percentage is an integer from 1 through 100: 18 means 18%, not 0.18. A fixed amount must be a positive integer in minor currency units. Requires payments:tipadjust.
Surcharge Behavior
Tip adjustment does not recalculate the existing surcharge. If the final breakdown changes, use the supported capture flow and verify the processor's authorization limits before increasing the final amount.
Result
This operation returns the transaction result. The Transaction Result lists the fields you can read from it.

