Checkout and Remittance
Allows generation of Checkout Links and International Remittance.
Overview
The Remittance and Checkout feature provides users with the ability to create branded, customizable payment links that can be shared publicly to receive money. The checkout links allow payments for various purposes, including donations, e-commerce, fundraisers, pledges, or other financial needs.
Key Features:
Pledge Support:
The amount can be a fixed value or determined by the public user (e.g., donations).
User Information:
Public users can optionally provide their name and phone number during payment, depending on app preferences.
Branding:
Checkout links can include a title, description, logo, and website link for branding purposes.
By default, the logo will use the company’s logo or a default image if not specified.
Transaction Costs:
Each payment automatically calculates and applies applicable transaction costs. These costs are recorded separately and linked to the primary transaction for accurate reconciliation.
Integration:
Supports payments via Visa/MasterCard, M-Pesa (with STK Push), PayPal, and other channels.
Real-Time Completion:
The payment completes in real-time, and the payer sees a confirmation page with payment details.
For M-Pesa, the public user receives an STK push on their phone to complete the transaction.
Transaction Mapping:
Payment references and transaction costs are mapped to the checkout ID for traceability.
Endpoint: Create a Checkout Link
Method:
POST
URL:
/api/checkout/create
Request Body:
Request Body Fields:
Field
Type
Required
Description
appId
string
Yes
The app ID associated with the checkout.
userId
string
Yes
The user ID for whom the checkout link is created.
purpose
string
Yes
The purpose of the checkout link (e.g., fundraiser, product).
pledgeAllowed
boolean
Yes
Indicates if users can specify their own amount.
fixedAmount
boolean
Yes
If true
, the amount is fixed; if false
, it's user-determined.
amount
number
No
The amount for the transaction (optional if pledgeAllowed=true).
metadata
object
No
Additional information about the link, such as a reference ID.
branding
object
No
Custom branding options for the checkout link.
branding.title
string
No
The title displayed on the checkout page.
branding.description
string
No
The description displayed on the checkout page.
branding.logoUrl
string
No
The logo URL to display; defaults to the app's logo if null.
branding.websiteLink
string
No
A website link displayed on the checkout page.
Endpoint: Record a Payment via Checkout
Method:
POST
URL:
/api/checkout/payment
Request Body:
Request Body Fields:
Field
Type
Required
Description
checkoutId
string
Yes
The unique ID of the checkout.
payerDetails
object
No
Details of the payer (optional).
payerDetails.name
string
No
The name of the payer.
payerDetails.phoneNumber
string
No
The phone number of the payer.
amountPaid
number
Yes
The amount paid by the payer.
transactionChannel
string
Yes
The channel used (e.g., mpesa, paypal).
transactionReference
string
Yes
The reference for the payment.
transactionCost
object
Yes
Details of the associated transaction cost.
transactionCost.amount
number
Yes
The amount of the transaction cost.
transactionCost.type
string
Yes
The type of the cost (e.g., mpesa).
transactionCost.parentTransactionId
string
Yes
Links the transaction cost to the parent transaction.
timestamp
string
Yes
The date and time of the transaction.
Transaction Costs
Each transaction cost is treated as a separate record, linked to the parent transaction for reconciliation purposes.
Costs are calculated based on predefined rates and stored with the following fields:
Field
Description
amount
The cost of the transaction.
type
The cost type (e.g., mpesa, paypal).
parentTransactionId
The ID of the related primary transaction.