CoinText can be integrated into any mobile app which can leverage the SMS send and receive capabilities of the mobile handset. By including the keyword “api” before standard CoinText commands, the response will be returned as a JSON string. Users must utilize a CoinText access phone number within the country to which their phone number is registered and associated with the cryptocurrency they would like to use.

Instructions for integrating SMS capability into mobile apps:

Android: https://google-developer-training.gitbooks.io/android-developer-phone-sms-course/content/Lesson%202/2_p_sending_sms_messages.html

iOS: Currently, iOS does not support programmatic send and receive of SMS messages from within apps.

Regional access numbers are available at the following links:
Bitcoin Cash – https://cointext.io/en/regions/
Dash – https://dash.cointext.io/en/regions/
Litecoin – https://ltc.cointext.io/en/regions/


RECEIVE
Returns the address associated with the user’s phone number.

api receive

Response:

{
	"addr": "bitcoincash:qp6v9e966mhaplhawawxptgzlgtpfrdm5vtmvgru7a"
}

BALANCE
Returns the user’s balance, in Satoshis

api balance

Response:

{
	"balance":4550123
}

SEND
Initiates sending of funds. Returns the amount to be sent in satoshis, the total fees (miner and CoinText combined) in satoshis, and the 2FA code that needs to be sent in response to complete the transfer.

api send $amount {phone number/address}
api send amount {bch/ltc/dash} {phone number/address}

Examples:
api send $1.50 19175551212
api send $1.50 qp6v9e966mhaplhawawxptgzlgtpfrdm5vtmvgru7a
api send .00009136 bch 19175551212
api send .00009136 bch qp6v9e966mhaplhawawxptgzlgtpfrdm5vtmvgru7a

Response:

{
	"amount":9136,
	"fee":3212,
	"2fa":"173332"
}

2FA
Confirms a SEND transaction. Returns the txid of the transaction and the new balance of the user’s address in satoshis

api 2FA

Example:
api 173332

Response:

{
	"txid":"41a07a5e417e628e395994a5ae40bb6d736aa7b9ef878f948648177f22160477"
	"balance":4537775
}

SELL
Creates an invoice that a buyer can pay by using the buy command with the “payment_id” property supplied in the response. If SELL command is called via API, the notification that the invoice has been paid will be sent in API format as well.

api sell $amount
api sell amount {bch/ltc/dash}

Example:
api sell $1.50
api sell .00009136 bch

Response:

{
	"amount":9136,
	"payment_id":"BN3N"
}

 
Payment Notification:

{
	"payment_id":"BN3N",
	"status":paid,
	"amount":9136,
	"balance":4537775
}

BUY
Initiates payment of existing invoice. Returns the amount to be sent in satoshis, the total fees (miner and CoinText combined) in satoshis, and the 2FA code that needs to be sent in response to complete the transfer. Response is identical to the SEND command.

api buy payment_id

Examples:
api buy bn3n

Response:

{
	"amount":9136,
	"fee":3212,
	"2fa":"173332"
}