Voucher

HTTP Endpint
POST http://SPOTIPOSERVERNAME/s/SPOTIPOSITEKEY/api/voucher/create/
Do replace SPOTPIPOSERVERNAME with your spotipo server IP/domain name and SPOTIPOSITEKEY with your siteke

POST Parameters

Parameter

Type

Description

duration_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

Required

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 -X POST --header "Content-Type:application/json" \
--header "Authentication-Token:6f182dde-5e7d-4678-abfd-65524e1e0248"\
\
--data '{
"duration_val": "10",
"duration_type": "2",
"batchid": "4134",
"notes": "Test Voucher",
"number": "2",
"bytes_t": "100",
"duration_type": "3",
"num_devices": "10",
"speed_dl": "7300",
"speed_ul": "21",
"price": "11",
"currency": "USD"
}' http://192.168.1.1/s/12/api/voucher/create/
Example response
{
  "data": {
    "vouchers": [
      "413442743",
      "413424056"
    ]
  },
  "msg": "Successfully added vouchers",
  "status": 1
}


How did we do?


Powered by HelpDocs