Appearance
Become a reseller: create and send a client
In this tutorial you set up the reseller side of Bitstream. First, as the admin, you make a reseller account and give it some credits. Then, as the reseller, you create a client, send the access on WhatsApp and renew it.
You need the server from Install your first server and the Test bouquet and 1 month, 1 screen package from the previous tutorial.
How resellers work
- A package is what a reseller sells: how long a line lasts, how many devices may watch at once, and which bouquets (channel packs) it includes. A reseller group only sees the packages that list it under Who can sell it.
- Each package has a price in credits. The admin gives credits to resellers. Creating or renewing a line takes credits from the reseller's balance.
- A line is one client account. The client types its username and password into an IPTV app.
- A reseller only ever sees their own lines and their own sub-resellers.
1. Create the reseller
As the admin, open Resellers and click New reseller. Fill in a username, for example juliana, and a password of at least 10 characters. Keep Group on Resellers. Click Create user.
The dialog then shows the saved login and password. Use Copy all and send them to Juliana in a private message.
2. Give credits
Open Credits, search for juliana, and add 10 credits with Add. Every move shows up in the list below, with who made it.
3. Sign in as the reseller
Open the panel in a private browser window and sign in as juliana. The reseller panel is made for a phone: Home, Clients, a big + for New client, Expiring and More. The home shows the credit balance.
4. Create a client
Tap New client.
- Keep Paid and pick the
1 month, 1 screenplan. The form shows what it costs and the balance after. - Type the Client name, for example
Carlos. - Type the client's WhatsApp number, for example
21 99876-5432. Without a country code, Bitstream adds the panel's code. That is 55 (Brazil) unless the admin changed Country code for client phones in Settings, General. - Leave the username and password as they are. Bitstream makes them up.
- Tap Create for 1 credit.
The line expires one month from now, and Juliana has 9 credits left.
5. Send the access
The access dialog opens right away. It has two tabs:
| Tab | What it is for |
|---|---|
| Xtream login | Server, username and password, for apps with an "Xtream codes" login, like TiviMate or IPTV Smarters. |
| Playlist link | An M3U Plus or plain M3U link, for apps that take a playlist URL, plus the EPG URL for the TV guide. |
Below is the WhatsApp message. The dialog shows the number it goes to, for example "Sends to +55 21 99876-5432.". Tap Send on WhatsApp to open the chat with the text ready, or Copy message.
The message starts with the client name ("Hi Carlos!"). To change the text, use Edit message. Your own version is saved on My account, and you can use {name}, {server}, {username}, {password}, {expires} and {m3u} in it. The admin sets the default for everyone in Settings, General, WhatsApp message for new lines.
The server address comes from the panel settings (general.client_url, or the panel address you set in the wizard).
6. Renew when the month ends
Open Expiring, or the client in Clients, and tap Renew. Pick how many months. The dialog shows the cost and the balance after. Options you cannot pay for are greyed out, with how many credits are short.
With 0 credits, Home, New client and Renew show a banner with Ask for credits, which opens a support ticket to the admin.
Automate it
The panel uses the admin API, so a reseller can script all of this. You need curl and jq. Sign in as the reseller:
bash
PANEL=http://203.0.113.10:8080/api/v1
RTOKEN=$(curl -s -X POST $PANEL/auth/login \
-H 'Content-Type: application/json' \
-d '{"username":"juliana","password":"a long password here"}' | jq -r .access_token)Create a line. A reseller must pass a package_id (get it from GET /packages):
bash
curl -s -X POST $PANEL/lines \
-H "Authorization: Bearer $RTOKEN" -H 'Content-Type: application/json' \
-d '{"package_id": 1, "client_name": "Carlos", "client_phone": "21 99876-5432"}' \
| jq '{id, username, password, exp_date}'Get the links and a ready message for the client, then renew:
bash
curl -s $PANEL/lines/1/playlist-links -H "Authorization: Bearer $RTOKEN" | jq
curl -s -X POST $PANEL/lines/1/renew \
-H "Authorization: Bearer $RTOKEN" -H 'Content-Type: application/json' \
-d '{"periods": 1}' | jq '{id, exp_date}'Without enough credits, the API answers 402 with the code insufficient_credits.
API keys for resellers
Reseller groups cannot create API keys by default. The admin turns it on per group in Groups & permissions, under API keys. While it is off, existing reseller keys answer 403 api_keys_not_allowed. See API keys and request signing.
What you learned
- Packages set duration, screens, bouquets and price. Resellers sell packages, not raw settings.
- Credits move from the admin to resellers, and from resellers to their sub-resellers.
- The access dialog has everything the client needs, ready to send on WhatsApp.
Next
- Read how a viewer connects to see what happens when Carlos presses play.
- Script your shop with API keys.