Pular para o conteúdo principal
GET
/
balance
/
{legal_entity_id}
cURL
curl --request GET \
  --url https://public-api.kiwify.com/v1/balance/{legal_entity_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'x-kiwify-account-id: <api-key>'
import requests

url = "https://public-api.kiwify.com/v1/balance/{legal_entity_id}"

headers = {
"x-kiwify-account-id": "<api-key>",
"Authorization": "Bearer <token>"
}

response = requests.get(url, headers=headers)

print(response.text)
const options = {
method: 'GET',
headers: {'x-kiwify-account-id': '<api-key>', Authorization: 'Bearer <token>'}
};

fetch('https://public-api.kiwify.com/v1/balance/{legal_entity_id}', 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://public-api.kiwify.com/v1/balance/{legal_entity_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"x-kiwify-account-id: <api-key>"
],
]);

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

curl_close($curl);

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

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

func main() {

url := "https://public-api.kiwify.com/v1/balance/{legal_entity_id}"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("x-kiwify-account-id", "<api-key>")
req.Header.Add("Authorization", "Bearer <token>")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://public-api.kiwify.com/v1/balance/{legal_entity_id}")
.header("x-kiwify-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://public-api.kiwify.com/v1/balance/{legal_entity_id}")

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

request = Net::HTTP::Get.new(url)
request["x-kiwify-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "available": 236961,
  "pending": 4621,
  "legal_entity_id": "8dcb67d3-9217-4a0e-8f7c-916cf58f415c"
}
{
"error": "auth_error",
"message": "Invalid token: access token is invalid"
}

Autorizações

x-kiwify-account-id
string
header
obrigatório
Authorization
string
header
obrigatório

The access token received from the authorization server in the OAuth 2.0 flow.

Parâmetros de caminho

Resposta

Balance data

available
number
Exemplo:

236961

pending
number
Exemplo:

4621

Exemplo:

"7ff9e8be-3249-47d3-ac05-aeae816975fc"