Skip to main content
POST
/
purchases
/
create
Create Purchase
curl --request POST \
  --url https://api.streamskill.pro/v1/purchases/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "tarif": {
    "id": 1,
    "quantity": 1000,
    "duration": 24
  },
  "channel": "twitch",
  "interval": 10,
  "lang": "en",
  "comment": "Test comment",
  "start": false
}
'
import requests

url = "https://api.streamskill.pro/v1/purchases/create"

payload = {
"tarif": {
"id": 1,
"quantity": 1000,
"duration": 24
},
"channel": "twitch",
"interval": 10,
"lang": "en",
"comment": "Test comment",
"start": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
tarif: {id: 1, quantity: 1000, duration: 24},
channel: 'twitch',
interval: 10,
lang: 'en',
comment: 'Test comment',
start: false
})
};

fetch('https://api.streamskill.pro/v1/purchases/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.streamskill.pro/v1/purchases/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tarif' => [
'id' => 1,
'quantity' => 1000,
'duration' => 24
],
'channel' => 'twitch',
'interval' => 10,
'lang' => 'en',
'comment' => 'Test comment',
'start' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.streamskill.pro/v1/purchases/create"

payload := strings.NewReader("{\n \"tarif\": {\n \"id\": 1,\n \"quantity\": 1000,\n \"duration\": 24\n },\n \"channel\": \"twitch\",\n \"interval\": 10,\n \"lang\": \"en\",\n \"comment\": \"Test comment\",\n \"start\": false\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.streamskill.pro/v1/purchases/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"tarif\": {\n \"id\": 1,\n \"quantity\": 1000,\n \"duration\": 24\n },\n \"channel\": \"twitch\",\n \"interval\": 10,\n \"lang\": \"en\",\n \"comment\": \"Test comment\",\n \"start\": false\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.streamskill.pro/v1/purchases/create")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"tarif\": {\n \"id\": 1,\n \"quantity\": 1000,\n \"duration\": 24\n },\n \"channel\": \"twitch\",\n \"interval\": 10,\n \"lang\": \"en\",\n \"comment\": \"Test comment\",\n \"start\": false\n}"

response = http.request(request)
puts response.read_body
{
  "id": 1,
  "price": 10,
  "currency": "usd",
  "created_at": 1640000000,
  "order_type": "twitch_viewers",
  "channel": "https://www.twitch.tv/twitch",
  "status": "active",
  "service": "twitch",
  "parent": false,
  "api": true,
  "chatbot": false,
  "tarif": 1
}
{
"name": "Unauthorized",
"message": "Your request was made with invalid credentials.",
"code": 0,
"status": 401,
"type": "unauthorized_http_exception"
}
{
"name": "Bad Request",
"errors": {
"tarif.id": [
"Tarif not found"
]
},
"code": 0,
"status": 422,
"type": "validate_exception"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Accept-Language
enum<string>
default:en

The language of the response

Available options:
en,
ru

Query Parameters

expand
enum<string>

The expand of the purchase (you can use multiple values separated by commas)

Available options:
tarif,
parent,
api,
chatbot
Example:

"tarif,parent"

Body

application/json
tarif
object
required
channel
string
required

The channel (or another slug for tarif, for example - video id, clip id, etc.)

Example:

"twitch"

interval
integer

The interval of the purchase (if tarif supports custom interval)

Required range: 1 <= x <= 86400
Example:

10

lang
enum<string>
default:auto

Stream language for AI Chatbots. Only applicable for AI Chatbots tariffs. See the list of supported languages below.

Available options:
auto,
en,
ru,
uk,
de,
es,
fr,
it,
pt,
pl,
tr,
ar,
zh,
ja,
ko,
hi,
th,
vi,
id,
ms,
tl,
ca,
da,
nl,
no,
ro,
sk,
fi,
sv,
cs,
el,
bg,
hu,
zh-hk,
other
Example:

"en"

comment
string
default:""

The comment for the purchase

Example:

"Test comment"

start
boolean
default:false

Start the purchase after creation (Use only if tariff supports start)

Example:

false

Response

OK

id
integer

The ID of the purchase

Required range: x >= 1
Example:

1

price
number

The price of the purchase

Example:

10

currency
enum<string>
Available options:
usd,
rub
Example:

"usd"

created_at
integer<int64>

The timestamp of the purchase creation

Example:

1640000000

order_type
string

The type of the order

Example:

"twitch_viewers"

channel
string

The channel (or another slug for tarif, for example - video id, clip id, etc.)

Example:

"https://www.twitch.tv/twitch"

status
enum<string>

The status of the purchase

Available options:
created,
awaiting,
working,
stopped,
completed,
failed,
deleted,
refunded
Example:

"active"

service
enum<string>

The service of the purchase

Available options:
twitch,
trovo,
kick,
youtube
Example:

"twitch"

parent
boolean
default:false

The parent of the purchase

api
boolean

The API of the purchase

Example:

true

chatbot
boolean
default:false

The chatbot of the purchase

tarif
integer

The ID of the tarif

Required range: x >= 1
Example:

1