3.24. /api/v4/payout-by-ref/

Introduction

Payout By Reference is initiated through HTTPS POST request by using URLs and the parameters specified below. Use OAuth RSA-SHA256 for authentication.

API URLs

IntegrationProduction
https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTIDhttps://pay.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTID
https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/group/ENDPOINTGROUPIDhttps://pay.billblend.com/checkout/api/v4/payout-by-ref/group/ENDPOINTGROUPID

Request Parameters

Note

Request must have content-type=application/x-www-form-urlencoded and Authorization headers.

Parameter NameDescriptionValue
client_orderidConnecting Party’s order identifier.Necessity: RequiredType: StringLength: 128
amountAmount to be charged. The amount has to be specified in the highest units with . delimiter. For instance, 10.5 for USD means 10 US Dollars and 50 Cents.Necessity: RequiredType: NumericLength: 10
currencyCurrency the transaction is charged in (three-letter currency code). Sample values are: USD for US Dollar EUR for European Euro.Necessity: RequiredType: StringLength: 3
destination-card-ref-idCard reference id to destination card, obtained at Card Registration step. For the scenario of payment to a card inside the system, this card will be considered as a destination, and all processing limits, lists and fraud scoring will be applied to it as a destination card.Necessity: RequiredType: NumericLength: 20
order_descBrief order description.Necessity: OptionalType: StringLength: 64
ipaddressReceiver’s IP address (IPv4 or IPv6).Necessity: ConditionalType: StringLength: 7-45
purposePayout purpose.Necessity: ConditionalType: StringLength: 128
server_callback_urlURL the transaction result will be sent to. Connecting Party may use this URL for custom processing of the transaction completion, e.g. to collect sales data in Connecting Party’s database. See more details at Connecting Party Callbacks.Necessity: OptionalType: StringLength: 128
redirect_urlURL, where the Receiver is redirected to upon completion of the transaction. Please note that redirection is performed in any case, no matter whether transaction is approveddeclined in any other final status.Connecting Party must not use the parameters come along with the redirect HTTP Request to treat the status of the transaction. Instead Connecting Party can utilize server_callback_url or status API command. Pass https://doc.billblend.com/ if you have no need to return Receiver anywhere. Use either redirect_url or combination of redirect_success_url and redirect_fail_url, not both.Necessity: OptionalType: StringLength: 128
redirect_success_urlURL, where the Receiver is redirected to when transaction status is approved (See status list).Connecting Party must not use the parameters come along with the redirect HTTP Request to treat the status of the transaction. Instead Connecting Party can utilize server_callback_url or status API command. Otherwise put https://doc.billblend.com/ if there is no need to redirect Receiver anywhere. Use either combination of redirect_success_url and redirect_fail_url or redirect_url, not both.Necessity: OptionalType: StringLength: 1024
redirect_fail_urlURL, where the Receiver is redirected to when transaction status is not approved (See status list).Connecting Party must not use the parameters come along with the redirect HTTP Request to treat the status of the transaction. Instead Connecting Party can utilize server_callback_url or status API command. Pass https://doc.billblend.com/ if there is no need to redirect Receiver anywhere. Use either combination of redirect_fail_url and redirect_success_url or redirect_url, not both.Necessity: OptionalType: StringLength: 1024
account_numberAccount Number.Necessity: ConditionalType: StringLength: 24
account_nameBank account.Necessity: OptionalType: StringLength: 128
ewallet_typeType of e-wallet.Necessity: ConditionalType: StringLength: 64
ewallet_walletE-wallet ID.Necessity: ConditionalType: StringLength: 128
crypto_wallet_addressAddress of crypto wallet.Necessity: ConditionalType: StringLength: 64
bank_nameBank Name.Necessity: ConditionalType: StringLength: 255
bank_branchBank Branch Name.Necessity: ConditionalType: StringLength: 255
bank_codeBank code.Necessity: ConditionalType: StringLength: 32
bank_cityBank city.Necessity: ConditionalType: StringLength: 128
bank_address1Bank address.Necessity: ConditionalType: StringLength: 255
bank_zip_codeBank postal ZIP code.Necessity: ConditionalType: StringLength: 255
bank_provinceBank province.Necessity: ConditionalType: StringLength: 255
bank_areaBank area.Necessity: ConditionalType: StringLength: 255
routing_numberRouting number used to identify specific bank branches in China.Necessity: ConditionalType: StringLength: 16
legal_person_nameName on the legal document.Necessity: ConditionalType: StringLength: 128
legal_person_document_numberNumber of legal document.Necessity: ConditionalType: StringLength: 128
receiver_first_nameReceiver first name, also can be sent as first_name.Necessity: ConditionalType: StringLength: 128
receiver_last_nameReceiver last name, also can be sent as last_name.Necessity: ConditionalType: StringLength: 128
receiver_birthdayReceiver birthday, also can be sent as birthday.Necessity: ConditionalType: NumericLength: 30
receiver_country_codeReceiver country code, also can be sent as country.Necessity: ConditionalType: StringLength: 3
receiver_stateReceiver state, should be provided for countries that have states (USA, Canada, Australia), also can be sent as state.Necessity: ConditionalType: StringLength: 4
receiver_cityReceiver city, also can be sent as city.Necessity: ConditionalType: StringLength: 128
receiver_zip_codeReceiver zip code, also can be sent as zip_code.Necessity: ConditionalType: NumericLength: 32
receiver_address1Receiver address, also can be sent as address1.Necessity: ConditionalType: StringLength: 256
receiver_phoneReceiver phone, also can be sent as phone.Necessity: ConditionalType: NumericLength: 128
receiver_emailReceiver E-mail, also can be sent as email.Necessity: ConditionalType: StringLength: 128
receiver_identity_document_idReceiver identity document identifier, also can be sent as identity_document_id.Necessity: ConditionalType: StringLength: 128
receiver_identity_document_numberReceiver identity document number, also can be sent as identity_document_number.Necessity: ConditionalType: StringLength: 128
merchant_dataAny additional information for this transaction which may be useful in Connecting Party’s external systems, e.g. VIP customerTV promo campaign lead. Will be returned in Status response and Connecting Party Callback.Necessity: OptionalType: StringLength: 64k
bank_bicBIC of the receiver’s bank.Necessity: OptionalType: StringLength: 128
receiver_innReceiver’s INN.Necessity: OptionalType: StringLength: 128
customer_levelCustomer level in CMS systemNecessity: OptionalType: VarcharLength: 32
customer_idCustomer ID in CMS system. Required if transaction goes via CMS (Payment Gateway mode)Necessity: OptionalType: IntLength: 10
merchant_customer_identifierMerchant Customer ID in CMS system. Required if transaction goes via CMS (CRM mode)Necessity: OptionalType: VarcharLength: 64
card-ref-idCard reference ID used in subsequent recurring payments. Card reference ID can be created with v4 tokenization request or v2 tokenization request.Necessity: ConditionalType: Long

* Ask Support Manager if Conditional fields are Required for integration.

Response Parameters

Note

Response has Content-Type: text/html;charset=utf-8 header. All fields are x-www-form-urlencoded, with (0xA) character at the end of each parameter’s value.

Payout Request ParametersDescription
typeThe type of response. May be async-responsevalidation-errorerror. If type equals validation-error or errorerror-message and error-code parameters contain error details
paynet-order-idOrder id assigned to the order by Billblend.
merchant-order-idConnecting Party order id.
serial-numberUnique number assigned by Billblend server to particular request from the Connecting Party.
error-messageIf status is error this parameter contains the reason for decline or error details.
error-codeThe error code is case of error status.

Request Example

POST /paynet/api/v4/payout-by-ref/121799 HTTP/1.1
Host: sandbox.billblend.com
User-Agent: curl/8.4.0
Accept: */*
Authorization: OAuth oauth_consumer_key="ErwinTestMerchant", oauth_nonce="8qsDrhiDelGHlxY01aDjCh44u7isXJjL", oauth_signature="WpbNcRxNSDW%2BdJgftRc%2BAN0oe8KAP4CNpUkxjxStFYZEU9Vo%2F7uk9dSKEG%2B76C%2FdlzemILaRmikQqZg93ZK1cibT8zy97uYVDdWVmY2obDSOVb8UipGjt2KFUyKr4awHW9xH%2BTzbR%2FMXwm3y%2Fx2RotElZWxumsL37P5Q%2BCquoAGcO6jjkvkkSH9P4lBYKSmwhfqD4O%2Br8FB3exzNzl2FFBTwLp4ch2G9Cis5a0CkVrpjDB%2FbbbrOutbNPZYhtH45rNz91QAbpvNJ91XjVwxiCm4lCldIO66gF73GQNSFKVG1mstc%2B941Dj1bVhXWQQW%2F9TyPiXfWGP8szg18rwsTHbj1zKCRIaw%2FqVbrOBPhbo%2BJjGMZp2hB1ei0%2FUPIkjeIZkWD2NgJRQEniJfjU7AlILs91augm50fPwWR5JiOuE5uSvwM6VWgXMpYe4USb819ZAK%2BFYTRI%2BenrycFZHmY%2BafOlaOHFtpnbn8FsrzzNbOvGXmXCt2xXAQTaORqMeLRRtkD3DY4rJa8qeO0zYnmT4ZhKsFZjImDdonA3WTG8G7awP9W0RKhHlUGwGaugRWbdPjSbGMhAzs58Y9ptvExr6GwAHhJU1RbzfWL4wCzVbH8%2BAC6I0OrkB13tw2eXP4yIPtEC7iGu%2FkElGz4OrwFEU6cUcEDpeEOmA2%2Fe%2BZFK0w%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1721975900", oauth_version="1.0"
Content-Length: 74
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive

amount=10.42
&client_orderid=1
&currency=USD
&destination-card-ref-id=1461897

Success Response Example

HTTP/1.1 200
Server: server
Date: Fri, 26 Jul 2024 06:39:23 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
Content-Language: en-US
Strict-Transport-Security: max-age=31536000
Content-Length: 138

type=async-response
&serial-number=00000000-0000-0000-0000-000002f36e41
&merchant-order-id=1
&paynet-order-id=7363634
&end-point-id=121799

Fail Response Example

HTTP/1.1 200
Server: server
Date: Fri, 26 Jul 2024 06:42:43 GMT
Content-Type: text/html;charset=utf-8
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Strict-Transport-Security: max-age=31536000
Content-Language: en-US
Strict-Transport-Security: max-age=31536000
Content-Length: 170

type=validation-error
&serial-number=00000000-0000-0000-0000-000002f36e42
&error-message=Project+with+currency+USD+does+not+apply+request+with+currency+AZN
&error-code=16

Postman Collection

Postman Collection is available at this link – https://doc.billblend.com/integration/API_commands/api_v4_payout-by-ref.html#postman-collection

Request Builder

Request Builder is available at this link – https://doc.billblend.com/integration/API_commands/api_v4_payout-by-ref.html#request-builder

Debug form
URL
parameters
loginlogin should be used as Consumer Public for OAuth
curl -H 'Authorization: OAuth oauth_consumer_key="paydroid", oauth_nonce="rVYrDzxMt43qiuoaNZ9D70ApUJLwThWh", oauth_signature="K98LnZCrQgHrfijFm7%2FGDQAV%2FWy0YS1%2B%2B0MJ2YELQJ8UXBLdbaVbu0zvazi63GSwuOq2UfICscp%2F6frUdXXaXFz7hPlQ%2BI1D5XZ8XQnVbnjltazXi5BEPiEZbNT3lZkcwlPQZeBrK45u0rQD8m9Q5sFYDyHNqxg5%2FiDnUPTRShqmegTYwmdu%2B8Lt%2B3M5nDi837vr5HEOQ0IAB%2FJ%2FEF7w6xGkLh6iRpt%2FlH5A5%2F9POc0ZwLHmRQIfed0dd03GZ4CeVFEMmUAQmz58x14a6XDannj3e5RwixNozTDus4Xuct06g1X1PY2yWwZ8tqMCTtEA%2FRzF%2B6bUX1cIA1Grsb1AfiaD%2BFJ%2BlUQwB9dmQsN42NJXQbL8q3Vnt5OPPiH252G8BDtA5ed%2ByX%2BUugR7nrbZzp%2FGvfSDFJHbRgh5gzrxUFqfsiCdfo%2FF4YolEeTPJassen8BbannbKjZO00NRzttJikeH2J3oPqqsjUad72BD7uCyz6hxkwdE%2FL9yhe1FpN3gC%2BpbDIpQaKh68%2FDxO%2BF6ZgtHeKT%2Fo7rwgocSdLikQx5V%2BGHpF9r%2BQV4HSCSKY%2FfMgQXVFGaesMjrfGwFfxOboG8q59X4sGhcd5R%2B0Z0vgcKVEcBCrK%2BLdYKXOclx2BmUEhOBK%2Bga%2BkVMCLbSosXK0cSM9S4qeGosngxnOkjtSU%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200290", oauth_version="1.0"' --data 'amount=10.42&client_orderid=1&currency=USD&destination-card-ref-id=1461897' 'https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTID'
<?php

/**
 * Executes request
 *
 * @param       string      $url                Url for payment method
 * @param       array       $requestFields      Request data fields
 * @param       array       $customHeaders      Custom request headers
 *
 * @return      array                           Host response fields
 *
 * @throws      RuntimeException                Error while executing request
 */
function sendRequest($url, array $requestFields, array $customHeaders = array())
{
    $curl = curl_init($url);

    curl_setopt_array($curl, array
    (
        CURLOPT_HEADER         => 1,
        CURLOPT_USERAGENT      => 'Billblend-Client/1.0',
        CURLOPT_SSL_VERIFYHOST => 0,
        CURLOPT_SSL_VERIFYPEER => 0,
        CURLOPT_POST           => 1,
        CURLOPT_RETURNTRANSFER => 1
    ));

    $headersJoiner = function($key, $value) {
        return "{$key}: {$value}";
    };

    curl_setopt($curl, CURLOPT_HTTPHEADER, array_map($headersJoiner, array_keys($customHeaders), array_values($customHeaders)));
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($requestFields));

    $response = curl_exec($curl);

    if(curl_errno($curl))
    {
        $error_message  = 'Error occurred: ' . curl_error($curl);
        $error_code     = curl_errno($curl);
    }
    elseif(curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200)
    {
        $error_code     = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        $error_message  = "Error occurred. HTTP code: '{$error_code}'. Response: {$response}";
    }

    curl_close($curl);

    if (!empty($error_message))
    {
        throw new RuntimeException($error_message, $error_code);
    }

    if(empty($response))
    {
        throw new RuntimeException('Host response is empty');
    }

    $responseFields = array();

    parse_str($response, $responseFields);

    return $responseFields;
}


$requestFields = array(
    'currency' => 'USD', 
    'amount' => '10.42', 
    'client_orderid' => '1', 
    'destination-card-ref-id' => '1461897', 

);

$customHeaders = array(
    'Authorization' => 'OAuth oauth_consumer_key="paydroid", oauth_nonce="rVYrDzxMt43qiuoaNZ9D70ApUJLwThWh", oauth_signature="K98LnZCrQgHrfijFm7%2FGDQAV%2FWy0YS1%2B%2B0MJ2YELQJ8UXBLdbaVbu0zvazi63GSwuOq2UfICscp%2F6frUdXXaXFz7hPlQ%2BI1D5XZ8XQnVbnjltazXi5BEPiEZbNT3lZkcwlPQZeBrK45u0rQD8m9Q5sFYDyHNqxg5%2FiDnUPTRShqmegTYwmdu%2B8Lt%2B3M5nDi837vr5HEOQ0IAB%2FJ%2FEF7w6xGkLh6iRpt%2FlH5A5%2F9POc0ZwLHmRQIfed0dd03GZ4CeVFEMmUAQmz58x14a6XDannj3e5RwixNozTDus4Xuct06g1X1PY2yWwZ8tqMCTtEA%2FRzF%2B6bUX1cIA1Grsb1AfiaD%2BFJ%2BlUQwB9dmQsN42NJXQbL8q3Vnt5OPPiH252G8BDtA5ed%2ByX%2BUugR7nrbZzp%2FGvfSDFJHbRgh5gzrxUFqfsiCdfo%2FF4YolEeTPJassen8BbannbKjZO00NRzttJikeH2J3oPqqsjUad72BD7uCyz6hxkwdE%2FL9yhe1FpN3gC%2BpbDIpQaKh68%2FDxO%2BF6ZgtHeKT%2Fo7rwgocSdLikQx5V%2BGHpF9r%2BQV4HSCSKY%2FfMgQXVFGaesMjrfGwFfxOboG8q59X4sGhcd5R%2B0Z0vgcKVEcBCrK%2BLdYKXOclx2BmUEhOBK%2Bga%2BkVMCLbSosXK0cSM9S4qeGosngxnOkjtSU%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200290", oauth_version="1.0"'
);

$responseFields = sendRequest('https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTID', $requestFields, $customHeaders);

print_r($responseFields);

?>
require 'net/http'
require 'uri'
require 'cgi'

##
# Executes request
#
# @param    url               [String]    Url for payment method
# @param    request_fields    [Hash]      Request data fields
# @param    custom_headers    [Hash]      Custom request headers
#
# @return   [Hash]    Host response fields
def send_request(url, request_fields, custom_headers = [])
  begin
    uri = URI url

    response = Net::HTTP.start uri.hostname, uri.port, :use_ssl => uri.scheme == 'https' do |http|
      post = Net::HTTP::Post.new uri.request_uri
      post.set_form_data request_fields

      custom_headers.each do |key, value|
        post[key] = value
      end

      http.request post
    end
  rescue Exception => e
    raise RuntimeError, "Error occurred. #{e.message}"
  end

  unless Net::HTTPOK === response
    raise RuntimeError, "Error occurred. HTTP code: '#{response.code}'. Response: '#{response.body}'"
  end

  unless response.body
    raise RuntimeError, 'Host response is empty'
  end

  # Change hash format from {'key' => ['value']} to {'key' => 'value'} in map block
  Hash[CGI.parse(response.body).map {|key, value| [key, value.first]}]
end

request_fields = {
    'currency' => 'USD', 
    'amount' => '10.42', 
    'client_orderid' => '1', 
    'destination-card-ref-id' => '1461897', 

}

custom_headers = {
    'Authorization' => 'OAuth oauth_consumer_key="paydroid", oauth_nonce="rVYrDzxMt43qiuoaNZ9D70ApUJLwThWh", oauth_signature="K98LnZCrQgHrfijFm7%2FGDQAV%2FWy0YS1%2B%2B0MJ2YELQJ8UXBLdbaVbu0zvazi63GSwuOq2UfICscp%2F6frUdXXaXFz7hPlQ%2BI1D5XZ8XQnVbnjltazXi5BEPiEZbNT3lZkcwlPQZeBrK45u0rQD8m9Q5sFYDyHNqxg5%2FiDnUPTRShqmegTYwmdu%2B8Lt%2B3M5nDi837vr5HEOQ0IAB%2FJ%2FEF7w6xGkLh6iRpt%2FlH5A5%2F9POc0ZwLHmRQIfed0dd03GZ4CeVFEMmUAQmz58x14a6XDannj3e5RwixNozTDus4Xuct06g1X1PY2yWwZ8tqMCTtEA%2FRzF%2B6bUX1cIA1Grsb1AfiaD%2BFJ%2BlUQwB9dmQsN42NJXQbL8q3Vnt5OPPiH252G8BDtA5ed%2ByX%2BUugR7nrbZzp%2FGvfSDFJHbRgh5gzrxUFqfsiCdfo%2FF4YolEeTPJassen8BbannbKjZO00NRzttJikeH2J3oPqqsjUad72BD7uCyz6hxkwdE%2FL9yhe1FpN3gC%2BpbDIpQaKh68%2FDxO%2BF6ZgtHeKT%2Fo7rwgocSdLikQx5V%2BGHpF9r%2BQV4HSCSKY%2FfMgQXVFGaesMjrfGwFfxOboG8q59X4sGhcd5R%2B0Z0vgcKVEcBCrK%2BLdYKXOclx2BmUEhOBK%2Bga%2BkVMCLbSosXK0cSM9S4qeGosngxnOkjtSU%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200290", oauth_version="1.0"'
}

response_fields = send_request('https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTID', request_fields, custom_headers);

require 'pp'
pp response_fields
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
    //Transactions are initiated by using URL in the following format: /checkout/api/v4/TRANSACTION_TYPE/ENDPOINTID or /checkout/api/v4/TRANSACTION_TYPE/ENDPOINTGROUPID (if group is supported)
    //Use "gate" for production purposes or "sandbox" for integration needs
    private static String targetURL = "https://sandbox.billblend.com/checkout/api/v4/payout-by-ref/ENDPOINTID";
    //Request parameters
    private static String urlParameters = "amount=10.42&client_orderid=1&currency=USD&destination-card-ref-id=1461897";

    public static void main(String[] args) {
        //Sending POST request to the specified URL with request parameters
        System.out.println(executePost(targetURL, urlParameters));
    }

    public static String executePost(String targetURL, String urlParameters)
    {
        URL url;
        HttpURLConnection connection = null;
        try {
            //Create connection
            url = new URL(targetURL);
            connection = (HttpURLConnection)url.openConnection();
            connection.setDoOutput(true);
            boolean hasHeaders = true;
            if(hasHeaders){
                String header ="OAuth oauth_consumer_key=\"paydroid\", oauth_nonce=\"rVYrDzxMt43qiuoaNZ9D70ApUJLwThWh\", oauth_signature=\"K98LnZCrQgHrfijFm7%2FGDQAV%2FWy0YS1%2B%2B0MJ2YELQJ8UXBLdbaVbu0zvazi63GSwuOq2UfICscp%2F6frUdXXaXFz7hPlQ%2BI1D5XZ8XQnVbnjltazXi5BEPiEZbNT3lZkcwlPQZeBrK45u0rQD8m9Q5sFYDyHNqxg5%2FiDnUPTRShqmegTYwmdu%2B8Lt%2B3M5nDi837vr5HEOQ0IAB%2FJ%2FEF7w6xGkLh6iRpt%2FlH5A5%2F9POc0ZwLHmRQIfed0dd03GZ4CeVFEMmUAQmz58x14a6XDannj3e5RwixNozTDus4Xuct06g1X1PY2yWwZ8tqMCTtEA%2FRzF%2B6bUX1cIA1Grsb1AfiaD%2BFJ%2BlUQwB9dmQsN42NJXQbL8q3Vnt5OPPiH252G8BDtA5ed%2ByX%2BUugR7nrbZzp%2FGvfSDFJHbRgh5gzrxUFqfsiCdfo%2FF4YolEeTPJassen8BbannbKjZO00NRzttJikeH2J3oPqqsjUad72BD7uCyz6hxkwdE%2FL9yhe1FpN3gC%2BpbDIpQaKh68%2FDxO%2BF6ZgtHeKT%2Fo7rwgocSdLikQx5V%2BGHpF9r%2BQV4HSCSKY%2FfMgQXVFGaesMjrfGwFfxOboG8q59X4sGhcd5R%2B0Z0vgcKVEcBCrK%2BLdYKXOclx2BmUEhOBK%2Bga%2BkVMCLbSosXK0cSM9S4qeGosngxnOkjtSU%3D\", oauth_signature_method=\"RSA-SHA256\", oauth_timestamp=\"1753200290\", oauth_version=\"1.0\"";
                connection.setRequestProperty("Authorization", header);
                connection.setRequestProperty("cache-control", null);
                connection.setRequestProperty("pragma", null);
            }


            //Send request
            DataOutputStream wr = new DataOutputStream (
                    connection.getOutputStream ());
            wr.writeBytes (urlParameters);
            wr.flush ();
            wr.close ();


            //Get Response
            InputStream is = connection.getInputStream();
            BufferedReader rd = new BufferedReader(new InputStreamReader(is));
            String line;
            StringBuffer response = new StringBuffer();
            while((line = rd.readLine()) != null) {
                response.append(line);
                response.append('\n');
            }
            rd.close();
            return response.toString();

        } catch (Exception e) {

            e.printStackTrace();
            return null;

        } finally {

            if(connection != null) {
                connection.disconnect();
            }
        }
    }
}

Contact us

By clicking on the button, you agree to the data protection policy

Complete the quiz

By clicking on the button, you agree to the data protection policy