PortWallet is now PortPos
The PortPos API is organised around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object). To make the PortPos API as explorable as possible, accounts have sandbox API keys. These keys can be active at the same time. Data created with test-mode credentials will never hit the credit card networks and will never cost anyone money.
You need to login to PortPos panel to generate App key. Please visit Live panel OR Sandbox panel to generate app key.
PortPos payment URL is:
Sandbox https://payment-sandbox.portpos.com/payment/?invoice=Your_Invoice_ID
Live https://payment.portpos.com/payment/?invoice=Your_Invoice_ID
Create New Invoice for payment
Sandbox endpoint https://api-sandbox.portpos.com/api/v1/
Live endpoint https://api.portpos.com/api/v1/
string
(required) Example: 9c41cf8bce319cc6300cc2c4e9ef7c8f
Application key
Character limit (Max): 32 char
integer
(required) Example: 1424941656
Current timestamp
Character limit (Max): 10 digit Unix Timestamp
string
(required) Example: 249de82fb9a57e88bd3444003093771b
It is the md5 of your secret key + timestamp you provided on second parameter
Character limit (Max): 32 char
string
(required) Example: gen_invoice
gen_invoice
Character limit (Max): Fixed
double
(required) Example: 500.00
The amount you want to charge. Minimum 10.00
Character limit (Max): 8 digit
string
(required) Example: BDT
Only BDT acceptable.
Character limit (Max): 3 char
string
(required) Example: Polo T-shirt
The product name you are selling. It can your order it.1x Polo T-shirt
Character limit (Max): 150 char
string
(required) Example: 1x Polo T-shirt with shipping and handling
Your product description1x Polo T-shirt with shipping and handling
Character limit (Max): 300 char
string
(required) Example: Robbie Amell
Your customer nameRobbie Amell
Character limit (Max): 50 char
string
(required) Example: [email protected]
Your customer email address.[email protected]
Character limit (Max): 50 char
string
(required) Example: +880123456789
Your customer billing phone number.+880123456789
Character limit (Max): 15 char
string
(required) Example: House 1, Road1, Gulshan 1
Your customer billing address.[email protected]
Character limit (Max): 200 char
string
(required) Example: Dhaka
Your customer billing city.[email protected]
Character limit (Max): 50 char
string
(required) Example: Dhaka
Your customer billing state. If there is no state, re-enter city.Dhaka
Character limit (Max): 50 char
string
(required) Example: 1212
Your customer billing zip/postal code.1212
string
(required) Example: BD or BGD
Your customer billing country. It is 2 or 3 digit iso code.BD
Character limit (Max): 3 char iso country code
string
(required) Example: http://www.yoursite.com
Redirect URL for after payment.http://www.yoursite.com
string
(optional) Example: http://www.yoursite.com/ipn
This is ipn url. Where the system will notify when the payment was made. Tt will notify only on success/failed/refund payment.http://www.yoursite.com/ipn
Character limit (Max): 250 char
string
(optional) Example: Robbie Amell
Your customer shipping nameRobbie Amell
Character limit (Max): 50 char
string
(optional) Example: [email protected]
Your customer shipping email address.[email protected]
Character limit (Max): 50 char
string
(optional) Example: +880123456789
Your customer shipping phone number.+880123456789
Character limit (Max): 15 char
string
(optional) Example: House 1, Road1, Gulshan 1
Your customer shipping address.[email protected]
Character limit (Max): 200 char
string
(optional) Example: Dhaka
Your customer shipping city.[email protected]
Character limit (Max): 50 char
string
(optional) Example: Dhaka
Your customer shipping state. If there is no state, re-enter city.Dhaka
Character limit (Max): 50 char
string
(optional) Example: 1212
Your customer shipping zip/postal code.1212
Character limit (Max): 8 digit
string
(optional) Example: BD or BGD
Your customer shipping country. It is 2 or 3 digit iso code.BD
Character limit (Max): 3 char iso country code
200
ShowHide
{
"status":200,
"data":{
"id":"1711",
"client_id":"13",
"amount":"100",
"currency":"BDT",
"name":"",
"email":"[email protected]",
"phone":"0123456789",
"address":"ddd",
"country":"BD",
"state":"dd",
"city":"dd",
"zipcode":"dd",
"ship_to_name":"",
"ship_to_email":"",
"ship_to_phone":"",
"ship_to_address":"",
"ship_to_country":"",
"ship_to_state":"",
"ship_to_city":"",
"ship_to_zipcode":"",
"product_name":"dd",
"product_description":"ddd",
"ipn_url":"",
"gateway_txn_id":"123456789",
"reason":"",
"redirect_url":"http:\/\/www.google.com",
"invoice_id":"854EEE3DCAEA1725"
}
}
{
"status":400,
"data":{
"client_id":"13",
"currency":"BDT",
"name":"",
"email":"[email protected]",
"phone":"0123456789",
"address":"ddd",
"country":"BD",
"state":"dd",
"city":"dd",
"zipcode":"dd",
"ship_to_name":"",
"ship_to_email":"",
"ship_to_phone":"",
"ship_to_address":"",
"ship_to_country":"",
"ship_to_state":"",
"ship_to_city":"",
"ship_to_zipcode":"",
"ipn_url":""
},
"message":{
"amount":"amount is not set",
"product_name":"product_name is not set",
"product_description":"product_description is not set",
"redirect_url":"redirect_url is not set"
}
}
Verify existing transaction
Sandbox endpoint https://api-sandbox.portpos.com/api/v1/
Live endpoint https://api.portpos.com/api/v1/
string
(required) Example: 9c41cf8bce319cc6300cc2c4e9ef7c8f
Application key
integer
(required) Example: 1424941656
Current timestamp
string
(required) Example: 249de82fb9a57e88bd3444003093771b
It is the md5 of your secret key + timestamp you provided on second parameter
string
(required) Example: ipn_validate
ipn_validate
double
(required) Example: 500.00
The amount you want to charge. Minimum 10.00
string
(required) Example: 854EEA58BC861985
Existing invoice number. You should receive invoice number when you generate invoice, through IPN and also with redirect url.854EEA58BC861985
200
ShowHide
{
"status":200,
"data":{
"invoice_id":"854EEEF3240FBB53",
"amount":"100.00",
"buyer_email":"[email protected]",
"buyer_name":"",
"buyer_phone":"0123456789",
"buyer_address":"ddd",
"product_name":"test",
"product_description":"dfdf",
"currency":"BDT",
"payer_account":"467922XXXXXX7653",
"status":"ACCEPTED",
"payer_name":"Sadiqur Rahman",
"ip_address":"192.168.2.39",
"user_agent":"Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36",
"gateway_name":"BRAC Bank Limited",
"gateway_url":"http:\/\/www.bracbank.com",
"issuer_name":"Eastern Bank, Ltd",
"issuer_phone":"+88028332232",
"issuer_website":"http:\/\/www.ebl.com.bd",
"card_brand":"VISA",
"card_type":"credit",
"gateway_txn_id":"123456789",
"reason":"",
"card_category":"Platinum",
"issuer_country_iso2":"BD",
"issuer_country":"Bangladesh"
}
}
{
"status":300,
"data":{
"invoice_id":"854EEF01F62EBB53",
"amount":"100.00",
"buyer_email":"[email protected]",
"buyer_name":"",
"buyer_phone":"0123456789",
"buyer_address":"ddd",
"product_name":"test",
"product_description":"dfdf",
"currency":"BDT",
"payer_account":"411111XXXXXX11",
"status":"REJECTED",
"payer_name":"Test",
"ip_address":"192.168.2.39",
"user_agent":"Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36",
"gateway_name":"BRAC Bank Limited",
"gateway_url":"http:\/\/www.bracbank.com",
"issuer_name":"JPMORGAN CHASE BANK, N.A.",
"issuer_phone":"+14169819200",
"issuer_website":"http:\/\/www.jpmorganchase.com",
"card_brand":"VISA",
"gateway_txn_id":"123456789",
"reason":"Unsuccessful - Declined",
"card_type":null,
"card_category":null,
"issuer_country_iso2":"US",
"issuer_country":"United States"
}
}
}
{
"status":100,
"data":{
"invoice_id":"854EEF0AE647C438",
"amount":"100.00",
"buyer_email":"[email protected]",
"buyer_name":"",
"buyer_phone":"0123456789",
"buyer_address":"ddd",
"product_name":"product name",
"product_description":"product description",
"payer_account":null,
"status":null,
"payer_name":null,
"ip_address":null,
"user_agent":null,
"gateway_name":null,
"gateway_url":null,
"issuer_name":null,
"issuer_phone":null,
"issuer_website":null,
"gateway_txn_id":"",
"reason":"",
"card_brand":null,
"card_type":null,
"card_category":null,
"issuer_country_iso2":null,
"issuer_country":null
}
}
{
"status":400,
"message":"Invalid IPN Request"
}
Retrieve existing transaction
Sandbox endpoint https://api-sandbox.portpos.com/api/v1/
Live endpoint https://api.portpos.com/api/v1/
string
(required) Example: 9c41cf8bce319cc6300cc2c4e9ef7c8f
Application key
integer
(required) Example: 1424941656
Current timestamp
string
(required) Example: 249de82fb9a57e88bd3444003093771b
It is the md5 of your secret key + timestamp you provided on second parameter
string
(required) Example: get_invoice
get_invoice
string
(required) Example: 854EEA58BC861985
Existing invoice number.854EEA58BC861985
200
ShowHide
{
"status":200,
"data":{
"invoice_id":"854EEEF3240FBB53",
"amount":"100.00",
"buyer_email":"[email protected]",
"buyer_name":"",
"buyer_phone":"0123456789",
"buyer_address":"ddd",
"product_name":"test",
"product_description":"dfdf",
"currency":"BDT",
"payer_account":"467922XXXXXX7653",
"status":"ACCEPTED",
"payer_name":"Sadiqur Rahman",
"ip_address":"192.168.2.39",
"user_agent":"Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36",
"gateway_name":"BRAC Bank Limited",
"gateway_url":"http:\/\/www.bracbank.com",
"issuer_name":"Eastern Bank, Ltd",
"issuer_phone":"+88028332232",
"issuer_website":"http:\/\/www.ebl.com.bd",
"card_brand":"VISA",
"card_type":"credit",
"gateway_txn_id":"123456789",
"reason":"",
"card_category":"Platinum",
"issuer_country_iso2":"BD",
"issuer_country":"Bangladesh"
}
}
{
"status":400,
"message":"Invalid Request"
}
Refund Request
Sandbox endpoint https://api-sandbox.portpos.com/api/v1/
Live endpoint https://api.portpos.com/api/v1/
string
(required) Example: 9c41cf8bce319cc6300cc2c4e9ef7c8f
Application key
integer
(required) Example: 1424941656
Current timestamp
string
(required) Example: 249de82fb9a57e88bd3444003093771b
It is the md5 of your secret key + timestamp you provided on second parameter
string
(required) Example: refund_request
refund_request
string
(required) Example: 854EEA58BC861985
The invoice number you want to issue a refund for.854EEA58BC861985
double
(required) Example: 10.00
The amount you want to refund. Amount can not be more than the original invoice amount.10.00
200
ShowHide
{
"status":210,
"data":{
"invoice_id":"854EEEF3240FBB53",
"amount":"100.00",
"buyer_email":"[email protected]",
"buyer_name":"",
"buyer_phone":"0123456789",
"buyer_address":"ddd",
"product_name":"test",
"product_description":"dfdf",
"currency":"BDT",
"payer_account":"467922XXXXXX7653",
"status":"REFUND_PENDING",
"payer_name":"Sadiqur Rahman",
"ip_address":"192.168.2.39",
"user_agent":"Mozilla\/5.0 (Windows NT 6.3; WOW64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/40.0.2214.115 Safari\/537.36",
"gateway_name":"BRAC Bank Limited",
"gateway_url":"http:\/\/www.bracbank.com",
"issuer_name":"Eastern Bank, Ltd",
"issuer_phone":"+88028332232",
"issuer_website":"http:\/\/www.ebl.com.bd",
"card_brand":"VISA",
"card_type":"credit",
"gateway_txn_id":"123456789",
"reason":"",
"card_category":"Platinum",
"issuer_country_iso2":"BD",
"issuer_country":"Bangladesh"
}
}
{
"status":400,
"message":"Refund amount exceeded. Refundable amount is 19.00"
}
Status code 200 means success/accepted.
integer
PENDING
The transaction is pending. The user has not completed the transaction yet.
integer
CANCELLED
Either the user or merchant has cancelled the payment.
integer
EXPIRED
The invoice is expired. Customer did not make the payment in desired time.
integer
ACCEPTED
The request is successful or the transaction has been accepted.
integer
REFUND_PENDING
The refund request has been submitted.
integer
REFUND_PROCESSING
The refund request has been submitted to the acquiring bank.
integer
REFUNDED
The transaction is fully refunded.
integer
PARTIALLY_REFUNDED
The transaction is partially refunded
integer
CHARGED_BACK
We received a charge back request from the issuing bank and we have deducted the transaction amount from your account.
integer
REJECTED
User attempted to pay with his/her card but the payment could not be completed. Either the issuing bank declined the transaction or the card is restricted by the acquiring bank.
integer
INVALID_REQUEST
Your request could not completed. Either you provided wrong parameters or you forgot to provide some mandatory parameters
integer
NOT_ALLOWED
You are not allowed to perform this action.