HPP - Initiate Payment¶
This endpoint initiates a Hosted Payment Page (HPP) payment. The response will contain a payment link that redirects your customer to Wipays' secure checkout page.
HTTP Request¶
POST http://{{DOMAIN}}/payment/initiate
Request Example¶
curl -X POST https://{{DOMAIN}}/payment/initiate \
-H "Content-Type: application/json" \
-d '{
"public_key": "your_api_key",
"amount": "",
"billing_info": {
"address_one": "",
"address_two": "",
"area": "",
"city": "",
"sub_city": "",
"state": "",
"postcode": "",
"country": "",
"others": "",
},
"cancel_url": "",
"currency": "USD",
"customer": {
"first_name": "",
"last_name": "",
"email": "",
"mobile": "",
},
"details": "",
"identifier": "",
"ipn_url": "",
"shipping_info": {
"address_one": "",
"address_two": "",
"area": "",
"city": "",
"sub_city": "",
"state": "",
"postcode": "",
"country": "",
"others": "",
},
"site_name": "",
"site_logo": "",
"success_url": "",
}'
Field Order
Fields are sorted in alphabetical order.
Response Example¶
{
"status": "success",
"message": "Payment initiated successfully",
"redirect_url": "https://wipays.com/payment/checkout?payment_trx=UNIQUE_PAYMENT_ID"
}
Request Parameters¶
| Parameter | Required | Description | Example |
|---|---|---|---|
| public_key | true | Your API key. | "your_api_key" |
| amount | true | The amount to be paid. | 100.00 , 100 |
| cancel_url | true | The URL to redirect the customer to if the payment is canceled. | "https://yourdomain.com/cancel" |
| currency | true | The currency of the payment | "USD", "EUR", "CAD" |
| customer | true | The customer's information. (see Customer parameters) | See Customer parameters |
| details | true | The details of the payment. Max 255 symbols. | "Payment for order #123" |
| identifier | true | A unique identifier for the payment. Preferrably uuid. Max 255 symbols. | YOUR_UNIQUE_IDENTIFIER |
| ipn_url | true | The URL to send payment notifications to. | "https://yourdomain.com/ipn" |
| site_name | true | The name of your website. | "Your Website" |
| success_url | true | The URL to redirect the customer to after a successful payment. | "https://yourdomain.com/success" |
| payment_method_type | false | The type of payment method to be used. Default: "card" | "card", "card_and_sepa" |
| billing_info | false | The billing information of the customer. | See Billing Info parameters |
| shipping_info | false | The shipping information of the customer. | See Shipping Info parameters |
| site_logo | false | The URL to your website's logo. | "https://yourdomain.com/logo.png" |
Customer Parameters¶
| Parameter | Required | Description | Example |
|---|---|---|---|
| first_name | true | The customer's first name. | "John" |
| last_name | true | The customer's last name. | "Doe" |
| true | The customer's email. | "[email protected]" | |
| mobile | true | The customer's mobile number. | "+1234567890" |
Billing Info Parameters¶
| Parameter | Required | Description |
|---|---|---|
| address_one | false | The first line of the customer's address. |
| address_two | false | The second line of the customer's address. |
| area | false | The area of the customer's address. |
| city | false | The city of the customer's address. |
| sub_city | false | The sub-city of the customer's address. |
| state | false | The state of the customer's address. |
| postcode | false | The postcode of the customer's address. |
| country | false | The country of the customer's address. |
| others | false | Any other information about the customer's address. |
Shipping Info Parameters¶
| Parameter | Required | Description |
|---|---|---|
| address_one | false | The first line of the customer's address. |
| address_two | false | The second line of the customer's address. |
| area | false | The area of the customer's address. |
| city | false | The city of the customer's address. |
| sub_city | false | The sub-city of the customer's address. |
| state | false | The state of the customer's address. |
| postcode | false | The postcode of the customer's address. |
| country | false | The country of the customer's address. |
| others | false | Any other information about the customer's address. |
Response Parameters¶
| Parameter | Description | Example |
|---|---|---|
| status | The status of the request. | "success" |
| message | The message of the request. | "Payment initiated successfully" |
| redirect_url | The payment URL to redirect the customer to. | "https://wipays.com/payment/checkout?payment_trx=UNIQUE_PAYMENT_ID" |
Important Note
Do not use payment_trx parameter from the payment URL for tracking the payment. Make sure you provide your own unique identifier, by which you will track the IPN
Next Steps¶
- Set up IPN notifications to receive payment status updates
- Learn about H2H payments for direct integration without redirects