SaaS
Ecommerce
Events & Tickets
Digital Products
Services & Consultations
Donations
Membership Communities
Track payments and subscriptions from the API
The Get Customer endpoint can return a customer’s subscriptions, invoices, and payments (with refunds, payment methods, entitlements, and balance) when you pass theexpand query parameter. The typed Commerce SDK hides these fields, so read them from the endpoint response. There are no payment webhooks yet, so poll the endpoint to stay in sync. A fully discounted order (for example, a 100% promotion code) creates no payment, so it never appears here. To credit one-time purchases reliably, ask Hercules to confirm each checkout (the payment page your customer completes) from your app’s server instead.
To build this, paste this prompt to your app’s Hercules agent:
Read each customer’s payments and subscriptions from the Commerce Get Customer endpoint using the expand detail. There are no payment webhooks yet, so poll on an interval. For credits or other one-time purchases, do not credit from payments: store each checkout session ID when checkout starts, verify it from the backend, and credit that customer’s wallet exactly once per checkout session.