EconomyService
The wallet, NEO Credits packs, the Marketplace's items, buying and inventory.
On this page
- Summary
- Methods
- GetWallet
- ListTransactions
- ListCreditPacks
- StartTopUp
- ListItems
- GetItem
- CreateItem
- UpdateItem
- BuyItem
- ListInventory
- Types
- BuyItemRequest
- BuyItemResponse
- CreateItemRequest
- CreditPack
- GetWalletRequest
- ItemRef
- ListCreditPacksRequest
- ListCreditPacksResponse
- ListInventoryRequest
- ListInventoryResponse
- ListItemsRequest
- ListItemsResponse
- ListTransactionsRequest
- ListTransactionsResponse
- PaymentMethod
- StartTopUpRequest
- StartTopUpResponse
- Transaction
- UpdateItemRequest
- Wallet
- See also
Credits, the ledger, payments and the marketplace. Every method is a POST with a JSON body; see the overview for the protocol, authentication and errors.
Summary#
| Method | Auth | Description |
|---|---|---|
| GetWallet | Account | |
| ListTransactions | Account | |
| ListCreditPacks | None | |
| StartTopUp | Account | Starts a top-up with a payment provider; returns the checkout URL. |
| ListItems | Optional | |
| GetItem | Optional | |
| CreateItem | Account | |
| UpdateItem | Account | The creator edits a listing (name, description, price, or delists it). |
| BuyItem | Account | |
| ListInventory | Account |
Methods#
GetWallet#
POST /neo.platform.v1.EconomyService/GetWallet
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: GetWalletRequest. Response: Wallet.
ListTransactions#
POST /neo.platform.v1.EconomyService/ListTransactions
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: ListTransactionsRequest. Response: ListTransactionsResponse.
ListCreditPacks#
POST /neo.platform.v1.EconomyService/ListCreditPacks
Content-Type: application/jsonAuth: None.
Request: ListCreditPacksRequest. Response: ListCreditPacksResponse.
StartTopUp#
Starts a top-up with a payment provider; returns the checkout URL.
POST /neo.platform.v1.EconomyService/StartTopUp
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: StartTopUpRequest. Response: StartTopUpResponse.
ListItems#
POST /neo.platform.v1.EconomyService/ListItems
Content-Type: application/jsonAuth: Optional. Signed-in callers get personalised fields.
Request: ListItemsRequest. Response: ListItemsResponse.
GetItem#
POST /neo.platform.v1.EconomyService/GetItem
Content-Type: application/jsonAuth: Optional. Signed-in callers get personalised fields.
Request: ItemRef. Response: Item.
CreateItem#
POST /neo.platform.v1.EconomyService/CreateItem
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: CreateItemRequest. Response: Item.
UpdateItem#
The creator edits a listing (name, description, price, or delists it).
POST /neo.platform.v1.EconomyService/UpdateItem
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: UpdateItemRequest. Response: Item.
BuyItem#
POST /neo.platform.v1.EconomyService/BuyItem
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: BuyItemRequest. Response: BuyItemResponse.
ListInventory#
POST /neo.platform.v1.EconomyService/ListInventory
Content-Type: application/jsonAuth: A signed-in account. Guests are refused.
Request: ListInventoryRequest. Response: ListInventoryResponse.
Types#
BuyItemRequest#
| Field | Type | Description |
|---|---|---|
itemId | string | |
expectedPrice | string (int64) | The price the buyer saw (rejected if it changed). |
soldInExperienceId | string | The experience the purchase happened in (for the selling-game share), optional. |
requestId | string | Idempotency key from the client. |
BuyItemResponse#
CreateItemRequest#
| Field | Type | Description |
|---|---|---|
kind | string | |
name | string | |
description | string | |
price | string (int64) | |
experienceId | string |
CreditPack#
| Field | Type | Description |
|---|---|---|
id | string | |
credits | string (int64) | |
priceMinor | string (int64) | Price in the smallest currency unit (cents). |
currency | string |
GetWalletRequest#
No fields: send {}.
ItemRef#
| Field | Type | Description |
|---|---|---|
itemId | string |
ListCreditPacksRequest#
| Field | Type | Description |
|---|---|---|
channel | string |
ListCreditPacksResponse#
| Field | Type | Description |
|---|---|---|
packs | array of CreditPack | |
methods | array of PaymentMethod | Every method, configured or not; clients offer the configured ones. |
ListInventoryRequest#
| Field | Type | Description |
|---|---|---|
kind | string |
ListInventoryResponse#
| Field | Type | Description |
|---|---|---|
items | array of Item |
ListItemsRequest#
| Field | Type | Description |
|---|---|---|
kind | string | |
experienceId | string | |
limit | number |
ListItemsResponse#
| Field | Type | Description |
|---|---|---|
items | array of Item |
ListTransactionsRequest#
| Field | Type | Description |
|---|---|---|
limit | number |
ListTransactionsResponse#
| Field | Type | Description |
|---|---|---|
transactions | array of Transaction |
PaymentMethod#
A way to pay for Credits, and whether this environment can take it.
| Field | Type | Description |
|---|---|---|
id | string | card, sandbox, usdc, store_apple, store_google (StartTopUpRequest.method) |
label | string | |
configured | boolean | |
reason | string | When it isn't configured: why (e.g. "card payments aren't configured in this environment"). |
StartTopUpRequest#
| Field | Type | Description |
|---|---|---|
packId | string | |
method | string | card (fiat, the default), usdc (crypto), store_apple, store_google, sandbox (dev and test environments only). ListCreditPacks says which this environment takes. |
StartTopUpResponse#
| Field | Type | Description |
|---|---|---|
orderId | string | |
checkoutUrl | string | |
status | string |
Transaction#
| Field | Type | Description |
|---|---|---|
id | string | |
kind | string | top_up, purchase, sale, refund, grant |
amount | string (int64) | Signed change to the caller's spendable balance. |
memo | string | |
createdAt | string |
UpdateItemRequest#
| Field | Type | Description |
|---|---|---|
itemId | string | |
name | string | |
description | string | |
price | string (int64) | -1 = unchanged. |
status | string | listed or delisted; empty = unchanged. |
Wallet#
| Field | Type | Description |
|---|---|---|
purchased | string (int64) | Credits bought with money (spendable, not cash-out-able). |
earned | string (int64) | Credits earned from sales (spendable; cash-out-able after the hold). |
pending | string (int64) | |
total | string (int64) |