Stream Payment Session Events
Opens a Server-Sent Events (SSE) stream that emits the current state of a payment session whenever it changes. The first event is sent immediately with the session’s current state.
Each event carries a data field containing a JSON-serialised PaymentSession object. A keepalive comment (:ping) is sent every 15 seconds to maintain the connection.
The stream closes automatically when the session reaches a terminal status (completed, expired, or failed) or after 10 minutes, whichever comes first. Reconnect by opening a new request; the first event will carry the latest state.
Authorizations
Authentication using Bearer tokens. Include your API key in the Authorization header.
Key Types:
- Test Keys:
sk_test_*for development and testing - Live Keys:
sk_*for production environments - Public Keys:
pk_test_*orpk_*for client-side operations
📩 Need access? Contact Support to request your API keys.
Usage:
Headers
Identifies the business unit the request applies to.
Required when the API key is linked to more than one business unit. When the key is linked to exactly one business unit the header may be omitted and that business unit is used.
Errors:
400 business_unit_missingwhen the header is absent and the key is linked to multiple business units400 business_unit_invalidwhen the value is not a valid business unit identifier403 business_unit_access_deniedwhen the value is well formed but the key is not linked to that business unit
^bu_[A-Za-z0-9_-]{21}$Response
Event stream opened. Each SSE event data field contains a JSON-serialised PaymentSession object.
The type of payment session (defaults to one_time):
one_time: A one-time payment where the customer is present in the flow and completes the payment. Optionally, the payment method can be saved for future use where the customer is present in the flow. For example, buying a product and optionally saving the card for later one-off purchases.first_in_series: The first payment where the customer is present in the flow, representing the first payment in a series of future next_in_series payments where the payment method is saved for future use when the customer is not present in the flow. A mandate is recorded for compliance purposes. For example, setting up a subscription or installment plan for a product or service.next_in_series: A subsequent payment where the customer is not present in the flow, representing the next payment in a series of payments, and is charged automatically using a saved payment method (payment_method_id) and the associated customer (customer_id). For example, the next payment on a subscription or installment plan for a product or service.
one_time, first_in_series, next_in_series The amount to be charged in the smallest currency unit. For example, 20.00 ZAR is represented as 2000 cents. Learn more about minor units.
1000
The current status of the payment session.
active: The session is in progress. The customer is interacting with the payment flow or the payment (viasession_url), or the payment is being processed programmitcally using a saved payment method. Dependendent on the payment session type.completed: The session completed successfully.expired: The session expired due to inactivity or a timeout.cancelled: The session was cancelled by the customer or merchant.
active, completed, expired, cancelled Deprecated. Use payment_outcome instead.
The status of the payment associated with the session:
paid: The payment succeeded.unpaid: The payment failed or has not yet succeeded.pending: The payment is still being processed and has not succeeded yet.
paid, unpaid, pending The outcome of the payment associated with the session:
not_started: Payment has not been initiated. A draft payment object may exist but nothing is awaiting an outcome.pending: Payment has been initiated and is awaiting a final outcome. May be waiting on customer action (for example, authentication, redirect, voucher) or provider confirmation (for example, bank, network, async settlement).paid: Payment succeeded. Terminal.unpaid: Payment failed, expired, or was cancelled. Terminal.reserved: Funds were authorised successfully and are reserved on the payment method. Applies tocapture_method: manualflows. The session outcome remainsreservedeven after subsequent capture or void operations, which are tracked on the underlying payment resource.payment_method_verified: No payment was taken. Payment method was verified and vaulted via a supportedamount: 0one_timeorfirst_in_seriessession. Terminal. Only applicable whenamount: 0on those supported session types.
not_started, pending, paid, unpaid, reserved, payment_method_verified The URL where the customer is redirected to complete their payment in a secure payment flow. The customer can choose from a list of available payment methods, complete the payment, and is returned to the return_url once the session is complete.
- Only returned for
one_timeandfirst_in_seriestypes where where the customer is present in the flow and needs to complete the payment. - Not returned for
subsequentpayments where the customer is not present in the flow, and payment is completed automatically.
"https://moment.dev.momentpay.io/checkout/cktNnkWtk7p5GJd85"
The URL where the customer that is present in the payment flow is redirected to after completing the payment.
Only applicable to one_time and first_in_series payment session types where the customer is present in the flow.
The customer is typically redirected on success, cancellation or expiration.
"https://callback.merchant-shop.com"
Indicates whether the payment session is in live or test mode:
test: Used for testing and development. Payments are simulated, and no real transactions are processed. You can use test credit cards and accounts to ensure your integration works as expected before going live.live: Used in production to process real payments. Real credit cards and accounts are used, and actual transactions occur. This mode is for accepting real money from customers.
live, test 
