> ## Documentation Index
> Fetch the complete documentation index at: https://alguna.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Wallet

Create a new wallet for a customer account. Wallets store prepaid credits that can be applied to invoices.

<ParamField body="accountId" type="string" required>
  The account ID to create the wallet for.
</ParamField>

<ParamField body="name" type="string" required>
  Display name for the wallet.
</ParamField>

<ParamField body="currency" type="string" required>
  ISO 4217 currency code (e.g., "USD", "EUR").
</ParamField>

<ParamField body="productIds" type="array">
  Optional array of product IDs. If specified, wallet credits can only be applied to these products.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.alguna.io/wallets \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "accountId": "acc_abc123",
      "name": "Prepaid Credits",
      "currency": "USD",
      "productIds": ["prod_xyz789"]
    }'
  ```

  ```javascript Node.js theme={null}
  const wallet = await alguna.wallets.create({
    accountId: 'acc_abc123',
    name: 'Prepaid Credits',
    currency: 'USD',
    productIds: ['prod_xyz789']
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "wal_def456",
    "accountId": "acc_abc123",
    "name": "Prepaid Credits",
    "currency": "USD",
    "currentBalance": "0.00",
    "active": true,
    "productIds": ["prod_xyz789"],
    "createdAt": "2024-01-20T10:00:00Z",
    "updatedAt": "2024-01-20T10:00:00Z"
  }
  ```
</ResponseExample>

<ResponseField name="id" type="string">
  Unique identifier for the wallet.
</ResponseField>

<ResponseField name="accountId" type="string">
  The account this wallet belongs to.
</ResponseField>

<ResponseField name="name" type="string">
  Display name of the wallet.
</ResponseField>

<ResponseField name="currency" type="string">
  Currency code for the wallet balance.
</ResponseField>

<ResponseField name="currentBalance" type="string">
  Current balance as a decimal string.
</ResponseField>

<ResponseField name="active" type="boolean">
  Whether the wallet is active and can be used.
</ResponseField>

<ResponseField name="productIds" type="array">
  Product IDs the wallet is restricted to, if any.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of creation.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp of last update.
</ResponseField>
