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

# Create Master Crypto Wallet

> Create a Solana or Stellar wallet owned by the merchant

This endpoint creates a merchant-owned wallet on the selected network. It does not require a customer ID. An active master wallet on the same network cannot be created twice.

## Request

<ParamField header="x-api-key" type="string" required>
  Active production API key belonging to the merchant.
</ParamField>

<ParamField body="network" type="string" required>
  Blockchain network: `solana` or `stellar`.
</ParamField>

### Request example

```bash theme={null}
curl --request POST \
  --url https://api-production.fossapay.com/api/v1/wallets/crypto/master/create \
  --header "x-api-key: $FOSSAPAY_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{"network":"stellar"}'
```

## Response

<ResponseExample>
  ```json Success theme={null}
  {
    "status": "success",
    "statusCode": 201,
    "message": "Master crypto wallet created successfully",
    "data": [
      {
        "id": "55555555-5555-4555-8555-555555555555",
        "address": "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF",
        "network": "stellar",
        "tokens": {
          "xlm": { "amount": "0", "rawAmount": "0" },
          "usdc": { "amount": "0", "rawAmount": "0" }
        }
      }
    ]
  }
  ```
</ResponseExample>

`data` is an array of the newly created wallet's addresses and supported balances. Available token entries may vary. Save the full address and wallet `id`; retrieve existing master wallets with [Get Master Crypto Wallet](/api-reference/crypto-wallets/get-master-wallet).

## Errors

| Status | Typical cause |
| - | - |
| `400` | Wallet could not be created |
| `401` | Missing or invalid API key |
| `409` | An active master wallet already exists for this network |
| `422` | `network` is not `solana` or `stellar` |


## OpenAPI

````yaml api-reference/openapi.json POST /api/v1/wallets/crypto/master/create
openapi: 3.1.0
info:
  title: FossaPay API
  description: >-
    FossaPay API for checkout wallets, master-wallet payouts, identity
    verification, customer management, NGN wallets, crypto wallets, transfers,
    fees, banks, and webhooks.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-production.fossapay.com
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /api/v1/wallets/crypto/master/create:
    post:
      tags:
        - Crypto Wallets
      summary: Create a merchant master crypto wallet
      description: >-
        Creates one active merchant-owned wallet per supported network. Requires
        a production merchant API key and does not take a customer ID.
      operationId: CryptoWalletsController_createMasterWallet
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CryptoMasterWalletCreateRequest'
      responses:
        '201':
          description: Master crypto wallet created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CryptoMasterWalletCreateResponse'
        '400':
          description: Wallet creation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '409':
          description: An active master wallet already exists on the network
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '422':
          description: Invalid network
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
components:
  schemas:
    CryptoMasterWalletCreateRequest:
      type: object
      required:
        - network
      properties:
        network:
          type: string
          enum:
            - solana
            - stellar
      additionalProperties: false
    CryptoMasterWalletCreateResponse:
      type: object
      required:
        - status
        - statusCode
        - message
        - data
      properties:
        status:
          type: string
          const: success
        statusCode:
          type: integer
          const: 201
        message:
          type: string
        data:
          type: array
          items:
            $ref: '#/components/schemas/CryptoWalletAddress'
      additionalProperties: true
    ApiError:
      type: object
      properties:
        status:
          oneOf:
            - type: string
            - type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
        code:
          type: string
        errors:
          type: object
          additionalProperties: true
      additionalProperties: true
    CryptoWalletAddress:
      type: object
      required:
        - id
        - address
        - network
        - tokens
      properties:
        id:
          type: string
          format: uuid
          description: >-
            FossaPay crypto wallet id used by wallet-by-id and
            wallet-transactions endpoints.
        address:
          type: string
        network:
          type: string
          enum:
            - solana
            - stellar
        tokens:
          type: object
          description: >-
            Supported balances. Solana wallets can contain SOL, USDC, and USDT;
            Stellar wallets can contain XLM and USDC. Unsupported deposits
            remain in transaction history and are omitted here.
          properties:
            sol:
              $ref: '#/components/schemas/CryptoWalletTokenBalance'
            usdc:
              $ref: '#/components/schemas/CryptoWalletTokenBalance'
            usdt:
              $ref: '#/components/schemas/CryptoWalletTokenBalance'
            xlm:
              $ref: '#/components/schemas/CryptoWalletTokenBalance'
          additionalProperties:
            $ref: '#/components/schemas/CryptoWalletTokenBalance'
      additionalProperties: true
    CryptoWalletTokenBalance:
      type: object
      required:
        - amount
        - rawAmount
      properties:
        amount:
          type: string
        rawAmount:
          type: string
      additionalProperties: true
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.