Skip to content

AssetStoreOrders

ClassAssetInventoryAssetInventory.Editor
public static class AssetStoreOrders

Local, account-scoped order queries. No method in this facade starts a network request.

public static string GetEditorAccountId()

Returns the Unity Editor's current signed-in user ID without starting an authentication request.

Returns

System.String

public static string GetAccountId()

Returns the stored account selection, otherwise preferring the Editor account's cached data or the first known account.

Returns

System.String

public static void SetAccountId(string accountId)

Stores a nonempty account identifier of at most 64 characters as the default for order queries and notifies listeners.

Parameters

Name Type
accountId System.String
public static List<OrderAccountInfo> GetAccounts()

Returns known cached accounts with order-detail coverage and last successful refresh times, sorted by name.

Returns

System.Collections.Generic.List{AssetInventory.OrderAccountInfo}

public static List<AssetStoreOrder> List(OrderQuery query = null)

Returns a page of matching cached orders for the requested or selected account, newest first.

Parameters

Name Type
query AssetInventory.OrderQuery

Returns

System.Collections.Generic.List{AssetInventory.AssetStoreOrder}

public static int Count(OrderQuery query = null)

Counts matching cached orders for the requested or selected account without applying pagination.

Parameters

Name Type
query AssetInventory.OrderQuery

Returns

System.Int32

public static AssetStoreOrder Get(int orderRowId, string accountId = null)

Finds a cached order by its local row ID within the requested or selected account, returning null when absent.

Parameters

Name Type
orderRowId System.Int32
accountId System.String

Returns

AssetInventory.AssetStoreOrder

public static AssetStoreOrder GetByOrderId(string accountId, string orderId)

Finds a cached order by its Store order ID within the requested or selected account, returning null when absent.

Parameters

Name Type
accountId System.String
orderId System.String

Returns

AssetInventory.AssetStoreOrder

public static List<AssetStoreOrderItem> GetItems(int orderRowId)

Returns the cached line items for a local order row in ascending line-row order.

Parameters

Name Type
orderRowId System.Int32

Returns

System.Collections.Generic.List{AssetInventory.AssetStoreOrderItem}

public static Dictionary<int, List<AssetStoreOrderItem>> GetItems(IEnumerable<int> orderRowIds)

Returns cached line items grouped by local order row ID, omitting orders with no cached items.

Parameters

Name Type
orderRowIds System.Collections.Generic.IEnumerable{System.Int32}

Returns

System.Collections.Generic.Dictionary{System.Int32,System.Collections.Generic.List{AssetInventory.AssetStoreOrderItem}}

public static List<PackageOrderInfo> GetPackagePurchases(AssetInfo package, string accountId = null)

Returns all cached acquisition and order pairs matching the package's Store product identity in the requested or selected account.

Parameters

Name Type
package AssetInventory.AssetInfo
accountId System.String

Returns

System.Collections.Generic.List{AssetInventory.PackageOrderInfo}

public static Dictionary<int, List<PackageOrderInfo>> GetPackagePurchases(IEnumerable<AssetInfo> packages, string accountId = null)

Groups matching cached acquisitions by catalog package ID, retaining empty lists for packages with no recorded match.

Parameters

Name Type
packages System.Collections.Generic.IEnumerable{AssetInventory.AssetInfo}
accountId System.String

Returns

System.Collections.Generic.Dictionary{System.Int32,System.Collections.Generic.List{AssetInventory.PackageOrderInfo}}

public static PackageOrderInfo GetLatestPurchase(IEnumerable<PackageOrderInfo> purchases)

Returns the newest completed, nontentative acquisition with a positive quantity, or null when none qualify.

Parameters

Name Type
purchases System.Collections.Generic.IEnumerable{AssetInventory.PackageOrderInfo}

Returns

AssetInventory.PackageOrderInfo

public static bool TryAmount(string raw, out decimal amount)

Parses a signed invariant decimal amount without currency symbols or thousands separators.

Parameters

Name Type
raw System.String
amount System.Decimal

Returns

System.Boolean

public static string FormatAmount(string raw, string currency)

Formats an invariant decimal and currency code, or returns "Unavailable" for an invalid source amount.

Parameters

Name Type
raw System.String
currency System.String

Returns

System.String

GetAmountBasis(AssetStoreOrder, IEnumerable)

Section titled “GetAmountBasis(AssetStoreOrder, IEnumerable)”
public static string GetAmountBasis(AssetStoreOrder order, IEnumerable<AssetStoreOrderItem> items)

Describes the reported tax basis when complete order details and monetary totals establish it, otherwise reporting unavailable evidence.

Parameters

Name Type
order AssetInventory.AssetStoreOrder
items System.Collections.Generic.IEnumerable{AssetInventory.AssetStoreOrderItem}

Returns

System.String

public static int Revision { get; }

Returns

System.Int32

public static event Action Changed

Raised when cached order data or the selected account changes.

Returns

System.Action