Integrate powerful gaming commerce features into your game with just a few lines of code. Our RESTful API supports all major platforms and game engines.
API Uptime
Response Time
Support
Sign up for a GameFlow account and get your API keys from the dashboard.
// Your API credentials
const API_KEY = "gf_live_abc123...";
const PROJECT_ID = "proj_xyz789...";
Choose your platform and install the GameFlow SDK.
// Unity Package Manager
// Add package from git URL:
// https://github.com/gameflow/unity-sdk.git
Initialize the SDK and make your first API call.
// Initialize GameFlow
GameFlow.Initialize(API_KEY, PROJECT_ID);
// Test connection
GameFlow.TestConnection()
.then(() => console.log("Connected!"))
.catch(err => console.error(err));
Process payments, handle subscriptions, and manage virtual currency.
Create a new purchase transaction for virtual items or currency.
// Create a purchase
const purchase = await GameFlow.Purchase.create({
items: [
{
id: "premium_sword",
quantity: 1,
price: 9.99,
currency: "USD"
}
],
playerId: "player_123",
metadata: {
source: "in_game_store"
}
});
console.log("Purchase ID:", purchase.id);
// Create a purchase (Unity C#)
var purchase = new PurchaseRequest
{
Items = new List<PurchaseItem>
{
new PurchaseItem
{
Id = "premium_sword",
Quantity = 1,
Price = 9.99m,
Currency = "USD"
}
},
PlayerId = "player_123"
};
var result = await GameFlow.Purchase.CreateAsync(purchase);
curl -X POST https://api.gameflow.com/v1/payments/purchase \
-H "Authorization: Bearer gf_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"id": "premium_sword",
"quantity": 1,
"price": 9.99,
"currency": "USD"
}
],
"playerId": "player_123"
}'
items |
array | Required | Array of items to purchase |
playerId |
string | Required | Unique player identifier |
paymentMethod |
string | Optional | Preferred payment method |
{
"id": "pur_abc123",
"status": "completed",
"amount": 9.99,
"currency": "USD",
"items": [
{
"id": "premium_sword",
"name": "Legendary Sword",
"quantity": 1
}
],
"createdAt": "2025-06-13T10:30:00Z"
}
Retrieve the current virtual currency balance for a player.
// Get player balance
const balance = await GameFlow.Player.getBalance("player_123");
console.log("Coins:", balance.coins);
console.log("Gems:", balance.gems);
Manage your in-game store, items, and inventory.
Retrieve all available items in your game store.
// Get store items
const items = await GameFlow.Store.getItems({
category: "weapons",
limit: 20,
offset: 0
});
items.forEach(item => {
console.log(item.name, item.price);
});
{
"items": [
{
"id": "premium_sword",
"name": "Legendary Sword",
"description": "A powerful weapon for heroes",
"price": 9.99,
"currency": "USD",
"category": "weapons",
"rarity": "legendary",
"image": "https://cdn.gameflow.com/items/sword.png"
}
],
"total": 1,
"hasMore": false
}
Secure player authentication and session management.
Authenticate a player and create a session.
// Player login
const session = await GameFlow.Auth.login({
email: "player@example.com",
password: "securePassword123"
});
// Or social login
const socialSession = await GameFlow.Auth.loginWithGoogle({
googleToken: "google_oauth_token"
});
console.log("Session token:", session.token);
Track events, player behavior, and revenue metrics.
Send custom analytics events to track player behavior.
// Track custom events
await GameFlow.Analytics.track("level_completed", {
level: 5,
score: 2500,
timeSpent: 180,
playerId: "player_123"
});
// Track purchase events
await GameFlow.Analytics.trackPurchase({
itemId: "premium_sword",
amount: 9.99,
currency: "USD",
playerId: "player_123"
});
Complete integration for Unity games with C# support.
Native C++ and Blueprint support for Unreal Engine.
JavaScript SDK for web games and browser integration.
Direct HTTP API for custom integrations and any platform.
Test our API endpoints directly from your browser.
Click "Send Request" to test the API