Economy API (Draft WIP) - lolmaxz/vrc-ts GitHub Wiki
The Economy API allows you to interact with VRChat's economy features, such as managing transactions, subscriptions, product listings, purchases, and more. This API enables you to retrieve information about your own transactions, subscriptions, and balance, as well as interact with the Tilia integration for processing payments.
-
listSteamTransactions
- List your Steam transactions. -
getSteamTransaction
- Get details of a specific Steam transaction. Deprecated -
getCurrentSubscriptions
- Retrieve your current subscriptions. -
listSubscriptions
- List available subscription plans. -
getLicenseGroup
- Get information about a license group. -
getProductListing
- Retrieve a specific product listing. -
getUserProductListings
- Get product listings of a user. -
listTokenBundles
- List available token bundles. -
getTiliaStatus
- Get Tilia integration status. -
getTiliaTOS
- Get Tilia Terms of Service status for a user. -
getOwnPurchases
- Retrieve your purchases. -
getOwnTransactions
- Retrieve your transactions. -
getTiliaSyncData
- Get Tilia sync data for a user. -
getBalance
- Get your account balance. -
getLicenses
- Get license information.
List your Steam transactions.
Retrieve a list of your Steam transactions associated with your VRChat account.
listSteamTransactions(): Promise<SteamTransaction[]>
- No parameters
-
Promise<SteamTransaction[]>
: A promise that resolves to an array of Steam transaction objects.
// Example: List your Steam transactions
const steamTransactions = await vrchatApi.economyApi.listSteamTransactions();
console.log(steamTransactions);
Get details of a specific Steam transaction. **Deprecated**
Retrieve detailed information about a specific Steam transaction by its transaction ID.
getSteamTransaction(options: {
transactionId: string;
}): Promise<SteamTransaction>
-
options
(object):-
transactionId
(string, required):
The ID of the Steam transaction to retrieve.
-
-
Promise<SteamTransaction>
: A promise that resolves to the Steam transaction object.
// Example: Get a specific Steam transaction (Deprecated)
const steamTransaction = await vrchatApi.economyApi.getSteamTransaction({
transactionId: 'txn_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(steamTransaction);
Retrieve your current subscriptions.
Get a list of your active subscriptions, such as VRChat Plus subscriptions.
getCurrentSubscriptions(): Promise<SubscriptionComplete[]>
- No parameters
-
Promise<SubscriptionComplete[]>
: A promise that resolves to an array of subscription objects.
// Example: Get your current subscriptions
const currentSubscriptions = await vrchatApi.economyApi.getCurrentSubscriptions();
console.log(currentSubscriptions);
List available subscription plans.
Retrieve a list of available subscription plans offered by VRChat.
listSubscriptions(): Promise<Subscription[]>
- No parameters
-
Promise<Subscription[]>
: A promise that resolves to an array of subscription plan objects.
// Example: List available subscription plans
const subscriptions = await vrchatApi.economyApi.listSubscriptions();
console.log(subscriptions);
Get information about a license group.
Retrieve detailed information about a specific license group by its ID.
getLicenseGroup(options: {
licenseGroupId: string;
}): Promise<LicenseGroup>
-
options
(object):-
licenseGroupId
(string, required):
The ID of the license group to retrieve.
-
-
Promise<LicenseGroup>
: A promise that resolves to the license group object.
// Example: Get information about a license group
const licenseGroup = await vrchatApi.economyApi.getLicenseGroup({
licenseGroupId: 'licg_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(licenseGroup);
Retrieve a specific product listing.
Retrieve detailed information about a specific product listing by its ID. Optionally, you can hydrate the listing to include more detailed information.
getProductListing(options: {
listingId: string;
hydrate?: boolean; // Optional, default is false
}): Promise<Listing>
-
options
(object):-
listingId
(string, required):
The ID of the product listing to retrieve. -
hydrate
(boolean, optional):
Whether to include detailed product information. Default isfalse
.
-
-
Promise<Listing>
: A promise that resolves to the product listing object.
// Example: Get a product listing without hydration
const listing = await vrchatApi.economyApi.getProductListing({
listingId: 'pl_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(listing);
// Example: Get a product listing with hydration
const hydratedListing = await vrchatApi.economyApi.getProductListing({
listingId: 'pl_abcdef12-3456-7890-abcd-ef1234567890',
hydrate: true,
});
console.log(hydratedListing);
Get product listings of a user.
Retrieve a list of product listings created by a specific user. Only works for your own account; you can omit the userId
parameter if you are authenticated.
getUserProductListings(options: {
userId: string;
n?: number;
offset?: number;
hydrate?: boolean;
groupId?: string;
active?: boolean;
}): Promise<Listing[]>
-
options
(object):-
userId
(string, required):
The user ID of the user whose product listings you want to retrieve. -
n
(number, optional):
Number of listings to retrieve. Default is60
. -
offset
(number, optional):
Offset from the first listing. -
hydrate
(boolean, optional):
Whether to include detailed product information. -
groupId
(string, optional):
Filter listings by group ID. -
active
(boolean, optional):
Filter listings by active status.
-
-
Promise<Listing[]>
: A promise that resolves to an array of product listings.
// Example: Get your own product listings
const myListings = await vrchatApi.economyApi.getUserProductListings({
userId: 'usr_yourUserIdHere',
n: 20,
});
console.log(myListings);
List available token bundles.
Retrieve a list of available token bundles that you can purchase.
listTokenBundles(): Promise<TokenBundle[]>
- No parameters
-
Promise<TokenBundle[]>
: A promise that resolves to an array of token bundle objects.
// Example: List available token bundles
const tokenBundles = await vrchatApi.economyApi.listTokenBundles();
console.log(tokenBundles);
Get Tilia integration status.
Retrieve the status of Tilia integration with your VRChat account.
getTiliaStatus(): Promise<TiliaStatus>
- No parameters
-
Promise<TiliaStatus>
: A promise that resolves to an object containing Tilia integration status.
// Example: Get Tilia integration status
const tiliaStatus = await vrchatApi.economyApi.getTiliaStatus();
console.log(tiliaStatus);
Get Tilia Terms of Service status for a user.
Retrieve whether a user has accepted the Tilia Terms of Service.
getTiliaTOS(options: {
userId?: string; // Optional, defaults to the authenticated user
}): Promise<TOS>
-
options
(object):-
userId
(string, optional):
The user ID of the user whose Tilia TOS status you want to retrieve. If omitted, defaults to the authenticated user.
-
-
Promise<TOS>
: A promise that resolves to an object indicating whether the TOS has been signed.
// Example: Get your own Tilia TOS status
const tiliaTOS = await vrchatApi.economyApi.getTiliaTOS({});
console.log(tiliaTOS);
// Example: Get Tilia TOS status for a specific user
const userTiliaTOS = await vrchatApi.economyApi.getTiliaTOS({
userId: 'usr_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(userTiliaTOS);
Retrieve your purchases.
Retrieve a list of your purchases, such as products or subscriptions you've bought.
getOwnPurchases(options: {
buyerId?: string;
mostRecent?: boolean;
getAll?: boolean;
n?: number;
offset?: number;
}): Promise<Purchase[]>
-
options
(object):-
buyerId
(string, optional):
Your user ID. Can be omitted if authenticated. -
mostRecent
(boolean, optional):
Iftrue
, retrieves the most recent purchases. -
getAll
(boolean, optional):
Iftrue
, retrieves all purchases. -
n
(number, optional):
Number of purchases to retrieve. -
offset
(number, optional):
Offset from the first purchase.
-
-
Promise<Purchase[]>
: A promise that resolves to an array of purchase objects.
// Example: Get your own purchases
const purchases = await vrchatApi.economyApi.getOwnPurchases({
n: 10,
});
console.log(purchases);
Retrieve your transactions.
Retrieve a list of your transactions, such as token purchases or product purchases.
getOwnTransactions(options: {
type?: 'all' | 'user_listing_purchase' | 'user_token_purchase';
order?: 'ascending' | 'descending';
sort?: 'created' | 'updated';
metadata?: boolean;
search?: string;
n?: number;
offset?: number;
}): Promise<Transactions>
-
options
(object):-
type
(string, optional):
Type of transactions to retrieve. Options:'all'
,'user_listing_purchase'
,'user_token_purchase'
. Default is'all'
. -
order
(string, optional):
Order of results. Options:'ascending'
,'descending'
. -
sort
(string, optional):
Field to sort by. Options:'created'
,'updated'
. -
metadata
(boolean, optional):
Whether to include metadata. -
search
(string, optional):
Search query to filter transactions. -
n
(number, optional):
Number of transactions to retrieve. -
offset
(number, optional):
Offset from the first transaction.
-
-
Promise<Transactions>
: A promise that resolves to an object containing an array of transactions and the total count.
// Example: Get all your transactions
const transactions = await vrchatApi.economyApi.getOwnTransactions({
n: 20,
});
console.log(transactions);
Get Tilia sync data for a user.
Retrieve Tilia synchronization data for a user, which includes information about their Tilia account integration.
getTiliaSyncData(options: {
userId?: string; // Optional, defaults to the authenticated user
}): Promise<SyncData>
-
options
(object):-
userId
(string, optional):
The user ID of the user whose Tilia sync data you want to retrieve. If omitted, defaults to the authenticated user.
-
-
Promise<SyncData>
: A promise that resolves to the Tilia sync data object.
// Example: Get your own Tilia sync data
const tiliaSyncData = await vrchatApi.economyApi.getTiliaSyncData({});
console.log(tiliaSyncData);
Get your account balance.
Retrieve your current VRChat account balance, typically in terms of VRChat tokens.
getBalance(options?: {
userId?: string; // Optional, defaults to the authenticated user
}): Promise<Balance>
-
options
(object):-
userId
(string, optional):
Your user ID. Can be omitted if authenticated.
-
-
Promise<Balance>
: A promise that resolves to an object containing your account balance.
// Example: Get your account balance
const balance = await vrchatApi.economyApi.getBalance();
console.log(balance);
Get license information.
Retrieve information about a specific license by its license ID.
getLicenses(options: {
licenseId: string;
}): Promise<License>
-
options
(object):-
licenseId
(string, required):
The ID of the license to retrieve.
-
-
Promise<License>
: A promise that resolves to the license object.
// Example: Get information about a license
const license = await vrchatApi.economyApi.getLicenses({
licenseId: 'lic_abcdef12-3456-7890-abcd-ef1234567890',
});
console.log(license);
enum SubscriptionPeriod {
Hour = 'hour',
Day = 'day',
Week = 'week',
Month = 'month',
Year = 'year',
}
type TransactionStatus = 'active' | 'failed' | 'expired' | 'chargeback';
enum TransactionType {
All = 'all',
User_Listing_Purchase = 'user_listing_purchase',
User_Token_Purchase = 'user_token_purchase',
}
enum LicenseType {
Avatar = 'avatar',
LicenseGroup = 'licenseGroup',
Permission = 'permission',
Product = 'product',
}
enum DurationType {
Day = 'day',
Month = 'month',
}
-
Authentication Required: Most methods require you to be authenticated as the user whose data you are accessing.
-
Tilia Integration: Tilia is the payment processing platform used by VRChat for handling real-world currency transactions.
-
Deprecated Methods: Some endpoints, such as
getSteamTransaction
, are deprecated and may be removed in future updates. -
Data Privacy: Be cautious when handling sensitive data, such as Tilia account information or transaction details.
-
listSteamTransactions
: List your Steam transactions. -
getSteamTransaction
: Get details of a specific Steam transaction. Deprecated -
getCurrentSubscriptions
: Retrieve your current subscriptions. -
listSubscriptions
: List available subscription plans. -
getLicenseGroup
: Get information about a license group. -
getProductListing
: Retrieve a specific product listing. -
getUserProductListings
: Get product listings of a user. -
listTokenBundles
: List available token bundles. -
getTiliaStatus
: Get Tilia integration status. -
getTiliaTOS
: Get Tilia Terms of Service status for a user. -
getOwnPurchases
: Retrieve your purchases. -
getOwnTransactions
: Retrieve your transactions. -
getTiliaSyncData
: Get Tilia sync data for a user. -
getBalance
: Get your account balance. -
getLicenses
: Get license information.
-
Managing Subscriptions:
- Use
getCurrentSubscriptions
to retrieve your active subscriptions. - Use
listSubscriptions
to view available subscription plans.
- Use
-
Handling Transactions:
- Use
getOwnTransactions
to retrieve your transaction history. - Use
getOwnPurchases
to view your purchases.
- Use
-
Product Listings:
- Use
getProductListing
to get details of a specific listing. - Use
getUserProductListings
to get listings created by a user.
- Use
-
Tilia Integration:
- Use
getTiliaStatus
to check if Tilia is operational. - Use
getTiliaTOS
to check if you have accepted the Tilia TOS. - Use
getTiliaSyncData
to get synchronization data with Tilia.
- Use
-
Account Balance:
- Use
getBalance
to check your VRChat token balance.
- Use
-
Licenses and Permissions:
- Use
getLicenses
to retrieve license information associated with your account.
- Use
Note: Replace placeholder IDs like 'usr_yourUserIdHere'
, 'txn_abcdef12-3456-7890-abcd-ef1234567890'
, etc., with actual IDs as needed.
Please ensure you have the necessary permissions and adhere to VRChat's terms of service when using the Economy API.