Award or allow tokens for a user
curl --request POST \
--url https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens \
--header 'Content-Type: application/json' \
--data '
{
"ApiKey": "<string>",
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProjectGuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IsAllowance": false,
"IsMintable": false,
"CustomerID": "<string>",
"Tokens": [
{
"Guid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Amount": 123,
"ContractGuid": "<string>"
}
],
"Wallet": "<string>"
}
'import requests
url = "https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens"
payload = {
"ApiKey": "<string>",
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProjectGuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IsAllowance": False,
"IsMintable": False,
"CustomerID": "<string>",
"Tokens": [
{
"Guid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Amount": 123,
"ContractGuid": "<string>"
}
],
"Wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ApiKey: '<string>',
RequestID: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ProjectGuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
IsAllowance: false,
IsMintable: false,
CustomerID: '<string>',
Tokens: [
{
Guid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Amount: 123,
ContractGuid: '<string>'
}
],
Wallet: '<string>'
})
};
fetch('https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens', 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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens",
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([
'ApiKey' => '<string>',
'RequestID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ProjectGuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'IsAllowance' => false,
'IsMintable' => false,
'CustomerID' => '<string>',
'Tokens' => [
[
'Guid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'Amount' => 123,
'ContractGuid' => '<string>'
]
],
'Wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens"
payload := strings.NewReader("{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens")
.header("Content-Type", "application/json")
.body("{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"isError": "0",
"Error": ""
}Player Endpoints
Award Tokens
POST
/
AwardTokens
Award or allow tokens for a user
curl --request POST \
--url https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens \
--header 'Content-Type: application/json' \
--data '
{
"ApiKey": "<string>",
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProjectGuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IsAllowance": false,
"IsMintable": false,
"CustomerID": "<string>",
"Tokens": [
{
"Guid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Amount": 123,
"ContractGuid": "<string>"
}
],
"Wallet": "<string>"
}
'import requests
url = "https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens"
payload = {
"ApiKey": "<string>",
"RequestID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ProjectGuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"IsAllowance": False,
"IsMintable": False,
"CustomerID": "<string>",
"Tokens": [
{
"Guid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"Amount": 123,
"ContractGuid": "<string>"
}
],
"Wallet": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ApiKey: '<string>',
RequestID: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ProjectGuid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
IsAllowance: false,
IsMintable: false,
CustomerID: '<string>',
Tokens: [
{
Guid: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
Amount: 123,
ContractGuid: '<string>'
}
],
Wallet: '<string>'
})
};
fetch('https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens', 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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens",
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([
'ApiKey' => '<string>',
'RequestID' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ProjectGuid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'IsAllowance' => false,
'IsMintable' => false,
'CustomerID' => '<string>',
'Tokens' => [
[
'Guid' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'Amount' => 123,
'ContractGuid' => '<string>'
]
],
'Wallet' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens"
payload := strings.NewReader("{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens")
.header("Content-Type", "application/json")
.body("{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://intern.payingame.io/rest/PayIngame/PublicAPI/AwardTokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ApiKey\": \"<string>\",\n \"RequestID\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ProjectGuid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"IsAllowance\": false,\n \"IsMintable\": false,\n \"CustomerID\": \"<string>\",\n \"Tokens\": [\n {\n \"Guid\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"Amount\": 123,\n \"ContractGuid\": \"<string>\"\n }\n ],\n \"Wallet\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"isError": "0",
"Error": ""
}This endpoint will let you distribute tokens towards a user. There are two options:
- When Allowance is set to true, then the tokens will be stored as an allowance. With the Allowance api, the user will be able to see how much they have of a certain token and they will be able to mint it themselves.
- When Allowance is set to false, then the tokens will be distributed right away. To use this feature, funds need to be put in into the wallet (see ‘Fund Wallet’). If there isn’t enough, it will be queued until the funds are there. The destination wallet will need to be filled in as well in the request.
Body
application/json