Custom Fields
Add and manage custom metadata fields on customers.
Updated
On this page
Overview
Store arbitrary key-value metadata on customer profiles. Use this for preferences, notes, or any custom data your storefront needs.
SDK Usage
import dash from "@/lib/dash"
// Set/update metadata
const { customer } = await dash.auth.updateMetadata({
preferred_strain: "indica",
birthday: "1990-05-15",
referral_source: "instagram",
custom_note: "Prefers discreet packaging",
})
// Read metadata
const { customer } = await dash.auth.getProfile()
console.log(customer.metadata.preferred_strain) // "indica"
Metadata Merge Behavior
Metadata updates are merged, not replaced. Only the keys you send are updated:
// Existing: { preferred_strain: "indica", birthday: "1990-05-15" }
await dash.auth.updateMetadata({ favorite_product: "Blue Dream" })
// Result: { preferred_strain: "indica", birthday: "1990-05-15", favorite_product: "Blue Dream" }
To remove a key, set it to null.
Use Cases
- User preferences — Strain type, flavor preferences, dosage
- Marketing data — Referral source, campaign tags
- Personalization — Birthday for discount emails, custom notes
- Custom segmentation — VIP status, customer tier notes
REST API
POST /storefront/auth/profile
Authorization: Bearer {access_token}
Content-Type: application/json
{ "metadata": { "preferred_strain": "indica", "birthday": "1990-05-15" } }
Next Steps
- Tags & Segments — Grouping customers
- Get Customer — Reading the full profile