Skip to content

Conversation

@NatElkins
Copy link
Contributor

@NatElkins NatElkins commented Dec 19, 2025

Summary

Replace individual customer fields with a unified customer object that supports standard fields plus custom fields.

Changes

Before:

{
  customerName: "John",
  customerEmail: "john@example.com",
  customerExternalId: "user_123",
  requireCustomerFields: { customerName: true, customerEmail: true }
}

After:

{
  customer: {
    name: "John",
    email: "john@example.com",
    externalId: "user_123",
    company: "Acme",        // custom field
    plan: "pro"             // custom field
  },
  requireCustomerData: ["email", "name", "company"]
}

Why

  • Flat structure is simpler and more flexible
  • Custom fields are first-class citizens (catchall accepts any string field)
  • requireCustomerData works with both standard and custom fields
  • Empty strings are transformed to undefined for graceful client handling

@martinsaposnic martinsaposnic force-pushed the mdk-280 branch 2 times, most recently from 00cd532 to 0b7afb8 Compare December 30, 2025 20:37
@martinsaposnic martinsaposnic changed the title feat(mdk-280): Add customerMetadata to checkout creation Add customer object to checkout API Dec 30, 2025
Replace individual customer fields (customerName, customerEmail, etc.)
with unified customer object that supports custom fields.

BREAKING CHANGE: customerName, customerEmail, customerExternalId replaced by customer object
@martinsaposnic martinsaposnic marked this pull request as ready for review December 30, 2025 20:39
@martinsaposnic martinsaposnic merged commit 2752f2f into main Dec 30, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants