v2
latestOpenAPI 3.1.12026-08-06856719.6 KBCreate Payment Request
This endpoint creates a new payment request. This is the first step of the payment flow, once you have all the details from the user and are ready to collect payment use this API to create a payment request. Since this is a server-to-server communication, if you have a mobile or Web client that communicates with your REST API, you must have a new endpoint E.g. /create-order, or reuse an existing endpoint. This endpoint will be responsible for making the payment request API call to HitPay.
post/v1/payment-requests
Headers
X-BUSINESS-API-KEYstring required
Example:b286daabf9921b5a01a4621f026c111e046f8911feba212996c92159b98427d
Request body
Example request
{
"amount": 100,
"currency": "SGD",
"payment_methods": [
"card"
],
"staff_id": "98888a24-d6b2-430d-9063-d2be76d443cd",
"location_id": "9dd07721-d215-4947-9c79-2b8ec25f69db",
"business_location_id": "9dd07721-d215-4947-9c79-2b8ec25f69db",
"redirect_url": "https://www.google.com",
"webhook": "https://www.google.com",
"expires_after": "5 minutes"
}Response
200
Example response
{
"id": "974ee233-bc3e-4aac-a212-15af0d155133",
"name": "Buyer_Name_1663650582",
"email": "buyer_1663650582@gmail.com",
"phone": "+6539393939",
"currency": "SGD",
"status": "pending",
"purpose": "Testing",
"reference_number": "12345678",
"url": "https://securecheckout.sandbox.hit-pay.com/payment-request/@ban/974ee233-bc3e-4aac-a212-15af0d155133/checkout",
"redirect_url": "https://hit-pay.postman.co/",
"webhook": "https://hit-pay.postman.co/",
"send_email": true,
"sms_status": "pending",
"email_status": "pending",
"expiry_date": "2022-10-10T01:01:01",
"created_at": "2022-09-20T13:09:42",
"updated_at": "2022-09-20T13:09:42",
"staff_id": "98888a69-2d7a-4695-811d-6df8cee30264",
"business_location_id": "9dd07721-d215-4947-9c79-2b8ec25f69db",
"metadata": {
"key1": "value1",
"key2": "value2 "
}
}