Initialize an inspection fee payment
Access: Bearer token required.
Starts a Paystack checkout for a property's inspection fee and returns the hosted payment URL. The amount is decided by the server, not the client: the inspectionFee of the property's listing agent (the landlord when there is no agentId), else Setting.defaultInspectionFee, else NGN 5,000. No platform percentage is added. The charge is created against the caller's account email with reference INS-<timestamp>-<random>.
Pass inspectionId to tie the payment to an inspection; it must be the caller's own inspection of that same property and not already paid. The server writes userId, propertyId, inspectionId, type: "inspection" and quotedFee into the Paystack metadata last, so client metadata cannot override them. Nothing is stored locally at this point. The inspection is only marked paid later, by GET /transaction/inspection/verify/{reference} or the Paystack webhook; a payment initialised without inspectionId therefore never updates any inspection.
There is no request validation schema: a malformed propertyId produces a 500 cast error rather than a 400.
bearerAuthAuthorizationBearer <JWT>Access token returned by sign-in. Send it as Authorization: Bearer <token>.
application/json- body
propertyId*stringObjectId of the property being inspected. Determines the fee and who earns it.
inspectionId?stringObjectId of the caller's inspection request to settle. Without it the payment cannot be applied to an inspection.
callbackUrl?stringURL Paystack redirects the payer to after checkout (passed through as callback_url).
metadata?Extra key/values merged into the Paystack metadata. userId, propertyId, inspectionId, type and quotedFee are always overwritten by the server.
Paystack transaction created. Redirect the user to authorization_url (or use access_code with Paystack's inline SDK).
application/json- response
status*integersuccess*booleanmessage*stringdata*curl -X POST 'http://localhost:4000/api/v1/transaction/inspection/initialize' \ -H 'Content-Type: application/json' \ -d '{ "propertyId": "664a0b7e3f2c1d0012ef5a01", "inspectionId": "6660a2d47c3e5b0012de8f31", "callbackUrl": "https://homelinkhub.com/app/inspections"}'{ "status": 200, "success": true, "message": "Inspection payment initialized", "data": { "reference": "INS-1764062400000-K3F9QZ", "authorization_url": "https://checkout.paystack.com/0peioxfhpn", "access_code": "0peioxfhpn" }}
HomeLink Hub