Create a Payment Session
Create a payment session.
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
A unique key to prevent duplicate operations. Use the same key for retries to ensure idempotent behavior.
Best Practices:
- Use UUIDs or other cryptographically unique identifiers
- Maintain keys for at least 24 hours for retry scenarios
- Use different keys for different operations
- Monitor
Idempotent-Replayedheader for cache hits
1 - 255^[a-zA-Z0-9-]+$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}$Body
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 purpose and target of the payment. Immutable once the session is created. See Payment Allocation for details.
Response
Payment session created
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, reflecting where the session is in its workflow. Always evaluate status together with payment_outcome to determine the session's state and next action. Session completion does not mean payment success.
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 programmatically using a saved payment method. Dependent on the payment session type.completed: The session's workflow ended on its own, either because it achieved its intended outcome or because all permitted payment attempts were used. This does not necessarily mean the payment was successful.expired: The session expired because an applicable expiry deadline was reached before its workflow ended.cancelled: Coming soon. The session was explicitly cancelled by the customer or merchant before its workflow ended.
See Payment Session Lifecycle for the supported states, transitions, and payment_outcome values for each session type.
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. payment_outcome is final only once the session has ended (status is completed, expired, or cancelled). While the session is active, it reflects the most recent payment attempt, so unpaid is not final: if a retry succeeds, the session moves to completed with paid.
not_started: Payment has not been initiated. A draft payment object may exist but nothing is awaiting an outcome. Returned onactivesessions; onexpiredandcancelledsessions,not_startedis coming soon.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).unpaid: No successful payment. While the session isactive, the most recent attempt failed and a retry may still be possible. Once the session has ended, no payment was collected.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.paid: Payment succeeded.payment_method_verified: No payment was taken. Payment method was verified and vaulted via a supportedamount: 0one_timeorfirst_in_seriessession. Only applicable whenamount: 0on those supported session types.
See Payment Session Lifecycle for valid status and payment_outcome combinations.
not_started, pending, unpaid, reserved, paid, 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 
