Voucher

HTTP Endpint
POST http://spotiposervername.com/s/SPOTIPOSITEKEY/api/voucher/create/

Do replace
with your spotipo server IP/domain name and SPOTIPOSITEKEY with your sitekey

POST Parameters

ParameterTypeDescriptionduration_val Required Specifies how long the voucher should be valid. duration_type Required Specifies unit of value given for duration_val. Possible values are “1” (for Minutes), “2” (for Hours) and “3” (for Days) num_devices Required Maximum number of devices allowed. batchid Require Specifies a batch number for vouchers. number Required Number of vouchers to be created. notes Optional Provide notes if any. bytes_t Optional Total data in Mb to be allowed with each voucher. speed_dl Optional Maximum download speed to be allowed. speed_ul Optional Maximum upload speed to be allowed. price Optional Voucher price. currency Optional Specifies unit for value given for price. Possible values are “USD”, “EUR”, “GBP”, “BRL” and “DKK”. 

Example Request:

Create 2 Vouchers

Spotipo server is hosted on 192.168.1.1

curl --header "Content-Type:application/json" \
--header "Authentication-Token:f163f31f-7dac-4a99-b430-68c4c0ec896e"\
-X POST \
--data '{  
    "duration_val": "10",
"duration_type": "2",
    "batchid": "4134",
    "notes": "Test Voucher",
    "number": "2",
    "bytes_t": "100",
    "duration_type": "4",
    "num_devices": "10",
    "speed_dl": "7300",
    "speed_ul": "21",
    "price": "11",
    "currency": "USD"
}' http://192.168.1.1/s/1/api/voucher/create/
Example response
{
  "data": {
    "vouchers": [
      "413442743",
      "413424056"
    ]
  },
  "msg": "Successfully added vouchers",
  "status": 1
}


How did we do?