Payment Bill
PaymentBill — represents a monthly payment associated with a member.
Payments are generated when a member reaches the required number of visits within a billing period. Each bill may also include detailed PaymentCredits showing how visits contributed to the payout.
Properties
id Unique identifier of the payment transaction.
dateIssued Date the bill was issued (ISO format
yyyy-MM-dd, e.g.,"2022-02-22").amount Payment amount (e.g.,
20.0).type Type of payment method (e.g.,
"DirectDeposit","GiftCard").status Current status (e.g.,
"Pending","Paid","Rejected").statusMessage A display-friendly message describing the status.
credits List of PaymentCredit entries linked to this bill.
Notes
Returned by com.advantahealth.api.payments.Payments.get.
A member may have multiple
PaymentBills, one per billing cycle.
Android (Kotlin) — showing payments
lifecycleScope.launch {
val payments = AFCore.payments().get()
payments.forEach { bill ->
println("Payment: ${bill?.amount} on ${bill?.dateIssued} — status=${bill?.status}")
bill?.credits?.forEach { credit ->
println(" Credit for period=${credit?.period}, visits=${credit?.visits}")
}
}
}iOS (Swift) — showing payments
Task {
do {
let bills = try await AFCore.shared.payments().get()
for bill in bills {
print("Payment: \\(bill?.amount ?? 0) on \\(bill?.dateIssued ?? "-") — status=\\(bill?.status ?? "-")")
bill?.credits?.forEach { credit in
print(" Credit period=\\(credit?.period ?? "-"), visits=\\(credit?.visits ?? 0)")
}
}
} catch {
print("Failed to fetch payments: \\(error.localizedDescription)")
}
}