From a308aeed6b33bb5687fc7edda71be67c0f84bd09 Mon Sep 17 00:00:00 2001 From: justin Date: Tue, 9 Jun 2026 00:27:17 -0500 Subject: [PATCH] fix(checkout): batch SO custom_order_type must be 'compliance' not 'compliance_batch' ERPNext's PW Order Type select field only allows formation/canada_crtc/bundle/ compliance. A batch is a compliance order (multi-service), so use 'compliance'; the multi-service nature is already captured by the line items + external order id. --- api/src/routes/checkout.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/routes/checkout.ts b/api/src/routes/checkout.ts index 02e0689..a79b748 100644 --- a/api/src/routes/checkout.ts +++ b/api/src/routes/checkout.ts @@ -1013,7 +1013,7 @@ router.post("/api/v1/checkout/create-session", async (req, res) => { customer: erpnextCustomer, delivery_date: new Date(Date.now() + 30 * 86400000).toISOString().split("T")[0], custom_external_order_id: order_id, - custom_order_type: "compliance_batch", + custom_order_type: "compliance", custom_payment_gateway: GATEWAY_LABELS[payment_method] || payment_method, custom_surcharge_pct: surcharge_pct, workflow_state: "Received",