NodeRailsCRYPTO PAYMENT INFRASTRUCTURE
DocumentationAPI Reference
Dashboard

Customers

Customers represent the people paying you. Link payments, subscriptions, and invoices to a customer for tracking and management.

Create a customer

Createtypescript
const customer = await noderails.customers.create({
  email: 'bob@example.com',
  name: 'Bob',
  metadata: { plan: 'enterprise' },
});

console.log(customer.id);    // Customer ID
console.log(customer.email); // "bob@example.com"

Retrieve a customer

Retrievetypescript
const customer = await noderails.customers.retrieve('customer-id');
console.log(customer.name, customer.email);

Update a customer

Updatetypescript
const updated = await noderails.customers.update('customer-id', {
  name: 'Robert',
  metadata: { plan: 'pro' },
});

List customers

Listtypescript
const customers = await noderails.customers.list({
  page: 1,
  pageSize: 50,
});

for (const c of customers.data) {
  console.log(c.id, c.name, c.email);
}

Manage wallets

Customers can have multiple wallets across different chains. Add and remove wallets to track which addresses belong to a customer.

Add and remove walletstypescript
// Add a wallet to a customer
const wallet = await noderails.customers.addWallet('customer-id', {
  walletAddress: '0xdef...',
  chainId: 1,
});

console.log(wallet.id);             // Wallet ID
console.log(wallet.walletAddress);   // "0xdef..."

// Remove a wallet
await noderails.customers.removeWallet('customer-id', wallet.id);

Methods reference

MethodDescription
create(params)Create a new customer
retrieve(id)Retrieve a customer with wallets and history
list(params?)List customers with pagination
update(id, params)Update customer details
addWallet(customerId, params)Add a wallet to a customer
removeWallet(customerId, walletId)Remove a wallet

TypeScript types

Type importstypescript
import type {
  Customer,
  CustomerCreateParams,
  CustomerUpdateParams,
  CustomerListParams,
  CustomerWallet,
  CustomerAddWalletParams,
} from '@noderails/sdk';

Response body reference

All responses are wrapped in { success: true, data: ... }. The fields below describe what's inside data.

create() and update() response

Customer

idstringUnique customer ID (UUID)
appIdstringYour app ID
externalIdstring | nullYour external customer ID
emailstring | nullCustomer email
namestring | nullCustomer name
addressstring | nullStreet address
citystring | nullCity
statestring | nullState or province
countrystring | nullCountry
postalCodestring | nullPostal/ZIP code
metadataobjectYour metadata key-value pairs
createdAtstringISO 8601 creation timestamp
updatedAtstringISO 8601 last update timestamp
walletsCustomerWallet[]All wallets linked to this customer

CustomerWallet (nested in wallets[])

idstringWallet record ID (UUID)
customerAccountIdstringParent customer ID
chainIdnumberChain ID (e.g. 1, 137, 8453)
walletAddressstringWallet address (lowercased)
hasActiveAuthorizationbooleanWhether the wallet has an active authorization
authorizationTypestring | nullType of authorization (PERMIT, NATIVE, etc.)
authorizationTxHashstring | nullAuthorization transaction hash
authorizedAtstring | nullWhen authorization was granted
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

retrieve() response

Returns all customer fields above, plus rich nested data:

Additional fields on retrieve

appAppFull app object
wallets[].chain{ chainId, name }Chain info on each wallet
paymentIntentsPaymentIntent[]Last 50 payment intents (selected fields: id, status, amount, currency, cryptoAmount, cryptoTokenKey, authorizationChainId, createdAt, capturedAt)
invoicesInvoice[]Last 50 invoices (selected fields: id, invoiceNumber, status, total, currency, dueDate, paidAt, createdAt)

list() response

Returns paginated customers. Each includes wallets[] plus counts:

Additional fields on list

_count.paymentIntentsnumberTotal number of payment intents
_count.subscriptionsnumberTotal number of subscriptions
_count.invoicesnumberTotal number of invoices

addWallet() response

Returns the new wallet with chain info:

Wallet response

idstringWallet ID (UUID)
customerAccountIdstringParent customer ID
chainIdnumberChain ID
walletAddressstringWallet address (lowercased)
chain{ chainId, name }Chain metadata

removeWallet() response

Returns 204 No Content (no response body).