Get Or Create Holder

Get Or Create a Holder for your organization. Holder wallets can be created for your customers with an custom user id of your choice.


PUTapi.metal.build/holder/:userId

Get Or Create a Holder

This endpoint returns a user's holder address if the user exists. If the user does not exist, a wallet will be created for them using a custom external id of your choice.


Required attributes

  • Name
    userId
    Type
    string
    Description

    The external id for your holder (e.g., "1234567890"). Must be a stable string.

Request

PUT
api.metal.build/holder/:userId
const response = await fetch(`https://api.metal.build/holder/1234567890`, {
method: 'PUT',
headers: {
  'Content-Type': 'application/json',
  'x-api-key': 'YOUR_SECRET_API_KEY',
  },
})

const holder = await response.json()

Response

{
  "success": true,
  "id": "1234567890",
  "address": "0x38A7ff01f9A2318feA8AafBa379a6c2c18b5d1dc",
  "totalValue": 0,
  "tokens": []
}

Was this page helpful?