Registration and verification
1 Sign up for an account with SANTRAPAY https://secure.santrapay.com/site/signup
2 Log in to your account and proceed to the Merchant Activation page: https://secure.santrapay.com/merchant
3 Complete the necessary boxes on the left side of the screen and select the available payment methods for your Merchant on the right side. Website address should contain a protocol, example: https://my-merchant-site.com .
Thereafter click on the "Send request" button. The added website will appear in the bottom of the page. To view the merchant parameters simply click on the website link.
4 Complete the site verification: https://secure.santrapay.com/verification/merchant.
Select the site and click on the "Confirm" button. An automatic request will be created to the Santrapay Support Service that you want to confirm your site. Save the received text file and place it in the root directory of the site, without changing its name.
https://my-merchant-site.com/6023275085114c5c1b7c4ddc1998d447.txt
Integration
1 Select the added website from the list in the bottom of the page: https://secure.santrapay.com/merchant
You will need the following parameters:
- Merchant ID
- Secret
- Payment Methods ID
2 Create a payment.
Payment parameters are specified in the form of an associative array. Then they are coded and the signature is created from their hash.
Parameter | Key | Description |
---|---|---|
Merchant | merchant | Your Merchant ID |
Order | order | Order number in your system |
Price | amount | The amount you wish to receive from the buyer |
Currency | currency | The currency of the price amount |
Description | desc | The description of the payment (Not requered) |
Payment method | method | Payment Method ID (Not requered) |
Show payment method selection button | allowchoice | In case the parameter allowchoice = true, the special button will redirect a customer on the page with list of others payment methods. In case the parameter do not specify, a customer will not see others payment options. (Not requered) |
$params = [ 'merchant' => 235, 'order' => '12345ABC', 'amount' => 51.3, 'currency' => 'EUR', 'desc' => 'purchase #43968', ]; $secret = 'Your_Secret'; $data = base64_encode(json_encode($params)); $sign = hash_hmac('sha256', $data, $secret);
If you set the "method" in parameters, example:
$params['method'] =>
123,
then the client will be automatically transferred to the approrpiate payment method checkout page upon clicking on the payment button.
Available methods:
Method | Payment Methods ID |
---|---|
Bitcoin | 2 |
Etherium | 3 |
If the 'method' is set blank:
$params['method'] =>
'',
then the client will be automatically transferred to the SANTRAPAY checkout page upon clicking on the payment button.
3) Create the payment form.
It is required to specify the $data and $sign obtained values. As the result, payment form will look like this:
SANTRAPAY supports several languages. To set the specific language of checkout page, you should send the form with a language prefix: https://secure.santrapay.com/ru/api/merchant
4) Set the payment handler.
After the payment is made, the details will be sent to the Process URL of your merchant.
Please contact the SANTRAPAY support in order to set the Process URL:
https://secure.santrapay.com/support
Data in the form of an associative array is transferred to the payment processor using the POST request.
Data has the following structure:
$_POST = [ 'order' => string, 'data' => array, 'sign' => string, ];
The information contained under the key 'data', also has the structure of an associative array:
Parameter | Key | Description |
---|---|---|
Invoice date | date | The date the ionvoice has been issued |
Payment date | payDate | The date the payment has been made |
Invoice amount | amount | The amount of the issued invoice |
Invoice currency | currency | The currency of the issued invoice |
Payment method | method | Payment method name used to pay for the invoice |
Payment currency | methodCurrency | The currency used to pay for the invoice |
Payment amount | methodAmount | Invoice amount converted to the actual payment currency |
Total amount | methodAmount | Total invoice amount in the payment currency including fee |
Santrapay transaction | transaction | SANTRAPAY transaction number |
Transaction in the network | transactionNetwork | Transaction number in the Blockchain |
Enrollment currency | transactionCurrency | The currency in which the merchant receives the funds on the SANTRAPAY account balance |
Enrollment amount | transactionAmount | The amount of funds, merchant receives on the SANTRAPAY account balance |
Total amount | transactionTotal | Total amount of the transaction including fees in SANTRAPAY system. |
Description | desc | The description of the payment |
Payment delay | cautionPaymentDelay | Payment delay in seconds. It is indicated if the buyer made the payment, but for some reason, she came to Santrapay with a delay |
Partial payment | cautionPartialPayment | The partial payment amount in the SANTRAPAY enrollment currency. Specified in case buyer did not pay the full amount (in case of cryptocurrency). |
In response to the transmitted parameters, our service will wait for your response.
The response MUST be as follows:
- Start with the words 'success' or 'error'.
- The through the '|' character can contain a URL for the buyer's redirect.
- Be no longer than 255 characters.
An example of a simple handler:
$post = $_POST; $secret = 'Your_Secret'; if (isset($post['order'], $post['data'], $post['sign'])) { $data = base64_encode(json_encode($post['data'])); $sign = hash_hmac('sha256', $data, $secret); if ($sign == $post['sign']) { if (isset($post['data']['cautionPartialPayment'])) { exit("error|https://my-merchant-site.com/payment/error/?order={$post['order']}"); } exit("success|https://my-merchant-site.com/payment/complete/?order={$post['order']}"); } }
Transfers in Bitcoins will be credited to your merchant account only after 3 confirmations, while process URL notifications are sent after 2 confirmations.
Payment in the SANTRAPAY system will not be completed until the payment is processed by your website and we do not receive the correct response.
After receiving a correct response from your payment processor, the buyer will be notified of the successful / unsuccessful payment, and also suggested to go to the specified URL, if it's transferred.
Authentication
Authentication is performed via Http Bearer Token. The token is issued after receiving the application. The answer from the server in JSON format .
Information on the authorized user
https://secure.santrapay.com/api/
curl -X GET "https://secure.santrapay.com/api/" -H "accept: application/json" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Example for to PHP:
if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); $out = curl_exec($curl); curl_close($curl); }
Transactions History
https://secure.santrapay.com/api/history
account - the wallet number you would like to see the history for
curl -X POST "https:// secure.santrapay.com/api/history " -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Example for to PHP:
$postData = array ( 'account' => 'RD1234567', ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/history'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Balance Information
https://secure.santrapay.com/api/balance
account - the wallet number you want to receive a balance for
currency - currency
curl -X POST "https:// secure.santrapay.com/api/balance " -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Example for to PHP:
$postData = array ( 'currency' => 'USD', 'account' => 'RD1234567', ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/balance'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Payouts \ Mass Payments
https://secure.santrapay.com/api/payout
merchant - Merchant ID in the SANTRAPAY system
to - account number, email, phone number or crypto address of the recipient in the SANTRAPAY system
amount - the amount of payment
currency - payment currency
fee - How to understand, who will pay fee:in case without params, the fee will take from the merchant, in case with params and if the word true, or number 1, the fee will take from the customer
curl -X POST "https://secure.santrapay.com/api/payout" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "merchant=123456&to=RD1234567&amount=10¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Returns the JSON string with the transaction number when the operation succeeded.
Example for to PHP:
$postData = array ( 'amount' => 10, 'currency' => 'USD', 'to' => 'client@gmail.com', 'merchant' => 12345678, ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/payout'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Send money
https://secure.santrapay.com/api/transfer
from - Your wallet number, from which the payment will be made
to - account number, email, phone number or crypto address of the recipient in the SANTRAPAY system
the amount of payment
payment currency
curl -X POST "https://secure.santrapay.com/api/transfer" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "from=RD1234567&to=RD1234568&amount=10¤cy=USD" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Returns the JSON string with the transaction number when the operation succeeded.
Example for to PHP:
$postData = array ( 'from' => 'RD1234567', 'to' => 'RD1234568', 'amount' => 10, 'currency' => 'USD', ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/transfer'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Checking of availability of wallet
https://secure.santrapay.com/api/check-account
the wallet number that should be checked
curl -X POST "ttps://secure.santrapay.com/api/check-account" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "account=RD1234567" -H "Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533"
Returns a JSON string true or false
{"success":true}
Example for to PHP:
$postData = array ( 'account' => 'RD1234567', ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/check-account'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer a9ac071cda6f4bd6e20d29695c9a4533'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Customers payouts
Payout API requests require a header for authentication
Headers
Authorization: Bearer {{access_token}}
The first step is requesting the offer
https://secure.santrapay.com/api/withdrawal/request
POST:
Required parameters | |
---|---|
Parameter | Description |
amount | The requested withdrawal amount |
currency | Currency of the requested withdrawal amount |
currency_in | Transaction currency |
account_in | Account for transfer (you can specify email, wallets, crypto addresses, etc.) |
order | Merchant order ID |
merchant | Merchant ID in the SANTRAPAY system |
Additional parameters | |
client_id | Merchant customer ID |
desc | Custom transaction description |
The second step is confirmation of the request
https://secure.santrapay.com/api/withdrawal/confirm
POST:
Parameter | Description |
---|---|
offer_id | The offer ID in the SANTRAPAY system |
merchant | Merchant ID in the SANTRAPAY system |
sign | Sign |
The sign is formed as follows:
$sign = hash_hmac('sha256', $offer_id . $merchant, {{secret}});
The response is returned in JSON format.:
Example of a good answer:
{"status":"success","tx":"5B89B69E5533B2A9F2CAC64B6"}
tx - hash transaction in the SANTRAPAY system
Example of an answer with an error:
{"name":"Bad Request","message":"Amount cannot be blank.","code":0,"status":400}
{"name":"Bad Request","message":"Offer already paid","code":100,"status":400}
Deposit via bank
https://secure.santrapay.com/api/deposit/request
curl --location --request POST "https://secure.santrapay.com/api/deposit/request" \ --header "Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35" \ --header "Content-Type: application/x-www-form-urlencoded" \ --form "amount=99" \ --form "currency=USD" \ --form "oid=17" \ --form "language=English" \ --form "senderFirstName=Test Name" \ --form "senderSecondName=Test Name" \ --form "email=test@gmail.com" \ --form "address=Test Address" \ --form "senderCountry=India" \ --form "bankName=SBI" \ --form "bankCountry=India" \ --form "sign=f9e16383cf4c06649741207a54a814ba8f047505c99bf1bbfd8370c16e50955d" \ --form "file[]=@"
POST:
Parameter | Description |
---|---|
amount | Amount of Deposit |
currency | Deposit Currency |
oid | Merchant Order id |
language | Invoice language |
senderFirstName | Name |
senderSecondName | Surname |
address | Sender Address |
senderCountry | Sender Country |
bankName | Sender Bank Name |
bankCountry | Sender Bank Country |
sign | Sign |
file[] | Upload documents |
Steps for request signature:
Step 1: Signature raw data:
{"oid":"17","amount":"99","currency":"USD","senderFirstName":"Test Name","senderSecondName":"Test Name"}
Step 2: Base 64 of step 1:
eyJvaWQiOiIxNyIsImFtb3VudCI6Ijk5IiwiY3VycmVuY3kiOiJVU0QiLCJzZW5kZXJOYW1lIjoiVGVzdCBOYW1lIn0=
Step 3:
hash_hmac('sha256',’<output of step2>’, $secret) of step 2
f9e16383cf4c06649741207a54a814ba8f047505c99bf1bbfd8370c16e50955d
Example for PHP:
$postData = array ( 'amount' => 10, 'currency' => 'USD', 'oid' => '17', 'language'=>'English', 'senderFirstName'=>'Test Name', 'senderSecondName'=>'Test Name', 'email'=>'test@gmail.com', 'address'=>'Test Address', 'senderCountry'=>'Country', 'bankName'=>'Bank', 'bankCountry'=>'Country' 'sign'=>'cc6b36890daeca59a828dd83483fad139a0e68c733602a25147b9d8371c8db4d' ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/deposit/request'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Response Example Success:
{ "responseData": { "currency": "USD", "amount": "99", "datetime": "2019-02-25 13:38:23", "depositId": 441, "status": 0, "invoiceNumber": "12121", "invoice": "https://secure.santrapay.com/api/deposit/invoice?id=441" }, "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "responseData": null, "result": { "status": "error", "message": "Invalid authorization" } }
Get Deposit Status
https://secure.santrapay.com/api/deposit/status
curl --location --request POST "https://secure.santrapay.com/api/deposit/status" \ --header "Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data "depositId=406&oid="
depositId -> Deposit id
or
oid -> Merchant Order id
Example for PHP:
$postData = array ( 'depositId' => 73, 'oid' => ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/deposit/status'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Response Example Success:
{ "responseData": { "id": "406", "amount": "99.0000000000000000", "currency": "USD", "depositAmount": null, "depositCurrency": "USD", "status": "0", "datetime": "2019-02-21 10:44:11", "datetimeProcessed": null, "invoiceNumber": "2348" }, "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "responseData": null, "result": { "status": "error", "message": "Invalid authorization" } }
Deposit Status Change Callback:
Callback Example:
{ "id": 498, "amount": "100.0000000000000000", "currency": "USD", "depositAmount": null, "depositCurrency": "USD", "status": "1", "datetime": "2019-03-14 09:18:26", "datetimeProcessed": null, "invoiceNumber": "2563", "oid": "Invoice #2563", "sign": "48a4421f0a3a5a36fda1a70b7b78c73e79923bd18cffaae48a169d8c27df47f8" }
Steps for notification Sign Creation:
Raw data for sign:
{"id":498,"amount":"100.0000000000000000","currency":"USD","depositAmount":null,"depositCurrency":"USD","status":"1","datetime":"2019-03-14 09:18:26","datetimeProcessed":null,"invoiceNumber":"2563","oid":"Invoice #2563"}
base64 of step1:
eyJpZCI6NDk4LCJhbW91bnQiOiIxMDAuMDAwMDAwMDAwMDAwMDAwMCIsImN1cnJlbmN5IjoiVVNEIiwiZGVwb3NpdEFtb3VudCI6bnVsbCwiZGVwb3NpdEN1cnJlbmN5IjoiVVNEIiwic3RhdHVzIjoiMSIsImRhdGV0aW1lIjoiMjAxOS0wMy0xNCAwOToxODoyNiIsImRhdGV0aW1lUHJvY2Vzc2VkIjpudWxsLCJpbnZvaWNlTnVtYmVyIjoiMjU2MyIsIm9pZCI6Ikludm9pY2UgIzI1NjMifQ==
Hash of step2:
hash_hmac('sha256',<output of step2>, 'cp52uedlhxc0sk8sowwsokc48ksoogo')
48a4421f0a3a5a36fda1a70b7b78c73e79923bd18cffaae48a169d8c27df47f8
Withdraw By Bank Transfer
https://secure.santrapay.com/api/withdraw/request
curl --location --request POST "https://secure.santrapay.com/api/withdraw/request" \ --header "Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35" \ --header "Content-Type: application/x-www-form-urlencoded" \ --form "amount=10" \ --form "currency=USD" \ --form "oid=17" \ --form "beneficiaryType=individual" \ --form "account=A123456" \ --form "iban=12121212" \ --form "bankSwift=S1234" \ --form "paymentsDetails=Test" \ --form "receiverCountry=IN" \ --form "receiverZip=12345" \ --form "receiverCity=Test" \ --form "receiverAddress=Test Address" \ --form "receiverFirstName=First" \ --form "receiverLastName=Last" \ --form "corporateName=Corporate Name" \ --form "comment=Comment" \ --form "sign=8fbf350c2e05f605d75ae606103e5ef4c64ae7e4c2ee733ba1481f4a44a50a55" \ --form "file[]=@"
POST:
Parameter | Description |
---|---|
amount | Withdraw amount |
currency | Withdraw Currency |
oid | Merchant Order id |
beneficiaryType | Beneficiary Type i.e individual or legal |
account | Account Number |
iban | IBAN |
bankSwift | Bank SWIFT |
paymentsDetails | Payments Details |
receiverCountry | Receiver Country. Country Code 2 char |
receiverZip | Receiver ZIP |
receiverCity | Receiver City |
receiverAddress | Receiver Address |
receiverFirstName | Require if beneficiaryType is “individual” |
receiverLastName | Require if beneficiaryType is “individual” |
corporateName | Require if beneficiaryType is “legal“ |
comment | Comment |
sign | Sign |
file[] | Upload documents - Optional |
Steps for request signature:
Step 1: Signature raw data:
{"oid":"17","amount":"10","currency":"USD","account":"A123456","iban":"12121212","bankSwift":"S1234"}
Step 2: Base 64 of step 1:
eyJvaWQiOiIxNyIsImFtb3VudCI6IjEwIiwiY3VycmVuY3kiOiJVU0QiLCJhY2NvdW50IjoiQTEyMzQ1NiIsImliYW4iOiIxMjEyMTIxMiIsImJhbmtTd2lmdCI6IlMxMjM0In0=
Step 3:
hash_hmac('sha256',’<output of step2>’, '‘cp52uedlhxc0sk8sowwsokc48ksoogo’') of step 2
8fbf350c2e05f605d75ae606103e5ef4c64ae7e4c2ee733ba1481f4a44a50a55
Example for PHP:
$postData = array ( ‘amount’ => 10, ‘currency’ => ‘USD’, ‘oid’ => ‘17’, ‘beneficiaryType’ => ‘individual’, ‘account’ => ‘A123456’, ‘Iban’ => ‘12121212’, ‘bankSwift’ => ‘S1234’, ‘paymentsDetails’ => ‘Test’, ‘receiverCountry’ => ‘IN’, ‘receiverZip’ => ‘12345’, ‘receiverCity’ => ‘Test’, ‘receiverAddress’ => ‘Test Address’, ‘receiverFirstName’ => ‘First’, ‘receiverLastName’ => ‘Last’, ‘corporateName’ => ‘Corporate Name’, ‘comment’ => ‘Comment’ ‘sign’ => ‘8fbf350c2e05f605d75ae606103e5ef4c64ae7e4c2ee733ba1481f4a44a50a55’, ‘file’ => [] ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/withdraw/request'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Response Example Success:
{ "responseData": { "currency": "USD", "amount": 7.5, "fee": 2.5, "datetime": "2019-03-13 12:33:43", "withdrawalId": 105, "status": 0, "invoiceNumber": "2542" }, "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "responseData": null, "result": { "status": "error", "message": "Invalid authorization" } }
Get Bank Withdraw Status
https://secure.santrapay.com/api/withdraw/status
curl --location --request POST "https://secure.santrapay.com/api/withdraw/status" \ --header "Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35" \ --header "Content-Type: application/x-www-form-urlencoded" \ --data "withdrawalId=406&oid="
withdrawalId -> Withdraw Id
or
oid -> Merchant Order id
Example for PHP:
$postData = array ( ‘withdrawalId’ => 406, 'oid' => ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/withdrawdeposit/status'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Response Example Success:
{ "responseData": { "id": "93", "amount": "7.5000000000000000", "currency": "USD", "fee": "2.5000000000000000", "status": "0", "datetime": "2019-03-11 09:49:44", "invoiceNumber": "2518" }, "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "responseData": null, "result": { "status": "error", "message": "Invalid authorization" } }
Deposit Verification
https://secure.santrapay.com/api/deposit/verification
curl --location --request POST "https://secure.santrapay.com/api/deposit/verification" \ --header "Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35" \ --header "Content-Type: application/x-www-form-urlencoded" \ --form "depositId=496" \ --form "oid=" \ --form "file[]=@"
file[] -> Documents
depositId -> Deposit Id
or
oid -> Merchant Order id
Example for PHP:
$postData = array ( ‘file’ => [], ‘depositId’ => 496, 'oid' =>’’ ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://secure.santrapay.com/api/deposit/verification); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); $headers = array(); $headers[] = 'Authorization: Bearer 584fa7dda45ec9a4d9b5b56508db4e35'; curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, TRUE); curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData)); $out = curl_exec($curl); curl_close($curl); }
Response Example Success:
{ "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "result": { "status": "error", "message": "Documents already provided" } }
Withdraw application through the form
The first step is requesting to withdraw
https://secure.santrapay.com/api/merchant/payment-withdraw
POST:
Required parameters | |
---|---|
Parameter | Description |
merchant | Merchant ID in the SANTRAPAY system |
order | Merchant order ID |
amount | The requested withdrawal amount |
currency | Currency of the requested withdrawal amount |
desc | Custom transaction description |
Additional parameters | |
sign | Sign |
The sign is formed as follows:
$params = [ 'merchant' => '235', 'order' => '12345ABC', 'amount' => '51.3', 'currency' => 'EUR', 'desc' => 'purchase #43968', ]; $secret = 'Your_Secret'; $data = base64_encode(json_encode($params)); $sign = hash_hmac('sha256', $data, $secret);
In response you will get Withdraw form page with additional fields that needs to submit:
The second step is submission of the additional request data to withdraw
https://secure.santrapay.com/api/merchant/withdraw-submit
POST:
Parameter | Description |
---|---|
beneficiaryType | Beneficiary type |
receiverFirstName | Receiver first name |
receiverLastName | Receiver last name |
corporateName | Corporate name |
account | Account |
bankSwift | Bank SWIFT |
paymentsDetails | Payments Details |
receiverCountry | Receiver Country |
receiverCity | Receiver City |
receiverAddress | Receiver Address |
receiverZip | Receiver ZIP |
В ответ вы получите страницу успеха транзакции с деталями транзакции или страницу ошибки, or error page.
Merchant add customers documents
https://secure.santrapay.com/api/merchant/add-customers
POST:
Required parameters | |
---|---|
Parameter | Description |
firstName | Customers First Name |
lastName | Customers Last Name |
file[] | Upload documents |
Response Example Success:
{ "responseData": { "first_name": "zzzzz", "last_name": "ccccc", "email": "test@gmail.com", "merchant_id": 10 }, "result": { "status": "success", "message": "Transaction successful" } }
Response Example Fail:
{ "responseData": null, "result": { "status": "error", "message": "Invalid input" } }