Skip to main content
POST
/
initiate-pay
Generate a Payment Link
curl --request POST \
  --url https://sandbox.fapshi.com/initiate-pay \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --header 'apiuser: <api-key>' \
  --data '{
  "amount": 101,
  "email": "jsmith@example.com",
  "redirectUrl": "<string>",
  "userId": "<string>",
  "externalId": "<string>",
  "message": "<string>"
}'
{
  "message": "<string>",
  "link": "<string>",
  "transId": "<string>",
  "dateInitiated": "2023-12-25"
}

Endpoint

POST /initiate-pay Generate a payment link where users complete payment on a prebuilt Fapshi checkout page.

Parameters

NameRequiredTypeDescription
amountYesintegerAmount to be paid (minimum 100 XAF).
emailNostringIf set, the user won’t have to provide an email during payment.
redirectUrlNostringURL to redirect the user after payment.
userIdNostringYour internal user ID (1-100 chars; a-z, A-Z, 0-9, -, _).
externalIdNostringTransaction/order ID for reconciliation (1-100 chars; a-z, A-Z, 0-9, -, _).
messageNostringReason for payment.

Response

  • 200 OK with JSON body containing:
    • message: success message
    • link: URL for user payment
    • transId: transaction ID to track payment status
    • dateInitiated: date when the payment was initiated
  • Errors return 4XX with a message explaining the failure.
Payment links expire after 24 hours and cannot be used afterward.

Authorizations

apiuser
string
header
required
apikey
string
header
required

Body

application/json
amount
integer
required

Amount to be paid (minimum 100 XAF).

Required range: x >= 100
email
string<email>

Optional user email to skip during payment.

redirectUrl
string<uri>

URL to redirect after payment.

userId
string

Internal user ID (1-100 chars; a-z, A-Z, 0-9, -, _).

externalId
string

Transaction/order ID for reconciliation (1-100 chars; a-z, A-Z, 0-9, -, _).

message
string

Reason for payment.

Response

Payment link generated successfully

message
string

Success message

URL to redirect the user to complete payment.

transId
string

Transaction ID for payment.

dateInitiated
string<date>

Date when the payment was initiated.

I