<
API Documentation
Introduction
This section describes the WestinPay payment gateway API.
WestinPay API is easy to implement in your business software. Our API is well formatted URLs, accepts cURL requests, returns JSON responses.
You can use the API in test mode, which does not affect your live data. The API key is used to authenticate the request and determines if the request is a valid payment or not. For test mode just use the sandbox URL and in case of live mode use the live URL from the section Initiate Payment.
Get The API Key
This section describes how you can get your API key.
Login to your WestinPay merchant account. If you don't have any? Click Here
Next step is to find the API Key menu in your dashboard sidebar. Click the menu.
The API keys can be found there which is Public key and Secret key. Use these keys to initiate the API request. Every time you can generate a new API key by clicking the Generate API Key button. Remember do not share these keys with anyone.
Initiate Payment
This section describes the process of initiating the payment.
To initiate the payment, follow the example code and be careful with the parameters. You will need to make a request with the following API endpoints.
Live End Point: https://westinpay.com/payment/initiate
Test End Point: https://westinpay.com/sandbox/payment/initiate
Test Mode Mail: test_mode@mail.com
Test Mode Verification Code: 222666
Request Method: POST
Request Parameters
Param Name | Param Type | Description |
---|---|---|
public_key | string (50) | Required: Your Public API key |
identifier | string (20) | Required: Identifier is basically for identifying payment at your end |
currency | string (4) | Required: Currency Code, Must be in Upper Case. e.g. USD, EUR |
amount | decimal | Required: Payment amount. |
details | string (100) | Required: Details of your payment or transaction. |
ipn_url | string | Required: The URL of instant payment notification. |
success_url | string | Required: Payment success redirect URL. |
cancel_url | string | Required: Payment cancel redirect URL. |
site_logo | string/url | Required: Your business site logo. |
checkout_theme | string | Optional: Checkout form theme dark/light. Default theme is light. |
customer_name | string (30) | Required: Customer name. |
customer_email | string (30) | Required: Customer valid email. |
Example PHP Code
Example Responses
Error Response
Success Response
Validate The Payment and IPN
This section describes the process to get your instant payment notification.
To initiate the payment follow the example code and be careful with the parameters. You will need to make a request with these following API end points.
End Point: Your business application IPN URL.
Request Method: POST
You will get the following parameters below.
Param Name | Description |
---|---|
status | Payment success status. |
identifier | Identifier is basically for identify payment at your end. |
signature | A hash signature to verify your payment at your end. |
data | Data contains some basic information with charges, amount, currency, payment transaction id etc. |
Sample HTML Form Codes
You can accept payments using the sample HTML codes below.
Codes and parameters:
Param Name | Description |
---|---|
status | Payment success status. |
identifier | Identifier is basically for identify payment at your end. |
public_key | Your WestinPay merchant public key. |
success_url | URL to redirect if payment is successful. |
cancel_url | URL to redirect if payment fails. |
amount | The payment amount you will receive; if you want, you can call the valid parameter on your site. |
identifier | Payment ID, random value can be defined. It is used to make it easier for you to control. |
Supported Currencies
This section describes the currencies supported by WestinPay
WestinPay allows to make transactions with below currencies. Any new currency may update in future.
Currency Name | Currency Symbol | Currency Code |
---|---|---|
United States Dollar | $ | USD |
GBP | £ | GBP |
Euro | € | EUR |
Canadian dollar | CAD | CAD |
Swiss franc | CHF | CHF |
Australian dollar | A$ | AUD |
Hong Kong dollar | HK$ | HKD |
Indian rupee | ₹ | INR |
New Zealand dollar | NZ$ | NZD |
Russian ruble | ₽ | RUB |
Romanian leu | L | RON |
Bulgarian lev | BGN | BGN |
Swedish krona | kr | SEK |
Turkish lira | ₺ | TRY |
Brazilian real | R$ | BRL |
Polish Zloty | zł | PLN |
South Africa ZAR | R | ZAR |
Bitcoin | ₿ | BTC |
ETHEREUM | Ξ | ETH |
DOGECOİN | Ð | DOGE |
AZN MANAT | ₼ | AZN |
TRX | TRX | TRX |
USDT.TRC20 | ₮ | USDT.TRC20 |
SOLONA | SOL | SOL |
LTC | Ł | LTC |
Kazakhstani Tenge | ₸ | KZT |
Ukrainian Hryvnia | ₴ | UAH |
United Arab Emirates Dirham | د.إ | AED |
Hungarian Forint | Ft | HUF |
Georgian Lari | ₾ | GEL |