StackupDocs
Stackup

Customer

Customers represent buyers identified by their blockchain wallet address.

Methods

MethodDescriptionReturns
createCreate a new customerCustomer
listList all customersCustomer[]
getGet a customer by IDCustomer
updateUpdate a customerCustomer
checkCheck if customer has paid for a product{ allowed: boolean }

create

Type (parameters: { walletAddress: string; email?: string; name?: string; externalID?: string }) => Promise<Customer>

Create a new customer with wallet address and optional metadata.

const customer = await stackup.customer.create({
  walletAddress: "0x1234567890abcdef1234567890abcdef12345678",
  email: "user@example.com",
  name: "John Doe",
  externalID: "user_123"
})

Wallet addresses are automatically checksummed for consistency.


list

Type () => Promise<Customer[]>

List all customers for the current workspace.

const customers = await stackup.customer.list()

get

Type (parameters: { id: string }) => Promise<Customer>

Get a customer by their ID.

const customer = await stackup.customer.get({ id: "cus_01ABC123" })

update

Type (parameters: { id: string; email?: string; name?: string; externalID?: string }) => Promise<Customer>

Update an existing customer's properties.

await stackup.customer.update({
  id: "cus_01ABC123",
  email: "newemail@example.com"
})

check

Type (parameters: { customerID: string; productID: string }) => Promise<{ allowed: boolean }>

Verify if a customer has paid for a specific product.

const { data } = await stackup.customer.check({
  customerID: "cus_01ABC123",
  productID: "prd_01DEF456"
})

if (data.allowed) {
  // Grant access
}

Auto-Creation

Customers are automatically created during checkout if not pre-assigned. The buyer's wallet address is used to create or match an existing customer.

Types

Customer

PropertyTypeDescription
idstringUnique identifier
workspaceIDstringParent workspace
walletAddressstringCustomer wallet address (0x...)
emailstring | nullOptional email address
namestring | nullOptional display name
externalIDstring | nullOptional external identifier
timeCreatedDateCreation timestamp
timeUpdatedDateLast modification
timeDeletedDate | nullSoft delete timestamp

Errors

A list of errors that can be returned by the Customer API.


CustomerCreateErrors

The customer creation request was invalid.

Status: 400 BadRequestError


CustomerGetErrors

The customer could not be retrieved.

Status: 400 BadRequestError, 404 NotFoundError


CustomerUpdateErrors

The customer update request was invalid or customer not found.

Status: 400 BadRequestError, 404 NotFoundError


CustomerCheckErrors

The check request was invalid or customer/product not found.

Status: 400 BadRequestError, 404 NotFoundError