From 680639b5d72ec8f82178f2cd2e9fec3944d0173e Mon Sep 17 00:00:00 2001 From: Akhileshwar Shriram <112577383+AkhilTheBoss@users.noreply.github.com> Date: Sat, 24 Jan 2026 22:57:04 -0800 Subject: [PATCH] fix: max name length for Lulu --- server/api/services/lulu-service.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/api/services/lulu-service.ts b/server/api/services/lulu-service.ts index d03916fc..b308ce1a 100644 --- a/server/api/services/lulu-service.ts +++ b/server/api/services/lulu-service.ts @@ -138,9 +138,18 @@ export default class LuluService { throw new Error("BOOKSTORE_CONTACT_EMAIL environment variable is not set"); } + // Truncate name to 30 characters to meet Lulu's limit + const truncatedParams = { + ...params, + shipping_address: { + ...params.shipping_address, + name: params.shipping_address.name.substring(0, 30) + } + }; + const axiosInstance = await this.getAuthenticatedInstance(); const response = await axiosInstance.post('/print-jobs', { - ...params, + ...truncatedParams, contact_email: process.env.BOOKSTORE_CONTACT_EMAIL, production_delay: 120 }).catch((error) => {