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

Response

200
application/json

Payment link generated successfully

The response is of type object.