Initialize Transaction
Learn how to initialize a charge to accept payments
Initialize payment
This endpoint is used for initializing a transaction and securely processing payments. It handles everything from customer details to encrypted card information. It also supports 3D Secure for extra security against fraud.
Request Parameters
To get started with the charge API, you can initialize the transaction just like the example request described above. You will be required to pass in some parameters as part of the request. Amount
, transactionRef
, currency
, and callbackUrl
are some of the required parameters accepted. When a transaction is initialized and processed, ideally you want to redirect customers based on the status of the payment. The callbackUrl
passed will be used for this purpose.
You can choose to pass your callbackUrl
as a request parameter here or set it from within your Cepta dashboard settings page. We allow you to set test and production callbackUrl
, to learn more check here.
Ensure transactionRef is unique for every transaction. Unique references are crucial for reconciling transactions with bank statements or payment processors.
Below is a list of request parameters accepted for the purchase API.
Unique reference for the transaction.
Email of the customer making the purchase.
Amount to be charged
Currency of the transaction (e.g., “USD”).
IP address of the customer.
URL to redirect the customer after processing.
Encrypted card details for the payment.
Device information for 3D Secure validation.
Device information is important for 3D Secure verification
Implementing 3D Secure verification helps us to verify that the transaction is being made by the rightful customer, adding an extra layer of security. This information includes details about the customer’s browser and device, such as whether JavaScript is enabled or the screen size.
If the 3D Secure authentication URL threedSecureUrl
is provided, it should be shown to the customer, directing them to a secure page where they can complete the verification process. This ensures the payment is legitimate and helps prevent fraud.
Initialize transaction API Response
A sample response of what to expect when a call is made to the API
Handling transaction response body
When a transaction has been initiated successfully, there is response data that is returned. This can be in turn to update the customer about the current stage of their transaction.
Below is the list of responses to expect and the usage.
Response body
Indicates if the request was successful.
Descriptive message about the request result.
Contains detailed transaction data.