Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update Store SDK zod schemas

Damian Legawiec601cb1ee1727
diff --git a/packages/sdk/.changeset/zod-schema-customer-payment-method-fields.md b/packages/sdk/.changeset/zod-schema-customer-payment-method-fields.md
new file mode 100644
index 0000000000..5c9f83436b
--- /dev/null
+++ b/packages/sdk/.changeset/zod-schema-customer-payment-method-fields.md
@@ -0,0 +1,10 @@
+---
+'@spree/sdk': minor
+---
+
+Sync Zod schemas with TypeScript types for `Customer` and `PaymentMethod`.
+
+- `CustomerSchema` now includes `full_name: string` (already present in the `Customer` type since the Admin Customers API landed; the runtime schema was stale).
+- `PaymentMethodSchema` now includes `source_required: boolean` (already present in the `PaymentMethod` type).
+
+No source-API change — this only affects callers using `CustomerSchema` / `PaymentMethodSchema` for runtime validation (e.g., `CustomerSchema.parse(response)`). Validation no longer rejects these fields and parsed values are correctly typed.
diff --git a/packages/sdk/src/zod/generated/CustomField.ts b/packages/sdk/src/zod/generated/CustomField.ts
index 736fc80f1e..904bf871b5 100644
--- a/packages/sdk/src/zod/generated/CustomField.ts
+++ b/packages/sdk/src/zod/generated/CustomField.ts
@@ -5,8 +5,8 @@ export const CustomFieldSchema = z.object({
id: z.string(),
label: z.string(),
type: z.string(),
+ field_type: z.string(),
key: z.string(),
- field_type: z.any(),
value: z.any(),
});
diff --git a/packages/sdk/src/zod/generated/Customer.ts b/packages/sdk/src/zod/generated/Customer.ts
index f3cc45cda4..b081794362 100644
--- a/packages/sdk/src/zod/generated/Customer.ts
+++ b/packages/sdk/src/zod/generated/Customer.ts
@@ -9,6 +9,7 @@ export const CustomerSchema = z.object({
last_name: z.string().nullable(),
phone: z.string().nullable(),
accepts_email_marketing: z.boolean(),
+ full_name: z.string(),
available_store_credit_total: z.string(),
display_available_store_credit_total: z.string(),
addresses: z.array(AddressSchema),
diff --git a/packages/sdk/src/zod/generated/PaymentMethod.ts b/packages/sdk/src/zod/generated/PaymentMethod.ts
index a95aaf5b0c..c3bb59f082 100644
--- a/packages/sdk/src/zod/generated/PaymentMethod.ts
+++ b/packages/sdk/src/zod/generated/PaymentMethod.ts
@@ -7,6 +7,7 @@ export const PaymentMethodSchema = z.object({
description: z.string().nullable(),
type: z.string(),
session_required: z.boolean(),
+ source_required: z.boolean(),
});
export type PaymentMethod = z.infer<typeof PaymentMethodSchema>;