Skip to content

Payments: request parameters

João Raimundo edited this page Nov 21, 2018 · 23 revisions

Gitter chat

HTTP (web) Intent

The gateway URL:

https://apichain.blockchainds.com/transaction/inapp?value=XXX&currency=XXX&to=XXX&product=XXX&domain=XXX&data=XXX&callback_url=XXX

Request parameters

Parameter Type Description Static Optional Example
value Double The value in APPC (AppCoins by default) of the transaction. N Y 2.5
currency String The currency in which the value is sent, if no currency is sent it is considered APPC (AppCoins). N Y USD or EUR
to String The wallet address of the receiver of the transaction. Attention: if your domain is registered on bds, this argument is ignored. Y Y 0xda99070eb09ab
6ab7e49866c390b
01d3bca9d516
product String The id of the item being bought. Y Y sword.001
domain String The application id, also known as package name. Y Y com.mygamestudio.game
data String Additional information to be sent if needed. N Y 100 Gems
callback_url String The URL to be called after the transaction is completed. The URL is afterwards completed with additional parameters for purchase validation. N Y https://mygamestudio.com/
appcoins?out_trade_no=1234

Callback URL

The composition of the callback URL can contain as query string any parameter relevant to the transaction so that it can be handled on the developer's side. As an example, the following url beside the endpoint contains also a transaction id relevant to the developer.

https://www.mygamestudio.com/v1/appcoins_ipn.php?out_trade_no=2082389608326064

Parameters restriction

There are some ground rules that need to be taken in consideration regarding the parameter combination, when building the URL to call the wallet.

A transaction without product management requires at least the value for the transaction and the package name of the application as below:

https://apichain.blockchainds.com/transaction/inapp?value=1.50&domain=com.developers.mygame

Parameters possible combinations

value product domain callback_url
✔️ ✔️
✔️ ✔️ ✔️
✔️ ✔️
✔️ ✔️ ✔️

Note: The currency, to and data parameters are optional. In the case of the value set in the to parameter, if does not match the value defined as the wallet address for the given domain, the value is replaced with the later.