Cloud Wallet API

Projects

A *project* is the first entity you create in our web application at app.walletapi.cloud. Projects store customer records and wallets that are linked to one application or focus on one idea. *Transactions are available only for wallets within one project.*

Get project details

Call this endpoint to obtain details and a list of assets for the current project.


/project

Parameters

Responses

Status: 200 - Successful operation


Assets

An *asset* can be anything of value owned by someone, such as virtual or real currencies, bonus points, or metro rides. Inventory items like water bottles, bags of coffee beans, or packets of sugar can also be assets. Asset amounts are stored in wallets. 

Create an asset

Create a new asset type.


/assets

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Asset created


Delete an asset

Deletes an unused asset type. Used assets cannot be removed. Asset types are marked as used when the first wallet using this asset is created.


/assets/{assetId}

Parameters

Path parameters
Name Description
assetId*
String
Asset ID
Required

Responses

Status: 200 - Successful operation

Status: 404 - Project not found

Status: 403 - Asset is used


Get asset details

Obtain the details of an asset with provided ID. May be called with an Access Key or a Customer Key.


/assets/{assetId}

Parameters

Path parameters
Name Description
assetId*
String
Asset ID
Required

Responses

Status: 200 - Successful operation

Status: 404 - Not found


List project assets

Obtain a list of assets for a project. May be called with an Access Key or a Customer Key.


/assets

Parameters

Responses

Status: 200 - Successful operation


Rename an asset

Updates asset name.


/assets/{assetId}/name

Parameters

Path parameters
Name Description
assetId*
String
Asset ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successful operation

Status: 404 - Not found


Customers

A *customer* is a record that reflects your existing users and enables you to create wallets for them. Basically, customers own wallets. You decide how you map customers into your system. People, devices, vehicles, or appliances that contain value can act as customers. We respect your users' privacy and only ask you to provide an ID that you can later identify and map back to the user in your system.

Create a customer

Creates a new customer record or updates an existing record if a customer with provided ID already exists.


/customers

Parameters

Body parameters
Name Description
body *

Responses

Status: 200 - Successful update

Status: 201 - Successful create


Get customer details

Call this endpoint to obtain a record for a customer with provided ID. You are only allowed to read a key’s owner record when you call with a Customer Key.


/customers/{customerId}

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required

Responses

Status: 200 - Successful operation

Status: 403 - Not allowed

Status: 404 - Customer not found


List customers

Retrieve a list of your customers with pagination. Specify current page and page size as query parameters.


/customers

Parameters

Query parameters
Name Description
page*
Integer (int32)
Page number query parameter
Required
pageSize
Integer (int32)
Page size query parameter

Responses

Status: 200 - Successful operation


Update customer details

Call this endpoint to create or update a record for a customer with provided customer ID. You are only allowed to update a key’s owner record when you call with a Customer Key.


/customers/{customerId}

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required
Body parameters
Name Description
body

Responses

Status: 200 - Successful operation


Suspend a customer

Suspend customer and all their wallets.


/customers/{customerId}/suspend

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required

Responses

Status: 200 - Successful operation

Status: 404 - Customer not found


Unsuspend a customer

Unsuspend a customer. Please note that customer's wallets will not be reactivated. You must reactivate wallets either via separate calls or by providing wallet IDs in the request body.


/customers/{customerId}/resume

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successful operation

Status: 404 - Customer not found


Delete a customer

Call this endpoint to delete a customer record. All wallets belonging to this customer must be closed before this call. **Deleted data cannot be restored. Closed wallets will not be deleted.**


/customers/{customerId}

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required

Responses

Status: 200 - Successful operation

Status: 400 - At least one customer's wallet is not closed.


Wallets

A *wallet* stores value, as well as the user’s balance history. Each wallet belongs either to a customer or to you (then it is called a *system wallet*). Assign as many wallets to your users or devices as you’d like. The wallet balance can’t dip below zero. A *wallet entry* is a record in a wallet ledger about an event. There are several types of events: - *Issue* records the effect of an issue operation - *Redeem* records redeem operations - *Debit* is posted to the wallet that is on the debit side of a transfer - *Credit* will appear on the credit side of the transfer

Open a wallet for a customer

Create a wallet for a customer with a provided customer ID. Make a call to receive the opened wallet details.


/wallets

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Successful operation

Status: 400 - Bad request. Asset ID or customer ID refer to a non-existent entity.


Open a system wallet

Open a new system wallet for the current project. System wallets belong to you, not to your customers. They are linked to a project and usually are created to collect commissions or accept fees, among other reasons.


/system-wallets

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Successful operation

Status: 400 - Asset not found


Get wallet details

Obtain wallet balance and details. When called with a Customer Key, you will only be permitted to query the wallets that belong to a key owner.


/wallets/{walletId}

Parameters

Path parameters
Name Description
walletId*
String
Wallet ID
Required

Responses

Status: 200 - Successful operation

Status: 404 - Not found


List customer's wallets

Obtain details and balances for wallets belonging to a provided customer. When called with a Customer Key, you will only be permitted to query the wallets that belong to a key owner.


/customers/{customerId}/wallets

Parameters

Path parameters
Name Description
customerId*
String
Customer ID
Required

Responses

Status: 200 - Successful operation

Status: 204 - No content

Status: 403 - Not allowed

Status: 404 - Customer not found


List current customer's own wallets

When using a Customer Key, this API will list the wallets that the customer owns. This only works with Customer Keys.


/wallets

Parameters

Responses

Status: 200 - Successful operation

Status: 204 - No content

Status: 403 - Access denied


List system wallets

Obtain a list of system wallets for this project.


/system-wallets

Parameters

Responses

Status: 200 - Successful operation


Change wallet name

Updates wallet name. When called with a Customer Key, you can only update the wallets that belong to a key owner.


/wallets/{walletId}/name

Parameters

Path parameters
Name Description
walletId*
String
Wallet ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successful operation

Status: 404 - Not found


Change wallet description

Updates wallet description. When called with a Customer Key, you can only update the wallets that belong to a key owner.


/wallets/{walletId}/description

Parameters

Path parameters
Name Description
walletId*
String
Wallet ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successful operation

Status: 404 - Not found


Change wallet status

Every wallet is created in Open mode. Then it is possible to change the status (mode) to one of the following: - *Open* wallets can hold a balance and participate in transactions.They can be switched to *Suspended* or *Closed*. - *Suspended* wallets keep their balance, but you’re unable to perform transactions with them. They can be changed back to *Open* or to *Closed*. - *Closed* permanently stops transactions with a wallet. Only empty wallets can be closed, and you can't reopen wallets once you’ve closed them.


/wallets/{walletId}/status

Parameters

Path parameters
Name Description
walletId*
String
Wallet ID
Required
Body parameters
Name Description
body *

Responses

Status: 200 - Successful operation

Status: 400 - Wrong status

Status: 404 - Wallet not found


List operations in wallet's ledger

Obtain a pageable list of operations that were posted to a wallet within a specified time period.


/wallets/{walletId}/entries

Parameters

Path parameters
Name Description
walletId*
String
Wallet ID
Required
Query parameters
Name Description
from*
Long (int64)
Date from
Required
to*
Long (int64)
Date to
Required
page*
Integer (int32)
Page number query parameter
Required
pageSize
Integer (int32)
Page size query parameter

Responses

Status: 200 - Successful operation

Status: 400 - Specified end date is earlier than begin date

Status: 404 - Wallet not found


Transactions

A transaction is a set of operations (one or more) that must be performed together. When a transaction is performed, operations are performed in the order in which they’re listed. An operation is a basic atomic action which updates one or two wallet balances. Each operation posts an entry to the ledger of each wallet it affects. An operation can be performed only within a transaction. There are three types of operations: - A *Transfer* moves some value from one wallet to another within the same project. - An *Issue* operation increases a user’s wallet balance by creating value. - *Redeem* decreases one wallet's balance by eliminating some amount of value. When all the operations in a set can be performed successfully, the whole transaction will be completed. If any single operation fails, all the other operations will be reverted back and the transaction will fail.

Initiate a new transaction

Calling this endpoint will start a new transaction.


/transactions

Parameters

Body parameters
Name Description
body *

Responses

Status: 201 - Successful operation

Status: 400 - Bad request. Wallet was not found, wrong asset in the operation, etc.


Get transaction details

Call this endpoint to obtain a transaction's current state.


/transactions/{txId}

Parameters

Path parameters
Name Description
txId*
String
Transaction ID
Required

Responses

Status: 200 - Successful operation

Status: 404 - Not found


List transactions

Retrieve a pageable list of transactions for a specified time period.


/transactions

Parameters

Query parameters
Name Description
from*
Long (int64)
Date from
Required
to*
Long (int64)
Date to
Required
page*
Integer (int32)
Page number query parameter
Required
pageSize
Integer (int32)
Page size query parameter

Responses

Status: 200 - Successful operation

Status: 400 - Bad request