eCash Merchant API

eCash.com provides a transaction API to accept payments using standard calls from BitCoin and Ripple Systems.

In computer programming, an application programming interface (API) specifies how some software components should interact with each other

eCash Gateway

You may send transaction requests to either of the following URLs:

  • Customers are redirected to the Hosted Payment Page URL.
    https://ecash.com/api/request/redirect
  • Returns an XML message containing a Hosted Payment Page URL which can also be sent to customers via email.
    https://ecash.com/api/request

Required fields

The following fields are required to initiate a transaction.

Name Description Maxlength Example
ecash_id The Transaction ID identifies your transaction, such as your shopping cart. n/a 100000084
price Order total including all taxes, shipping, fees and discounts. Flat prices must be multiplied by 10000 (4 zeros) and rounded to full integers. For example 12.99 USD becomes 1299000. If directly sending order prices in Bitcoin, multiple the amount by 100000000 (8 zeroes) and round to full integers. For example 1.4 BTC becomes 140000000. 64 1279000
currency The order currency. Send all flat currency in the alpha-3 uppercase ISO 4217 format. 3 USD
EU
YEN
payment_method The desired payment method. 10 bitcoin
ripple
ecash
etc
signature The transaction signature. n/a See below

Example request: HTML

Example redirects users to the hosted payment page via a HTML based form.

<form name="ecash" id="ecashForm" action="https://ecash.com/api/request" method="post"accept-charset="UTF-8">
  <input type="hidden" name="ecash_id" value="e15142wefwe" />
 
 <input type="hidden" name="transaction_id" value="1018" />
  <input type="hidden" name="price" value="99.95" />
  <input type="hidden" name="currency" value="USD" />
  <input type="hidden" name="payment_method" value="ecash" />
  <input type="hidden" name="signature" value="DVRWVF545155efefc" />
  <input type="hidden" name="notificationURL" value="YourDomain.com/notify.php" />

</form>

Example request

Example redirects users to a payment page. (JSON)


{
   "command" : "submit",   // For JSON-RPC this can be specified as the method.
   "tx_json" : {
      "TransactionType" : "Payment",
      "Account" : "dfDefeefrerHHHIhihs",
      "Destination" : "15eee31551DfEsaf551ds5",
      "Amount" : "400000000"
   },
   "secret" : "ndljnldjsnvljnlnljnljnljnljnljnjl"
}

Example request

Below example uses request to the hosted payment page URL

<a class="ecash-button" ecash_id="e55489" 
href="https://ecash.com/checkout/554264ssfdf00b64b61d372earfvfrrad">Pay With eCash </a>
<script src="https://ecash.com/assets/button.js" type="text/javascript"></script>

Optional fields

Meta information

Optional information.

Name Description Maxlength Example
test Test mode for sandbox. Allowed values: 0, 1 1 100000021
language The lowercase alpha-2 ISO 639-1 code. Hosted payment page will display in this desired language. 2 en
order_id Order ID used by the merchant for his administration. 255 15580022
description Transaction description. 255 Your Company Order #15580022

Customer fields

A number of fields to desribe the customer.

Name Description Maxlength Example
customer_name customer name. 255 John Doe
customer_email customer email address. 255 john.doe@example.com
customer_account customer account number 255 3105551212

Redirect and response URL fields

Redirect URLs return the user to the merchant website.

Name Description Maxlength Example
accept_url URL where customers are redirected after successfully transaction. 2047 https://yourdomain.com/accept.php
decline_url URL where customers are redirected after a failed, canceled or declined transaction. 2047 https://yourdomain.com/decline.php
response_url The URL where transaction notifications are sent to the merchant backoffice. 2047 https://yourdomain.com/response.php
notificationEmail Email for notification 255 name@sample.com

Line item fields

You can transfer information about all products / line items.

Name Description Maxlength Example
item_id_x Where x = 1, 2, 3, A, B, C etc. The line item ID, SKU, etc. Special values can also be used: color, size, options. n/a AP51515
item_name_x Where x = 1, 2, 3, etc. The line item name. n/a Item name
item_description Description of item 255 shoes
item_qty_x Where x = 1, 2, 3, etc. The product quantity. Must be numeric. n/a 1
item_price_x Where x = 1, 2, 3, etc. The product unit price. flat prices must be multiplied by 10000 (4 zeros) and rounded to full integers. For example 19.99 USD becomes 1999000. If directly sending order prices in Bitcoin, multiple the amount by 100000000 (8 zeroes) and round to full integers. For example 1.2 BTC becomes 120000000. n/a 1299000

Billing address fields

Billing address information

Name Description Maxlength Example
billing_same Billing address same as shipping 255 0 / 1
billing_firstname First name n/a John
billing_lastname Last name n/a Doe
billing_company Company name n/a My Company
billing_address1 Street address first line n/a Main St
billing_address2 Street address second line n/a Suite 808
billing_postcode Postal code or zipcode n/a 96815
billing_city City n/a Honolulu
billing_region Region, state or province n/a Hawaii
billing_country Country n/a United States
billing_fax Fax number n/a +180855555
billing_phone Phone number n/a +180855555

Shipping address fields

 Customer shipping information.

Name Description Maxlength Example
shipping_use_billing Use billing address 1 or 0 1 0
shipping_firstname First name n/a John
shipping_lastname Last name n/a Doe
shipping_company Company name n/a My Company
shipping_street1 Street address first line n/a Main St
shipping_street2 Street address second line n/a Suite 808
shipping_postcode Postal code or zipcode n/a 90210
shipping_city City n/a Los Angeles
shipping_region Region, state or province n/a California
shipping_country Country n/a United States
shipping_fax Fax number n/a +180055555
shipping_phone Phone number n/a +180055555

Signature field

Transactions are signed with a signature SHA256 hash.

Name Description Maxlength Example
signature signature hash field to validate the transaction. n/a
ehk1EWPnQmXcltsO9qCuii/xd1+3B92Ul58RP1utxHk

API - Aplication Programing Interace

Transactions are signed with a signature SHA256 hash.

Name Example
BitCoin
http://bitcoin.org/en/developer-reference
Ripple http://ripple.com/wiki/API_Overview
API http://en.wikipedia.org/wiki/Application_programming_interface