Payments
Overview
A payment refers to an individual attempt to process a charge against a specific payment method. Each payment attempt is a distinct operation that may succeed or fail independently. A single transaction can involve multiple payment attempts if retries are required.
For more details on initiating payments, refer to the Initiate Payment API.
Payment Attempts Explained
- Single Attempt: A simple one-time payment with no retries.
- Multiple Attempts: If a payment fails, the platform automatically retries using alternative processors or payment methods (if configured).
Payment Attempt States:
- Initiated: Payment request is sent to the payment processor.
- Pending: Payment is under review or awaiting customer action (e.g., 3D Secure).
- Authorized: Payment was approved but not yet captured.
- Captured: Funds have been transferred from the customer.
- Failed: Payment attempt failed, and the platform may retry.
- Refunded: Payment was refunded (full or partial).
For more information on payment states, see the Payments API reference.
Payment Methods
The platform supports various payment methods, including:
- Credit/Debit Cards: Securely processed through tokenized transactions.
- Bank Transfers: Supports real-time and batch transfers.
- Mobile Money
- Digital Wallets: PayPal, Apple Pay, and others.
To view available payment methods, check the Get Available Payment Methods API.
Example Payment Payload
For the full schema, refer to the Payment Initiate Request Schema.
Handling Payment Failures
The platform retries failed payment attempts automatically. Merchants can configure retry rules to maximize success rates. In cases where retries are exhausted, a webhook notification will be sent to the merchant for further action.
For more details on handling failures, see the Error Response Schema.
Payment Capture and Refunds
- Capture: Payments must be captured to finalize the transfer of funds.
- Refunds: Payments can be refunded (partially or fully) based on merchant policies.
To refund a payment, use the Create Refund API. Refunds are issued against a session and accept a refundValue object (minorAmount plus ISO 4217 currency); see Full and Partial Refunds for details.
Cancelling a Payment
Cancellation is split across two endpoints depending on whether you want to cancel an entire checkout session or a single transaction.
Cancel a session
POST /checkout/session/cancel takes a sessionId and cancels the whole session. The session is locked against any further payment attempts, and every in-flight transaction linked to the session is cancelled in the same call. Transactions already in a terminal state (settled, failed, refunded) are not affected.
If one of those in-flight transactions is being processed by a provider that does not support cancelling an in-progress transaction, the session enters the PENDING_CANCELLATION state. While in this state:
- No further payment attempts can be initiated against the session.
- The session is not considered fully cancelled — it only moves to
CANCELLEDonce the outstanding transaction reaches its own terminal state.
The response returns the session’s resulting status (CANCELLED or PENDING_CANCELLATION), the transactions that were successfully cancelled in cancelledTransactionIds, and any unstoppable in-flight transactions in pendingTransactionIds.
Clean cancel — every in-flight transaction was cancellable, so the session reaches CANCELLED immediately:
Pending cancellation — one of the in-flight transactions belongs to a provider that does not support in-process cancellation. The session is locked but not yet terminal; it will move to CANCELLED once the listed transaction reaches its own terminal state on the rail:
Cancel a transaction
POST /payment/{transactionId}/cancel cancels a single transaction by its id. No session id is required — the transaction id is sufficient. The transaction’s session and any other transactions on it remain active.
A transaction can only be cancelled while it is in a non-terminal state and while its originating provider supports cancelling an in-progress transaction. Otherwise the call returns 409.
Security and Compliance
- PCI Compliance: Merchants must ensure PCI compliance when handling card data directly.
- 3D Secure Authentication: The platform supports 3D Secure to reduce fraud.
For more information on security, refer to the Security and Compliance Documentation.
External Resources
For a complete list of API operations and schemas, visit the API Documentation.