Generate Access Token
curl --request POST \
--url https://api.fyatu.com/api/v3/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"appId": "A1B2C3D4E5F6G7H8",
"secretKey": "your_secret_key_here",
"grantType": "client_credentials"
}
'import requests
url = "https://api.fyatu.com/api/v3/auth/token"
payload = {
"appId": "A1B2C3D4E5F6G7H8",
"secretKey": "your_secret_key_here",
"grantType": "client_credentials"
}
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({
appId: 'A1B2C3D4E5F6G7H8',
secretKey: 'your_secret_key_here',
grantType: 'client_credentials'
})
};
fetch('https://api.fyatu.com/api/v3/auth/token', 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.fyatu.com/api/v3/auth/token",
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([
'appId' => 'A1B2C3D4E5F6G7H8',
'secretKey' => 'your_secret_key_here',
'grantType' => 'client_credentials'
]),
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://api.fyatu.com/api/v3/auth/token"
payload := strings.NewReader("{\n \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\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://api.fyatu.com/api/v3/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fyatu.com/api/v3/auth/token")
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 \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": 200,
"message": "Token generated successfully",
"data": {
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBMUIyQzNENEU1RjZHN0g4IiwiYnVzIjoiTjFTMFczUThQMFYxRTVNNlE0UjNEOFo5IiwidHlwZSI6ImNvbGxlY3Rpb24iLCJzY29wZXMiOlsiY29sbGVjdDp3cml0ZSIsImNvbGxlY3Q6cmVhZCIsInBheW91dDp3cml0ZSIsInBheW91dDpyZWFkIl0sImlhdCI6MTczNjA3NTgwMCwiZXhwIjoxNzM2MTYyMjAwLCJqdGkiOiJqd3RfOWYzZTJhMWI0YzVkNjdlOCJ9.xK2pM7nV3wL8qR5tY0sF4gH9jB6eA1cD3uW2iZ8vX0mN",
"tokenType": "Bearer",
"expiresIn": 86400,
"expiresAt": "2026-01-06T10:30:00+00:00",
"appType": "collection",
"scopes": [
"collect:write",
"collect:read",
"payout:write",
"payout:read"
]
},
"meta": {
"requestId": "req_9f3e2a1b4c5d67e8",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 400,
"message": "Validation failed",
"error": {
"code": "VALIDATION_ERROR",
"details": [
{
"field": "appId",
"message": "AppId is required"
}
]
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 401,
"message": "Invalid credentials. Secret key mismatch.",
"error": {
"code": "AUTH_INVALID_CREDENTIALS"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}Generate Token
Generate a JWT access token for Fyatu API v3.20. POST /auth/token with your businessId, secretKey, and requested scopes.
POST
/
auth
/
token
Generate Access Token
curl --request POST \
--url https://api.fyatu.com/api/v3/auth/token \
--header 'Content-Type: application/json' \
--data '
{
"appId": "A1B2C3D4E5F6G7H8",
"secretKey": "your_secret_key_here",
"grantType": "client_credentials"
}
'import requests
url = "https://api.fyatu.com/api/v3/auth/token"
payload = {
"appId": "A1B2C3D4E5F6G7H8",
"secretKey": "your_secret_key_here",
"grantType": "client_credentials"
}
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({
appId: 'A1B2C3D4E5F6G7H8',
secretKey: 'your_secret_key_here',
grantType: 'client_credentials'
})
};
fetch('https://api.fyatu.com/api/v3/auth/token', 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.fyatu.com/api/v3/auth/token",
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([
'appId' => 'A1B2C3D4E5F6G7H8',
'secretKey' => 'your_secret_key_here',
'grantType' => 'client_credentials'
]),
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://api.fyatu.com/api/v3/auth/token"
payload := strings.NewReader("{\n \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\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://api.fyatu.com/api/v3/auth/token")
.header("Content-Type", "application/json")
.body("{\n \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.fyatu.com/api/v3/auth/token")
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 \"appId\": \"A1B2C3D4E5F6G7H8\",\n \"secretKey\": \"your_secret_key_here\",\n \"grantType\": \"client_credentials\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"status": 200,
"message": "Token generated successfully",
"data": {
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJBMUIyQzNENEU1RjZHN0g4IiwiYnVzIjoiTjFTMFczUThQMFYxRTVNNlE0UjNEOFo5IiwidHlwZSI6ImNvbGxlY3Rpb24iLCJzY29wZXMiOlsiY29sbGVjdDp3cml0ZSIsImNvbGxlY3Q6cmVhZCIsInBheW91dDp3cml0ZSIsInBheW91dDpyZWFkIl0sImlhdCI6MTczNjA3NTgwMCwiZXhwIjoxNzM2MTYyMjAwLCJqdGkiOiJqd3RfOWYzZTJhMWI0YzVkNjdlOCJ9.xK2pM7nV3wL8qR5tY0sF4gH9jB6eA1cD3uW2iZ8vX0mN",
"tokenType": "Bearer",
"expiresIn": 86400,
"expiresAt": "2026-01-06T10:30:00+00:00",
"appType": "collection",
"scopes": [
"collect:write",
"collect:read",
"payout:write",
"payout:read"
]
},
"meta": {
"requestId": "req_9f3e2a1b4c5d67e8",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 400,
"message": "Validation failed",
"error": {
"code": "VALIDATION_ERROR",
"details": [
{
"field": "appId",
"message": "AppId is required"
}
]
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}{
"success": false,
"status": 401,
"message": "Invalid credentials. Secret key mismatch.",
"error": {
"code": "AUTH_INVALID_CREDENTIALS"
},
"meta": {
"requestId": "req_abc123def456",
"timestamp": "2026-01-05T10:30:00+00:00"
}
}Getting Your Credentials: Login to FYATU Dashboard → Business Dashboard → Developer → API Credentials
Overview
Exchange your API credentials (businessId and secretKey) for a JWT access token. This token authenticates all V3.20 API requests. Specify only the scopes your integration needs.
Token Details
| Property | Value |
|---|---|
| Algorithm | JWT HS256 |
| Expiry | 24 hours (86400 seconds) |
| Refresh window | Up to 5 minutes after expiry |
Available Scopes
| Scope | Description |
|---|---|
cards:read | View cards and card transactions |
cards:write | Create, fund, freeze, replace, delete cards |
cardholders:read | View cardholder profiles |
cardholders:write | Create, update, delete cardholders; initiate KYC |
programs:read | View card programs and products |
account:read | View wallet, transactions, pricing, statement |
webhooks:read | View webhook configuration and event types |
webhooks:write | Update webhook URL, regenerate secret, send test |
Using the Token
Include the token in theAuthorization header for all protected requests:
curl -X GET https://api.fyatu.com/api/v3.20/cardholders \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
Error Codes
| Code | Description |
|---|---|
VALIDATION_ERROR | Missing or invalid request parameters |
AUTH_INVALID_CREDENTIALS | Business not found or secret key mismatch |
AUTH_BUSINESS_INACTIVE | Business account is suspended or inactive |
Request only the scopes your integration needs. A read-only reporting tool should only request
*:read scopes — this limits the impact if the token is ever compromised.Body
application/json
Your app ID (16 characters)
Minimum string length:
8Example:
"DD123FR45446CECES"
Your app secret key
Minimum string length:
16Example:
"your_secret_key_here"
OAuth grant type (must be 'client_credentials')
Available options:
client_credentials Example:
"client_credentials"

