Skip to Content
HomeLink Hub
Transactions & Payments

Initialize a property booking payment

POST
/api/v1/transaction/booking/initialize

Access: Bearer token required.

Starts a Paystack checkout for a property payment and returns the hosted payment URL as payment_url (note: the inspection variant calls the same value authorization_url). The base amount (NGN) is supplied by the client and is not checked against the property's price; the server adds the platform fee (Setting.platformPropertyFeePercent, default 1%, rounded to the nearest naira) and charges the total. The reference has the form BKG-<timestamp>-<random>, and the metadata always carries userId, propertyId and type: "PROPERTY_BOOKING".

Nothing is stored locally and the property is not looked up, so an unknown propertyId is accepted. There is no verify endpoint for booking payments; the only follow-up is the Paystack webhook's charge.success handling (see POST /transaction/webhook/paystack, including its caveats). title is accepted in the body but ignored.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
amount*number

Base amount in NGN (whole naira, not kobo), before the platform fee. Must be truthy; 0 is rejected.

propertyId*string

ObjectId of the property being paid for. Stored in the Paystack metadata; not validated.

callbackUrl?string

URL Paystack redirects the payer to after checkout (passed through as callback_url).

metadata?

Extra key/values merged into the Paystack metadata. userId, propertyId and type are always overwritten by the server.

title?string

Read from the body but not used.

Response Body

Paystack transaction created. With the default 1% fee, an amount of 4,500,000 is charged as NGN 4,545,000.

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/transaction/booking/initialize' \  -H 'Content-Type: application/json' \  -d '{  "amount": 4500000,  "propertyId": "664a0b7e3f2c1d0012ef5a01",  "callbackUrl": "https://homelinkhub.com/app/property/664a0b7e3f2c1d0012ef5a01"}'
Example Response
{  "status": 200,  "success": true,  "message": "Booking payment initialized",  "data": {    "reference": "BKG-1764062400000-P7XW2M",    "payment_url": "https://checkout.paystack.com/7k2mq1xw9d",    "access_code": "7k2mq1xw9d"  }}