Skip to content

Documentation Index

Fetch the complete documentation index at: https://makakoo-traylinx-35.mintlify.app/llms.txt Use this file to discover all available pages before exploring further.

Wallet Service

Wallet management, transactions, and balance API operations.

The Wallet service manages multi-entity wallets for users, organizations, and projects. It is served by the Wallets microservice, configured via REACT_APP_WALLETS_API_BASE_URL (falls back to REACT_APP_ORGANIZATIONS_API_BASE_URL).

All requests require Api-Key and Authorization: Bearer <token> headers.


List Wallets

http theme={null} GET https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets

Return all wallets accessible to the authenticated user, across all entity types (personal, organization, project, agent).

```bash theme={null} curl https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets \ -H "Authorization: Bearer " \ -H "Api-Key: "

<ParamField query="entity_type" type="string">
  Filter by entity type: `user`, `organization`, `project`.
</ParamField>

<ResponseField name="data" type="array">
  Array of wallet objects.

  <Expandable title="Wallet object">
    <ResponseField name="id" type="string">
      The wallet’s unique ID.
    </ResponseField>

    <ResponseField name="attributes.addressHash" type="string">
      The wallet’s unique address hash. Used to identify the wallet in subsequent requests.
    </ResponseField>

    <ResponseField name="attributes.entityType" type="string">
      The type of entity that owns this wallet: `user`, `organization`, or `project`.
    </ResponseField>

    <ResponseField name="attributes.entityId" type="string">
      The ID of the owning entity.
    </ResponseField>

    <ResponseField name="attributes.purpose" type="string">
      The wallet’s purpose, e.g., `operating`, `project_funds`, `general`.
    </ResponseField>

    <ResponseField name="attributes.currency" type="string">
      The wallet’s currency type, e.g., `CREDITS`.
    </ResponseField>

    <ResponseField name="attributes.balance" type="number">
      The current balance.
    </ResponseField>
  </Expandable>
</ResponseField>

***

## Get Wallet

<CodeGroup>
  ```http  theme={null}
  GET https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/{addressHash}
  ```
</CodeGroup>

Fetch details for a specific wallet by its address hash. Results are cached for 5 minutes; append `?cache_bust=<timestamp>` to force a fresh fetch.

<ParamField path="addressHash" type="string" required>
  The wallet’s unique address hash.
</ParamField>

```bash  theme={null}
curl https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/0xabc123 \
  -H "Authorization: Bearer <token>" \
  -H "Api-Key: <your_api_key>"


Create Entity Wallet

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/create_entity_wallet

Create a new wallet for an organization, project, or other entity. Organization wallets are created automatically when a new organization is created.

The owning entity type: user, organization, or project.

The unique ID of the owning entity.

A human-readable name for the wallet owner.

The wallet purpose. Common values: operating (organizations), project_funds (projects), general. Defaults to general.

The currency type. Defaults to CREDITS.

Optional metadata. For project wallets, include { "organization_id": "<id>" }.

```bash theme={null} curl -X POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/create_entity_wallet \ -H "Authorization: Bearer " \ -H "Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "entity_wallet": { "entity_type": "organization", "entity_id": "org-123", "entity_name": "Acme Corp", "purpose": "operating", "currency": "CREDITS" } }'

***

## Update Wallet

<CodeGroup>
  ```http  theme={null}
  PUT https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/{addressHash}
  ```
</CodeGroup>

Update wallet properties such as `entity_name` and `description`.

<ParamField path="addressHash" type="string" required>
  The wallet’s unique address hash.
</ParamField>

<ParamField body="wallet" type="object" required>
  Object containing the fields to update.
</ParamField>

***

## Transaction History

<CodeGroup>
  ```http  theme={null}
  GET https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/{addressHash}/transactions
  ```
</CodeGroup>

List transactions for a specific wallet with pagination.

<ParamField path="addressHash" type="string" required>
  The wallet’s unique address hash.
</ParamField>

<ParamField query="page" type="integer">
  Page number. Defaults to `1`.
</ParamField>

<ParamField query="per_page" type="integer">
  Items per page. Defaults to `20`.
</ParamField>

```bash  theme={null}
curl "https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/0xabc123/transactions?page=1&per_page=20" \
  -H "Authorization: Bearer <token>" \
  -H "Api-Key: <your_api_key>"

Array of transaction objects.

Current page number.

Items per page.

Total number of transactions.


Transact (Universal Transfer / Conversion)

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/transact

The universal transaction endpoint handles both transfers between wallets and asset conversions within a single wallet. When from_wallet and to_wallet are the same address, the operation is treated as a conversion.

Source wallet address hash.

Destination wallet address hash. Set equal to from_wallet for an in-wallet conversion.

Asset type to debit from the source wallet (e.g., CREDITS).

Asset type to credit to the destination wallet. Set equal to from_asset for a same-asset transfer.

The amount to transfer or convert. Must be a number (not a string).

Human-readable description of the transaction.

Additional metadata.

Purpose tag, e.g., asset_conversion, wallet_transfer, transfer_with_conversion.

<ParamField body="transaction.metadata.token_prices" type="object">
  Optional token price map used for conversions, e.g., `{ "CREDITS": 0.01 }`.
</ParamField>

```bash theme={null}

Transfer CREDITS between wallets

curl -X POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/transact \ -H "Authorization: Bearer " \ -H "Api-Key: " \ -H "Content-Type: application/json" \ -d '{ "transaction": { "from_wallet": "0xabc123", "to_wallet": "0xdef456", "from_asset": "CREDITS", "to_asset": "CREDITS", "amount": 100, "description": "Transfer 100 CREDITS", "metadata": { "purpose": "wallet_transfer" } } }' ```


Debit Wallet

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/{addressHash}/debits

Deduct funds from a wallet. Users can debit their own wallets.

The wallet’s unique address hash.

The amount to debit.

Human-readable description of the debit.

Optional external reference ID for idempotency.


Credit Wallet

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallets/{addressHash}/credits

Add funds to a wallet. Requires admin-level access (Admin-Access header).

The wallet’s unique address hash.

The amount to credit.

Human-readable description of the credit.

Optional external reference ID.

This endpoint requires the Admin-Access header with a valid admin access token.


Wallet Transfers

Wallet transfers are a two-step process: the sender creates a transfer request, and the recipient accepts it. Both steps require verification codes.

List Transfer Requests

http theme={null} GET https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers

Page number. Defaults to 1.

Items per page. Defaults to 20.

Create Transfer Request

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers

Transfer details object.

List Pending Transfers

http theme={null} GET https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers/pending

Return transfers awaiting action by the authenticated user.

Verify Transfer Sender

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers/{transferId}/verify_sender

The transfer ID.

The sender’s verification code.

Accept Transfer

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers/{transferId}/accept

The transfer ID.

The recipient’s verification code.

Reject Transfer

http theme={null} POST https://api.traylinx.com/ma-metrics-wsp-ms/v1/api/wallet_transfers/{transferId}/reject

The transfer ID.

Built with Mintlify.