/
4.2.1 OnlineShop - Store API

4.2.1 OnlineShop - Store API

1. General information

This API allows to perform operations regarding transactions especially for d ialers.

2. Making requests

To perform OnlineShop transaction from outside of the standard flash client, you have to make an HTTP POST request to following web address:  https://domain/OnlineShop/store.ashx.

In the HTTP POST you have to pass parameters required for specified action type in JSON format, also be sure that you set ContentType as 'application/x-www-form-urlencoded'

3. Security

API is secured using HTTP Secure protocol so data sent and received is encrypted and safe. Credentials passed using basic authentication are also protected by HTTPS (In order to authenticate a request please add 'Authorization' header with 'Basic SIP_LOGIN:SIP_PASSWORD')

/OnlineShop/store.aspx - part of the URL is encrypted in the same way so no one will even know that this request is going to the API and may contain important informations.

4. Requests

4a. Parameters

Every request in this API needs parameters like below:

ParameterDescription
sm

Method name - this parameter is mandatory it points out which operation you want to perform:

  • amounts - retrieve amounts
  • start - start IOS transaction
  • finalize - finish IOS transaction
  • referral - set referral and award bonus
pmParameters - JSON object with all reqired parameters for particular operation.

4b. Methods

This section contains all methods available in the API store.ashx:

Amounts

Request
sm=amounts
OR
sm=amounts&pm={"provider":"PayPal", "create":"false", "clientType": 32} 

Note that 'pm' parameter is NOT mandatory.
Response
[
	{
		"a" : 5.0,
		"d" : "Top up 1",
		"ld": "Top up ONE"
	},
	{
		"a" : 10.0,
		"d" : "Top up 2",
        "ld": "Top up TWO"
    }
]

Start

Request
sm=start&pm={"pr":"com.DIALER_PREFIX.recharge.AMOUNT"}
OR
sm=start&pm={"pr":"com.DIALER_PREFIX.subscriptionplan.PLAN_ID"}
OR
sm=start&pm={"pr":"com.DIALER_PREFIX.intldid.DID_COUNTRY_ID"}
Response
{"status":0,"message":"OK","id":"OZWC5729OZ"}

ERROR CODES:
400 - Invalid DeviceOS
433 - Product is EMPTY
500 - Internal server error - please see OnlineShop logs for more details

Finalize

Request
sm=finalize&pm={"rcpt":"DIALER_RECEIPT","sa":"{\"type\":\"VerifyOnly\"}"}

Possible 'sa' values:
1. {\"type\":\"BuyDID\", \"params\": {\"id\": \"COUNTRY_ID\", \"cc\": \"COUNTRY_CODE\", \"an\": \"AREA_NAME\", \"ac\": \"AREA_CODE\", \"la\": \"LOCAL_AREA_ID\", \"vg\": \"VOXBONE_GROUP_ID\" }}
2. {\"type\":\"VerifyOnly\"}
Note that 'sa' parameter is NOT mandatory.
Response
{"status":0, "message":"OK", transactionId: TRANSACTION_ID }
OR
{"status":434, "message":"Receipt has been already USED.", "transactionId": TRANSACTION_ID }

ERROR CODES:
400 - Invalid parameter
431 - Apple request failed
432 - Fraud attempt
433 - Invalid ProductId
500 - Internal server error - please see OnlineShop logs for more details

Referral

Request
sm=referral&pm={referralUserName:'',refereeUdid:'',refereePhoneNumber:'',refereeCountryCode:''}
Response
HTTP 200 or HTTP 500

Related content