To understand how to start using FINGI API, please address following sections of our documentation:
1. How to use FINGI API
2. How to Create App
3. How to Get API Key
4. FINGI API endpoints
FINGI webhooks offer a seamless solution for syncing virtual assets between in-game inventories and the FINGI platform. By automatically sending real-time notifications whenever a change occurs in a user's inventory, webhooks ensure that asset information remains up-to-date and consistent across both environments. This approach eliminates the need for manual synchronization or constant polling, thereby reducing the workload on game servers and enhancing the overall user experience.
1. Navigate to the Manage Apps section
2. Click the "Edit" button on the registered app
3. Locate the "Your unique URL for events (FINGI webhook)" field at the bottom
4. Paste the URL that will receive FINGI webhook requests for this app
5. Click 'Save' button
Once you provide a URL for a webhook in the Manage Apps section, this URL will begin receiving HTTP POST requests whenever a user interacts with their inventory on the FINGI platform. The structure and content of these requests will vary depending on the type of interaction, such as merging or selling spendable assets, acquiring or selling permanent items, or activating time-limited items.
Request structure
HEADER | VALUE |
---|---|
Authorization | Basic Your_Fingi_Api_Key_Here |
X-Webook-event | ItemMergeRequested, SellOrderCreated, SubActivated, TokenAmountChanged |
The ItemMergeRequested webhook is triggered when a user requests to merge items in their FINGI inventory, which means that we should add these items to their in-game inventory.
Field | Type | Description |
---|---|---|
clientId | string | App client ID |
event | string | Event type: ItemMergeRequested |
mergeRequest | ItemMergeRequestedContent | Details of the merge request |
ItemMergeRequestedContent
Field | Type | Description |
---|---|---|
mergeId | string | Unique ID of the merge request |
userEmail | string | Email of the user who initiated the merge request |
itemUri | string | Item metadata URL |
count | number | Number of items requested to be merged |
The webhook ItemMergeRequested example
{
"clientId": "123456",
"event": "ItemMergeRequested",
"mergeRequest": {
"mergeId": "abcd1234",
"userEmail": "[email protected]",
"itemUri": "https://example-game.example-domain.com/item?id=567890",
"count": 5
}
}
The SellOrderCreated webhook is triggered when a user creates a sell or minting order for their items in the FINGI inventory.
Field | Type | Description |
---|---|---|
clientId | string | App client id |
event | string | Event type: SellOrderCreated |
sellOrderCreated | SellOrderCreatedContent | Object containing sell order details |
SellOrderCreatedContent
Field | Type | Description |
---|---|---|
userEmail | string | Email of the user who created the sell order |
itemUri | string | Item metadata URL |
countSold | ulong | Number of items sold in the sell order |
countRemaining | ulong | Number of items remaining in the user inventory |
The webhook SellOrderCreated example
{
"clientId": "123456",
"event": "SellOrderCreated",
"sellOrderCreated": {
"userEmail": "[email protected]",
"itemUri": "https://example-game.example-domain.com/item?id=567890",
"countSold": 3,
"countRemaining": 2
}
}
The TokenAmountChanged webhook is triggered when the amount of permanent tokens in a user's inventory changes due to acquiring, selling, or transferring tokens.
Field | Type | Description |
---|---|---|
clientId | string | App client id |
event | string | Event type: TokenAmountChanged |
tokenAmountChanged | TokenAmountChangedContent | Object containing token amount change details |
TokenAmountChangedContent
Field | Type | Description |
---|---|---|
userEmail | string | Email of the user whose token amount has changed |
items | SimpleItemInfo[] | Array of SimpleItemInfo objects representing the items related to the token amount change |
SimpleItemInfo
Field | Type | Description |
---|---|---|
itemUri | string | Item metadata URL |
tokenCount | number | Number of tokens associated with the item |
The webhook TokenAmountChanged example
{
"clientId": "123",
"event": "TokenAmountChanged",
"tokenAmountChanged": {
"userEmail": "[email protected]",
"items": [
{
"itemUri": "https://sample-game.example.com/item?id=123123",
"tokenCount": 361
},
{
"itemUri": "https://sample-game.example.com/item?id=123",
"tokenCount": 253
},
{
"itemUri": "https://sample-game.example.com/item?id=15",
"tokenCount": 716
},
...
]
}
}
The SubActivated webhook is triggered when a user activates a time-limited token, which extends the expiration time of a time-limited item such as a booster or subscription.
Field | Type | Description |
---|---|---|
clientId | string | App client id |
event | string | Event type: SubActivated |
subActivated | SubActivatedContent | Subscriptions activated |
SubActivatedContent
Field | Type | Description |
---|---|---|
userEmail | string | Email of user |
activeSubs | SubActivatedInfo[] | Array of active subscriptions |
SubActivatedInfo
Field | Type | Description |
---|---|---|
itemUri | string | Item metadata URL |
expirationDate | number | Expiration date for the subscription |
isActive | boolean | Is the subscription active |
The webhook SubActivated example
{
"clientId": "123",
"event": "SubActivated",
"subActivated": {
"userEmail": "[email protected]",
"activeSubs": [
{
"itemUri": "https://sample-game.example.com/item?id=123",
"expirationDate": 1975000000,
"isActive": true
},
{
"itemUri": "https://sample-game.example.com/item?id=456",
"expirationDate": 1980000000,
"isActive": true
},
...
]
}
}