baseUrl
, method
parameter and the Response. You will need to specify one payment method in the method
parameter. Every other parameter remains the same. Here method is string only accepting one payment type.apiKey
in the request headers and provide the required parameters in the body as described in the Parameters section.
https://api.fenanpay.com/api/v1/payment/express/sandbox/pay
Field | Type | Description | Required |
---|---|---|---|
amount | number | The total amount for the payment. Must be a positive number with up to two decimal places. | true* |
items | array of objects | List of items included in the payment. | false |
currency | string | The currency for the payment. | true |
paymentIntentUniqueId | string | Unique identifier for the payment intent. | true |
paymentLinkUniqueId | string | Unique identifier for the payment link. | false |
phoneNumber | string | Phone number for the payment (required for M-PESA). | false |
debitAccount | string | Debit account for the payment. | false |
description | string | Description of the payment. | false |
method | string | Payment method code (TELE_BIRR_USSD, CBE, ETS_SWITCH, M_PESA). | true |
splitPayment | array of objects | Details for splitting the payment among multiple beneficiaries. | false |
returnUrl | string | URL to redirect the user after payment completion (required for non-M-PESA). | true* |
expireIn | integer | Time in seconds before the payment intent expires. | true |
callbackUrl | string | URL to notify the merchant system of the payment status. Must be a valid URL format. | false |
commissionPaidByCustomer | boolean | Indicates if the commission is paid by the customer. | true |
customerInfo | object | Information about the customer. | false |
testMode | object | Test mode configuration (only for sandbox environment). | true* |
Field | Type | Description | Required |
---|---|---|---|
name | string | Name of the item. | true |
description | string | Description of the item. | false |
image | string | URL of the item’s image. | false |
quantity | integer | Quantity of the item. | true |
type | string | Type of the item (SERVICE, DIGITAL_PRODUCT, PHYSICAL_PRODUCT). | true |
price | number | Price of the item. | true |
Field | Type | Description | Required |
---|---|---|---|
amount | number | Amount to be split. | true |
bank | string | Bank for the split payment. | true |
splitType | string | Type of split (PERCENTAGE, NUMBER). | true |
creditAccount | string | Credit account for the split payment. | true |
Field | Type | Description | Required |
---|---|---|---|
string | Email of the customer. | false | |
phone | string | Phone number of the customer. | false |
name | string | Name of the customer. | false |
Field | Type | Description | Required |
---|---|---|---|
testModeType | string | Type of test mode (ACTUAL_TEST, SIMULATED_TEST). | true |
simulationStatus | string | Simulation status (SUCCESS, FAILED, etc.). Required when testModeType is SIMULATED_TEST. | conditional |
ExpressPaymentRequestDto
interface is used to create an express payment with Fenan Pay. Below is an explanation of each field:
items
or amount
must be provided.
SERVICE
, DIGITAL_PRODUCT
, or PHYSICAL_PRODUCT
. (required)ETB
and USD
. This is a required field.TELE_BIRR_USSD
, CBE
, ETS_SWITCH
, and M_PESA
. (required)PERCENTAGE
or NUMBER
. (required)ACTUAL_TEST
or SIMULATED_TEST
. (required)SIMULATED_TEST
. (conditional)Field | Description |
---|---|
status | Status of the response |
message | Message indicating success or error |
content | Checkout is object Payment Response |
Payment Response
object contains the details of the response from the payment service provider. Below is a table describing the fields in the PspPaymentResponseDto
object.
Field | Type | Description | Required |
---|---|---|---|
paymentUrl | String | URL to redirect the user for completing payment. | false |
transactionId | String | Unique identifier for the transaction. | false |
status | PaymentStatus | Status of the payment. | true |
message | String | Message indicating success or error. | false |
PaymentStatus
is an enumeration that represents the possible statuses of a payment. The possible values are:
SUCCESS
FAILURE
phoneNumber
field or in the customerInfo.phone
field.