Skip to main content

Account Management

Overview

The Account Management API allows you to create and manage wallet accounts in the Dukka Wallet Service. This guide explains how to use the API to perform various account operations.

Endpoints

Create Account

POST /api/v1/accounts/create

Request Body

{
  "accountName": "string",
  "accountType": "string",
  "currency": "string",
  "tierId": "string",
  "metadata": {
    "key": "value"
  }
}

Response

{
  "status": "success",
  "message": "Account created successfully",
  "data": {
    "accountId": "string",
    "accountName": "string",
    "accountType": "string",
    "currency": "string",
    "tierId": "string",
    "balance": 0,
    "createdAt": "string",
    "updatedAt": "string"
  }
}

Get Account

GET /api/v1/accounts/{accountId}

Response

{
  "status": "success",
  "data": {
    "accountId": "string",
    "accountName": "string",
    "accountType": "string",
    "currency": "string",
    "tierId": "string",
    "balance": 0,
    "createdAt": "string",
    "updatedAt": "string"
  }
}

Update Account

PUT /api/v1/accounts/{accountId}

Request Body

{
  "accountName": "string",
  "tierId": "string",
  "metadata": {
    "key": "value"
  }
}

Response

{
  "status": "success",
  "message": "Account updated successfully",
  "data": {
    "accountId": "string",
    "accountName": "string",
    "accountType": "string",
    "currency": "string",
    "tierId": "string",
    "balance": 0,
    "createdAt": "string",
    "updatedAt": "string"
  }
}

List Accounts

GET /api/v1/accounts

Query Parameters

  • page (optional): Page number
  • size (optional): Number of items per page
  • accountType (optional): Filter by account type
  • currency (optional): Filter by currency
  • tierId (optional): Filter by tier ID

Response

{
  "status": "success",
  "data": {
    "accounts": [
      {
        "accountId": "string",
        "accountName": "string",
        "accountType": "string",
        "currency": "string",
        "tierId": "string",
        "balance": 0,
        "createdAt": "string",
        "updatedAt": "string"
      }
    ],
    "pagination": {
      "page": 0,
      "size": 0,
      "total": 0,
      "totalPages": 0
    }
  }
}

Error Responses

400 Bad Request

{
  "status": "error",
  "message": "Invalid request parameters"
}

401 Unauthorized

{
  "status": "error",
  "message": "Unauthorized access"
}

404 Not Found

{
  "status": "error",
  "message": "Account not found"
}

409 Conflict

{
  "status": "error",
  "message": "Account already exists"
}

Best Practices

Account Creation

  • Validate all input data
  • Implement proper error handling
  • Use appropriate account types
  • Set proper tier limits
  • Implement proper logging

Account Management

  • Monitor account activity
  • Implement proper access controls
  • Use appropriate security measures
  • Follow compliance requirements
  • Implement proper audit trails

Support

If you need help with account management:
  1. Check the documentation
  2. Contact support
  3. Report issues on GitHub

Additional Resources