Payment States
A VTPE payment follows a simple state model:Event Summary
Recommended Actions Per Event
payment.initialized
Create a pending order record in your system. Record thepaymentId so you can correlate later events. Do NOT fulfill the order yet; the payment has not been confirmed.
payment.success
Fulfill the order and record thepaymentId and channel. Send a receipt or confirmation to the customer. Update any inventory or booking systems associated with the reference. The paidAt timestamp tells you exactly when the payment was confirmed.
payment.fail
Release any inventory or reservation holds tied to the reference. Update the order status to failed or cancelled. Optionally notify the customer so they can retry or try a different payment method.Channel Values
Thepayment.success event includes a channel field that indicates which fulfillment channel handled the payment. The possible values are:
Use
paymentId as an idempotency key when processing webhooks. VTPE may retry webhook delivery, so handle duplicate events safely to avoid double fulfillment.When Webhooks Do Not Arrive
VTPE makes best-effort webhook delivery, but failures can happen. If a webhook for a reference never arrives, use the Payment Status API to query the current state directly:- Check
payment.webhookDeliveryin the response: if it isfailorpending, the webhook was likely never received. - Branch on
stageorlockedto decide whether to fulfill, hold, or release the associated product. - Call the endpoint when you need a decision, not on a continuous polling loop.
