API Documentation

API Endpoints & Authentication

All requests to the Swifin Transact API are sent via the HTTP POST method to one of our API endpoint URLs.

All calls to the Swifin Transact API require merchant authentication and merchant access key. Sign up for a account to quickly get started.
Sandbox payment can be also initiated while merchant set the service mode as test in merchant dashboard. It will be live while the mode will be set as active mode.

API Access Key

Register as a merchant in our system. In your merchant dashboard you will find the option for API access key.

Example access key : 51a4bd18-5bc1-4eaa-97b0-c09323398883

Payment Transaction Initiate

The following example code enables you to initiate a payment,depending on how you structure it. The perameter details are also below.

Param Name Param Type Description
custom string Identification of your end Required
amount decimal The amount you want to transaction Required
details string Purchase details String Max 255
web_hook string Instant payment notification url Required
cancel_url string Payment cancel return url Required
success_url string Payment success return url Required
customer_email string Customer email address Required
access_key string Send access_key as bearer token with header Required
                                
    
            <?php
                $parameters = [
                    'custom' => 'DFU80XZIKS',
                    'currency_code' => 'USD',
                    'amount' => 280.00,
                    'details' => 'Digital Product',
                    'web_hook' => 'http://yoursite.com/web_hook.php',
                    'cancel_url' => 'http://yoursite.com/cancel_url.php',
                    'success_url' => 'http://yoursite.com/success_url.php',
                    'customer_email' => '[email protected]',
                ];
                
                $url = 'http://yourwallet.com/payment/process';
                
                $headers = [
                    "Accept: application/json",
                    "Authorization: Bearer access_key",
                ];
                
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_POSTFIELDS,  http_build_query($parameters));
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $response = curl_exec($ch);
                curl_close($ch);
            ?>
    
                            

Example Response after initiating payment

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
                "message": "Your payment has been processed. Please follow the URL to complete the payment.",
                "url":"https://transact.swifin.com/process-checkout?payment_id=AIYmQIOAz0GlmsjfhgiOeu304"
            }

            //Error Response.
            {
                "code": 401,
                "status": "error",
                "message": "Invalid API credentials."
            }
            
            
        
                            

Response after successful payment

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "payment_id": "AIYmQIOAz0GlmsjfhgiOeu304",
                "transaction": "AIYmQIOAz0G",
                "amount": 100.00,
                "charge": 5.00,
                "currency": "USD",
                "custom": "BVSUZ545XCS",
                "date"  : "22-05-2022"
            }

            
        
                            

Verify Payment

You can verify the payment whether it is valid or not. After successful payment transaction you will have the response where you find the Payment ID. With this payment id and your access key you need make a request to our server for verify the payment. Example code is below.

Payment verify end point : https://transact.swifin.com/payment/check-validity

                                
    
            <?php
                $parameters = [
                    'payment_id' => 'AIYmQIOAz0GlmsjfhgiOeu304',
                ]
                
                $url = 'https://transact.swifin.com/payment/check-validity';
                
                $headers = [
                    "Accept: application/json",
                    "Authorization: Bearer access_key",
                ];
                
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
                curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
                curl_setopt($ch, CURLOPT_URL, $url);
                curl_setopt($ch, CURLOPT_POSTFIELDS,  $parameters);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                $response = curl_exec($ch);
                curl_close($ch);
            ?>
    
                            

Validity Response

                                
        
        
            //Success Response.
            {
                "code": 200,
                "status": "ok",
                "message": "Transaction is valid",
                
            }

            //Error Response.
            {
                "code": 401,
                "status": "error",
                "message": "Invalid API credentials."
            }

            //or
            {
                "code": 404,
                "status": "error",
                "message": "Transaction not found"
            }

            
        
                            

Supported Currencies

Following currencies are currently supported in our system. It may update furthur.

Currency Name Currency Symbol Currency Code
United State Dollar USD USD
Euro EUR EUR
Greate British Pound GBP GBP
Bangladeshi Taka BDT BDT
Bitcoin BTC BTC
Indian Rupee INR INR
Japanese Yen JPY JPY
Nigerian naira NGN NGN
Algerian Dinar DZD DZD
Angolan Kwanza AOA AOA
West African CFA franc XOF XOF
Botswana Pula BWP BWP
Burundian Franc BIF BIF
Cape Verdean Escudo CVE CVE
Central African CFA franc XAF XAF
Comorian Franc KMF KMF
Congolese Franc CDF CDF
Djiboutian Franc DJF DJF
Egyptian Pound EGP EGP
Eritrean Nakfa ERN ERN
Swazi Lilangeni SZL SZL
Ethiopian Birr ETB ETB
Gambian Dalasi GMD GMD
Ghanaian Cedi GHS GHS
Guinean Franc GNF GNF
Kenyan Shilling KES KES
Lesotho Loti LSL LSL
Liberian Dollar LRD LRD
Libyan Dinar LYD LYD
Malagasy Ariary MGA MGA
Malawian Kwacha MWK MWK
Chinese Yuan CNY CNY
Mauritanian Ouguiya MRU MRU
Mauritian Rupee MUR MUR
Moroccan Dirham MAD MAD
Mozambican Metical MZN MZN
Namibian Dollar NAD NAD
Rwandan Franc RWF RWF
Sao Tome and Principe Dobra STN STN
Seychellois Rupee SCR SCR
Sierra Leonean Leone SLL SLL
Somali Shilling SOS SOS
South African Rand ZAR ZAR
South Sudanese Pound SSP SSP
Sudanese Pound SDG SDG
Tanzanian Shilling TZS TZS
Tunisian Dinar TND TND
Ugandan Shilling UGX UGX
Zambian Kwacha ZMW ZMW
Zimbabwean Dollar ZWL ZWL
Jamaican Dollar JMD JMD
Afghan Afghani AFN AFN
Albanian Lek ALL ALL
East Caribbean Dollar XCD XCD
Argentine Peso ARS ARS
Armenian Dram AMD AMD
Australian Dollar AUD AUD
Azerbaijani Manat AZN AZN
Bahamian Dollar BSD BSD
Bahraini Dinar BHD BHD
Barbadian Dollar BBD BBD
Belarusian Ruble BYN BYN
Belize Dollar BZD BZD
Bhutanese Ngultrum BTN BTN
Bolivian Boliviano BOB BOB
Bosnia and Herzegovina Convertible Mark BAM BAM
Brazilian Real BRL BRL
Brunei Dollar BND BND
Bulgarian Lev BGN BGN
Cambodian Riel KHR KHR
Canadian Dollar CAD CAD
Chilean Peso CLP CLP
Colombian Peso COP COP
Costa Rican Colon CRC CRC
Croatian Kuna HRK HRK
Nepalese Rupee NPR NPR
United Arab Emirates Dirham AED AED
Cuban Peso CUP CUP
Czech Koruna CZK CZK
Danish Krone DKK DKK
Dominican Peso DOP DOP
Fijian Dollar FJD FJD
Georgian Lari GEL GEL
Guatemalan Quetzal GTQ GTQ
Guyanese Dollar GYD GYD
Haitian Gourde HTG HTG
Honduran Lempira HNL HNL
Hungarian Forint HUF HUF
Icelandic Krona ISK ISK
Indonesian Rupiah IDR IDR
Iranian Rial IRR IRR
Iraqi Dinar IQD IQD
Israeli New Shekel ILS ILS
Jordanian Dinar JOD JOD
Kazakhstani Tenge KZT KZT
North Korean Won KPW KPW
South Korean Won KRW KRW
Kuwaiti Dinar KWD KWD
Kyrgyzstani Som KGS KGS
Lao Kip LAK LAK
Lebanese Pound LBP LBP
Swiss Franc CHF CHF
Malaysian Ringgit MYR MYR
Maldivian Rufiyaa MVR MVR
Mexican Peso MXN MXN
Moldovan Leu MDL MDL
Mongolian Tugrik MNT MNT
Burmese Kyat MMK MMK
Gold XAU XAU
Zimbabwe Gold ZIG ZIG