3.27. /api/v4/transfer-by-ref

Introduction

Deposit to card transfer (D2C) is a money transfer from Connecting Party bank account (Deposit) and Receiver bank card number (PAN) or tokenized card data (Card Reference ID). Deposit to card 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/transfer-by-ref/ENDPOINTIDhttps://pay.billblend.com/checkout/api/v4/transfer-by-ref/ENDPOINTID
https://sandbox.billblend.com/checkout/api/v4/transfer-by-ref/group/ENDPOINTGROUPIDhttps://pay.billblend.com/checkout/api/v4/transfer-by-ref/group/ENDPOINTGROUPID

Request Parameters

Note

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

Parameters marked as Conditional* can be mandatory for specific integrations. For more information, please contact your manager in Billblend.

Parameter NameDescriptionValue
client_orderidConnecting Party order identifier.Necessity: RequiredType: StringLenght: 128
loginConnecting Party’s login. Must be used as oauth_consumer_key in OAuth Authorization, not included in request as login parameter.Necessity: RequiredType: StringLenght: 20
destination-card-noCard number of destination card. Mandatory if destination-card-ref-id omitted. 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: ConditionalType: StringLenght: 16-19
destination-card-ref-idCard reference id to destination card, obtained at Card Registration step. Mandatory if destination-card-no omitted. 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: ConditionalType: NumericLenght: 20
amountAmount to be transferred. 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: NumericLenght: 10
currencyCurrency the transaction is charged in (three-letter currency code). Example ofВ  valid parameter values are: USD for US Dollar EUR for European Euro.Necessity: RequiredType: StringLenght: 3
order_descOrder description.Necessity: RequiredType: StringLenght: 64k
receiver_identity_document_seriesReceiver’s identity document series (e.g. 4 digits for domestic passport).Necessity: OptionalType: StringLenght: 512
receiver_identity_document_numberReceiver’s identity document number (e.g. 6 digits for domestic passport).Necessity: OptionalType: StringLenght: 512
receiver_identity_document_idReceiver’s identity document id. Possible values: 21 for domestic passport or 31 for international passport.Necessity: OptionalType: StringLenght: 512
receiver_address1Receiver’s address.Necessity: Conditional*Type: StringLenght: 512
receiver_cityReceiver’s city.Necessity: Conditional*Type: StringLenght: 512
receiver_first_nameReceiver first name.Necessity: RequiredType: StringLenght: 128
receiver_middle_nameReceiver middle name.Necessity: OptionalType: StringLenght: 128
receiver_last_nameReceiver last name.Necessity: RequiredType: StringLenght: 128
receiver_phoneReceiver full international cell phone number, including country code.Necessity: OptionalType: StringLenght: 128
receiver_residentIs receiver a resident?Necessity: OptionalType: BooleanLenght: true/false
ipaddressCustomer’s IP address, included for fraud screening purposes.Necessity: OptionalType: StringLenght: 45
first_nameSender first name.Necessity: OptionalType: StringLenght: 128
middle_nameSender middle name.Necessity: OptionalType: StringLenght: 128
last_nameSender last name.Necessity: OptionalType: StringLenght: 128
ssnLast four digits of the Sender’s social security number.Necessity: OptionalType: NumericLenght: 32
birthdaySender date of birth, in the format MMDDYY.Necessity: OptionalType: NumericLenght: 8
address1Sender address line 1.Necessity: OptionalType: StringLenght: 50
citySender city.Necessity: OptionalType: StringLenght: 50
stateSender’s state. Please see Appendix A for a list of valid state codes. Mandatory for USA, Canada and Australia.Necessity: OptionalType: StringLenght: 2-3
zip_codeSender ZIP code.Necessity: OptionalType: StringLenght: 10
receiver_zip_codeReceiver ZIP code.Necessity: Conditional*Type: StringLenght: 10
countrySender country(two-letter country code). Please see Appendix B for a list of valid country codes.Necessity: OptionalType: StringLenght: 2
receiver_country_codeReceiver country(two-letter country code). Please see Appendix B for a list of valid country codes.Necessity: OptionalType: StringLenght: 2
phoneSender full international phone number, including country code.Necessity: OptionalType: StringLenght: 15
cell_phoneSender full international cell phone number, including country code.Necessity: OptionalType: StringLenght: 15
emailSender email address.Necessity: OptionalType: StringLenght: 50
purposeDestination to where the payment goes. It is useful for the Connecting Parties who let their clients to transfer money from a credit card to some type of client’s account, e.g. game or mobile phone account. Sample values are: +7123456789gamer0001@ereality.com etc. This value will be used by fraud monitoring system.Necessity: OptionalType: StringLenght: 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: StringLenght: 128
redirect_urlURL the cardholder will be redirected to upon completion of the transaction. Please note that the cardholder will be redirected in any case, no matter whether the transaction is approved or declined. See more details at Statuses.Necessity: OptionalType: StringLenght: 250
redirect_success_urlURL the cardholder will be redirected to upon completion of the transaction. Please note that the cardholder will be redirected only in case if the transaction is approved.Necessity: OptionalType: StringLenght: 1024
redirect_fail_urlURL the cardholder will be redirected to upon completion of the transaction. Please note that the cardholder will be redirected only in case if the transaction is declined or filtered.Necessity: OptionalType: StringLenght: 1024
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: StringLenght: 64k

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.

Response parameterDescription
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 /checkout/api/v4/transfer-by-ref/39915 HTTP/1.1
Host: sandbox.billblend.com
User-Agent: curl/7.83.0
Accept: */*
Authorization: OAuth oauth_consumer_key="TestMerchant", oauth_nonce="w1rmMzx2Sq2k5Hi7KAZmdhHHD6BygKcE", oauth_signature="rXn0DwLOlaV%2Ft1q3s%2FJdLybJTdxKKN0XeFtyVNZ0U5bG0Qfcc6iyHqQG66Ohb852CYKjhrxvG3wf33RlIQdO9f23OSg91JkdrUgl8QDrMqntC5myWGR1woums%2BMjpV821fAY8AS%2BBByNUKOuC1mwFgLYwr5YinbhjDa6P8aEdHgbf%2FVw5vg9OqjwKxJhSXPGB5mIg7T9gTNXF4n4YTUJA0l%2BWyeGcIjuTSsiCUnbsrNjBOGYc0PlUSuHirwJ0NiKVdHk3qaZrGaEw8SZEq%2F8x0naoaaOXUq%2FkpqPfTJT%2FjTl%2FbGyX1x%2FwTl6EYgIElavHYj2psIGmFnyUk%2FYnaGZHikE00rSf4IkG5Ye2M4hyl7lKQOCXMZMvvGtfvLm0RsAod8o30KuDD5Tw%2BRmDiQNCqN8GeZawHsZipgwZuy2IdZ3sHiot3U6NEt1OVH9TsWDU%2FstfBJOWBBStTRTTh4hn3Zvf5jLuTfTcepKz4CIgdQGGmMmRSz6dcBnkYJaa7VRTh27dz%2BnEuC0laEYAytVuzQA43MvUXNLmAuh9JlmqQquAZwB%2BRFfLPgOj%2FVVsFsqX35UWBYQtWlWdEVc3jWBVxCjEW0s8cAcowlb4R2g4V48HC2Rz3ggfINzP9%2FWtX1nkNnIlzQAeYbMREguYqFrK%2BYK6Lqyu%2BM1jeo6j9CWhhk%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1697442690", oauth_version="1.0"
Content-Length: 805
Content-Type: application/x-www-form-urlencoded
Connection: close

address1=10020Main%20st
&amount=100
&birthday=19820115
&cell_phone=%2B19023384543
&city=Seattle
&client_orderid=34T43R77N
&country=US
&currency=USD
&destination-card-ref-id=1461819
&email=john.smith%40gmail.com
&first_name=John
&ipaddress=65.153.12.232
&last_name=Smith
&merchant_data=VIP%20customer
&middle_name=M
&order_desc=Test%20Order%20Description
&phone=%2B12063582043
&purpose=user_account1
&receiver_address1=Red%20Sq%2C%201a
&receiver_city=Moscow
&receiver_first_name=Jane
&receiver_identity_document_id=21
&receiver_identity_document_number=222222
&receiver_identity_document_series=1111
&receiver_last_name=Doe
&receiver_middle_name=L
&receiver_phone=%2B79031110022
&receiver_resident=true
&redirect_url=http%3A%2F%2Fwww.example.com%2F
&server_callback_url=https%3A%2F%2Fhttpstat.us%2F200
&ssn=1267&state=WA
&zip_code=98102

Success Response Example

HTTP/1.1 200
Server: server
Date: Mon, 16 Oct 2023 13:20:25 GMT
Content-Type: text/html;charset=utf-8
Connection: close
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: 145

type=async-response
&serial-number=00000000-0000-0000-0000-000002ee3a57
&merchant-order-id=34T43R77N
&paynet-order-id=7234671
&end-point-id=39915

Fail Response Example

HTTP/1.1 200
Server: server
Date: Mon, 16 Oct 2023 07:54:11 GMT
Content-Type: text/html;charset=utf-8
Connection: close
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: 162

type=validation-error
&serial-number=00000000-0000-0000-0000-000002ee3a4f
&merchant-order-id=34T43R77N
&error-message=Rebill+1461819+was+not+found
&error-code=104

Postman Collection

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

Request Builder

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

Debug form

Use either destination-card-no or destination-card-ref-id

URLinput URL
loginyour login should be used as Consumer Public for OAuth
client_orderidmake it  or use your internal invoice ID
destination-card-noenter the beginning of the sequence, and then “i”.
destination-card-ref-id
order_desc
amount
currency
ipaddress
first_name
middle_name
last_name
ssn
birthday
address1
city
state
zip_code
country
phone
cell_phone
email
purpose
receiver_first_name
receiver_middle_name
receiver_last_name
receiver_phone
receiver_resident
receiver_identity_document_series
receiver_identity_document_number
receiver_identity_document_id
receiver_address1
receiver_city
redirect_url
redirect_success_url
redirect_fail_url
server_callback_url
merchant_data
curl -H 'Authorization: OAuth oauth_consumer_key="paydroid", oauth_nonce="5m1CY1XX81TfNOquPC8rXEbd6nTjGEag", oauth_signature="i6IFKvDIfNpJyeD1ptqq6dxgpojTYvvbEbM20pf4a%2Fiv3VuIMfsAmKM5GL9ICRUjeI2egOdqDsg3xZDUURO94h9UnYwzX%2Ft15NqeLe%2BB56qKiEeE7pdaAtU1I5pDutG0EIQE6V6%2FDuRelBAgR6LhCyWOTjTH2UEmdfPzTPeB7TDLhR9wKYhwAeb7%2BRjCTfgF4kzlcfx9wNR3%2BRhAgIsNytaeR4dq7WtCz4dcT5Ohz4b3yENlD24CnmGV%2B5cIgB7q8mE9b%2Fw7AAuH71lDcqQy0eIKJ1V7uT54CFLxTsLw2058PGrlLBxxuLYC2XYTlObT0SIbQKxD2ShxMNMUPcMkbyH2yRUdPQJ3nnoJI%2BS1z2w%2FQanWMRpLyEu9WhjdLKKZmjMMm9KM9OIENTOoRpcsmOp5saHy%2F8FKeQ3C651THnj8WQcP24IloAMNmQcE6aTWa3j%2BF9Km%2B4qc8%2Fdas%2BHs4btrqXzPlVXZfEvnsGd5fx%2FqcRSs%2FMhodIx4tBBEvPnVrU0lZFBEncD9nagELKWk%2BVI8doOkb4B9eUl8UCZpD9HQu8XDhvvsvc3SiYP5yuvvRInVHCmA99ll%2FIk7N3W%2F74ffaachTqIZj5aVHcO4NLralPMYUGudss5oEVmcH4OUIyTZR3B0SmrYoh1LR5p0WhuOJeIKGYPBJ8LEsEhwnyM%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200916", oauth_version="1.0"' --data 'address1=100%20Main%20st&amount=10.42&birthday=19820115&cell_phone=%2B19023384543&city=Seattle&client_orderid=902B4FF5&country=US&currency=USD&destination-card-no=4326570256213621&email=john.smith%40gmail.com&first_name=John&ipaddress=65.153.12.232&last_name=Smith&merchant_data=VIP%20customer&middle_name=M&order_desc=Test%20Order%20Description&phone=%2B12063582043&purpose=user_account1&receiver_address1=Red%20Sq%2C%201a&receiver_city=Moscow&receiver_first_name=Jane&receiver_last_name=Doe&receiver_middle_name=L&receiver_phone=%2B79031110022&redirect_url=http%3A%2F%2Fwww.example.com%2F&server_callback_url=https%3A%2F%2Fhttpstat.us%2F200&ssn=1267&state=WA&zip_code=98102' 'https://sandbox.billblend.com/checkout/api/v4/transfer-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(
    'client_orderid' => '902B4FF5', 
    'order_desc' => 'Test Order Description', 
    'amount' => '10.42', 
    'currency' => 'USD', 
    'ipaddress' => '65.153.12.232', 
    'first_name' => 'John', 
    'middle_name' => 'M', 
    'last_name' => 'Smith', 
    'ssn' => '1267', 
    'birthday' => '19820115', 
    'address1' => '100 Main st', 
    'city' => 'Seattle', 
    'state' => 'WA', 
    'zip_code' => '98102', 
    'country' => 'US', 
    'phone' => '+12063582043', 
    'cell_phone' => '+19023384543', 
    'email' => 'john.smith@gmail.com', 
    'purpose' => 'user_account1', 
    'receiver_first_name' => 'Jane', 
    'receiver_middle_name' => 'L', 
    'receiver_last_name' => 'Doe', 
    'receiver_phone' => '+79031110022', 
    'receiver_address1' => 'Red Sq, 1a', 
    'receiver_city' => 'Moscow', 
    'redirect_url' => 'http://www.example.com/', 
    'server_callback_url' => 'https://httpstat.us/200', 
    'merchant_data' => 'VIP customer', 
    'destination-card-no' => '4326570256213621', 

);

$customHeaders = array(
    'Authorization' => 'OAuth oauth_consumer_key="paydroid", oauth_nonce="5m1CY1XX81TfNOquPC8rXEbd6nTjGEag", oauth_signature="i6IFKvDIfNpJyeD1ptqq6dxgpojTYvvbEbM20pf4a%2Fiv3VuIMfsAmKM5GL9ICRUjeI2egOdqDsg3xZDUURO94h9UnYwzX%2Ft15NqeLe%2BB56qKiEeE7pdaAtU1I5pDutG0EIQE6V6%2FDuRelBAgR6LhCyWOTjTH2UEmdfPzTPeB7TDLhR9wKYhwAeb7%2BRjCTfgF4kzlcfx9wNR3%2BRhAgIsNytaeR4dq7WtCz4dcT5Ohz4b3yENlD24CnmGV%2B5cIgB7q8mE9b%2Fw7AAuH71lDcqQy0eIKJ1V7uT54CFLxTsLw2058PGrlLBxxuLYC2XYTlObT0SIbQKxD2ShxMNMUPcMkbyH2yRUdPQJ3nnoJI%2BS1z2w%2FQanWMRpLyEu9WhjdLKKZmjMMm9KM9OIENTOoRpcsmOp5saHy%2F8FKeQ3C651THnj8WQcP24IloAMNmQcE6aTWa3j%2BF9Km%2B4qc8%2Fdas%2BHs4btrqXzPlVXZfEvnsGd5fx%2FqcRSs%2FMhodIx4tBBEvPnVrU0lZFBEncD9nagELKWk%2BVI8doOkb4B9eUl8UCZpD9HQu8XDhvvsvc3SiYP5yuvvRInVHCmA99ll%2FIk7N3W%2F74ffaachTqIZj5aVHcO4NLralPMYUGudss5oEVmcH4OUIyTZR3B0SmrYoh1LR5p0WhuOJeIKGYPBJ8LEsEhwnyM%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200916", oauth_version="1.0"'
);

$responseFields = sendRequest('https://sandbox.billblend.com/checkout/api/v4/transfer-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 = {
    'client_orderid' => '902B4FF5', 
    'order_desc' => 'Test Order Description', 
    'amount' => '10.42', 
    'currency' => 'USD', 
    'ipaddress' => '65.153.12.232', 
    'first_name' => 'John', 
    'middle_name' => 'M', 
    'last_name' => 'Smith', 
    'ssn' => '1267', 
    'birthday' => '19820115', 
    'address1' => '100 Main st', 
    'city' => 'Seattle', 
    'state' => 'WA', 
    'zip_code' => '98102', 
    'country' => 'US', 
    'phone' => '+12063582043', 
    'cell_phone' => '+19023384543', 
    'email' => 'john.smith@gmail.com', 
    'purpose' => 'user_account1', 
    'receiver_first_name' => 'Jane', 
    'receiver_middle_name' => 'L', 
    'receiver_last_name' => 'Doe', 
    'receiver_phone' => '+79031110022', 
    'receiver_address1' => 'Red Sq, 1a', 
    'receiver_city' => 'Moscow', 
    'redirect_url' => 'http://www.example.com/', 
    'server_callback_url' => 'https://httpstat.us/200', 
    'merchant_data' => 'VIP customer', 
    'destination-card-no' => '4326570256213621', 

}

custom_headers = {
    'Authorization' => 'OAuth oauth_consumer_key="paydroid", oauth_nonce="5m1CY1XX81TfNOquPC8rXEbd6nTjGEag", oauth_signature="i6IFKvDIfNpJyeD1ptqq6dxgpojTYvvbEbM20pf4a%2Fiv3VuIMfsAmKM5GL9ICRUjeI2egOdqDsg3xZDUURO94h9UnYwzX%2Ft15NqeLe%2BB56qKiEeE7pdaAtU1I5pDutG0EIQE6V6%2FDuRelBAgR6LhCyWOTjTH2UEmdfPzTPeB7TDLhR9wKYhwAeb7%2BRjCTfgF4kzlcfx9wNR3%2BRhAgIsNytaeR4dq7WtCz4dcT5Ohz4b3yENlD24CnmGV%2B5cIgB7q8mE9b%2Fw7AAuH71lDcqQy0eIKJ1V7uT54CFLxTsLw2058PGrlLBxxuLYC2XYTlObT0SIbQKxD2ShxMNMUPcMkbyH2yRUdPQJ3nnoJI%2BS1z2w%2FQanWMRpLyEu9WhjdLKKZmjMMm9KM9OIENTOoRpcsmOp5saHy%2F8FKeQ3C651THnj8WQcP24IloAMNmQcE6aTWa3j%2BF9Km%2B4qc8%2Fdas%2BHs4btrqXzPlVXZfEvnsGd5fx%2FqcRSs%2FMhodIx4tBBEvPnVrU0lZFBEncD9nagELKWk%2BVI8doOkb4B9eUl8UCZpD9HQu8XDhvvsvc3SiYP5yuvvRInVHCmA99ll%2FIk7N3W%2F74ffaachTqIZj5aVHcO4NLralPMYUGudss5oEVmcH4OUIyTZR3B0SmrYoh1LR5p0WhuOJeIKGYPBJ8LEsEhwnyM%3D", oauth_signature_method="RSA-SHA256", oauth_timestamp="1753200916", oauth_version="1.0"'
}

response_fields = send_request('https://sandbox.billblend.com/checkout/api/v4/transfer-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/transfer-by-ref/ENDPOINTID";
    //Request parameters
    private static String urlParameters = "address1=100%20Main%20st&amount=10.42&birthday=19820115&cell_phone=%2B19023384543&city=Seattle&client_orderid=902B4FF5&country=US&currency=USD&destination-card-no=4326570256213621&email=john.smith%40gmail.com&first_name=John&ipaddress=65.153.12.232&last_name=Smith&merchant_data=VIP%20customer&middle_name=M&order_desc=Test%20Order%20Description&phone=%2B12063582043&purpose=user_account1&receiver_address1=Red%20Sq%2C%201a&receiver_city=Moscow&receiver_first_name=Jane&receiver_last_name=Doe&receiver_middle_name=L&receiver_phone=%2B79031110022&redirect_url=http%3A%2F%2Fwww.example.com%2F&server_callback_url=https%3A%2F%2Fhttpstat.us%2F200&ssn=1267&state=WA&zip_code=98102";

    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=\"5m1CY1XX81TfNOquPC8rXEbd6nTjGEag\", oauth_signature=\"i6IFKvDIfNpJyeD1ptqq6dxgpojTYvvbEbM20pf4a%2Fiv3VuIMfsAmKM5GL9ICRUjeI2egOdqDsg3xZDUURO94h9UnYwzX%2Ft15NqeLe%2BB56qKiEeE7pdaAtU1I5pDutG0EIQE6V6%2FDuRelBAgR6LhCyWOTjTH2UEmdfPzTPeB7TDLhR9wKYhwAeb7%2BRjCTfgF4kzlcfx9wNR3%2BRhAgIsNytaeR4dq7WtCz4dcT5Ohz4b3yENlD24CnmGV%2B5cIgB7q8mE9b%2Fw7AAuH71lDcqQy0eIKJ1V7uT54CFLxTsLw2058PGrlLBxxuLYC2XYTlObT0SIbQKxD2ShxMNMUPcMkbyH2yRUdPQJ3nnoJI%2BS1z2w%2FQanWMRpLyEu9WhjdLKKZmjMMm9KM9OIENTOoRpcsmOp5saHy%2F8FKeQ3C651THnj8WQcP24IloAMNmQcE6aTWa3j%2BF9Km%2B4qc8%2Fdas%2BHs4btrqXzPlVXZfEvnsGd5fx%2FqcRSs%2FMhodIx4tBBEvPnVrU0lZFBEncD9nagELKWk%2BVI8doOkb4B9eUl8UCZpD9HQu8XDhvvsvc3SiYP5yuvvRInVHCmA99ll%2FIk7N3W%2F74ffaachTqIZj5aVHcO4NLralPMYUGudss5oEVmcH4OUIyTZR3B0SmrYoh1LR5p0WhuOJeIKGYPBJ8LEsEhwnyM%3D\", oauth_signature_method=\"RSA-SHA256\", oauth_timestamp=\"1753200916\", 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