Follett Hub

Shopify Operations
AskBrowse

Church Hill Classics DSV Integration

v1Updated May 19, 2026SOP

Church Hill Classics DSV Integration - Shopify EDI Processor Changes

Summary

The Shopify EDI processor (P3-EDI-Processor) was modified to support Church Hill Classics (vendor code CHR) as a DSV trading partner. The single material change is a new vendor-specific PO number format. No changes were required on the inbound 855/856/810 parsing side; round-trip lookup continues to use the existing OrderShopMapping table.

New DSV PO Number Format for Church Hill

Format: 10 numeric digits, no letters, no separators.

Construction:

  • Take the customer-facing Shopify order name (the number after the #, e.g. #18071155 -> 18071155).
  • Reduce it to a 9-digit base:
    • If shorter than 9 digits, left-pad with zeros.
    • If longer than 9 digits, take the rightmost 9 digits (preserves the most recent entropy).
  • Append a 1-digit vendor-group suffix (defaults to 1; increments when an order splits across multiple vendors). Suffixes greater than 9 are clamped to 9; in practice splits never exceed 9 vendor groups.
  • Concatenate base + suffix = 10-digit PO.

Worked examples:

Shopify order nameVendor groupCHR PO
#1807115510180711551
#1807115520180711552
#123456710012345671
#123456789012345678901

For comparison, the default PO format (used by all other DSV vendors) is E{shopifyOrderId}-{groupIndex} (e.g. E6373785665721-1), capped at 16 characters.

Design Changes in the Codebase

  1. Vendor allowlist for numeric-only POs. A new constant NUMERIC_PO_VENDORS (a Set keyed by vendor supplierId) was added to the central PO-builder module. CHR is currently the only member. Adding another numeric-PO vendor in the future is a one-line addition.

  2. Vendor-aware PO builder. The existing buildPONumber() function now accepts an optional { orderName, vendorCode } context. When the vendor matches the allowlist, it routes to a new buildNumericPONumber() helper that produces the 10-digit format; for all other vendors the existing E-prefix (or D-prefix) behavior is preserved verbatim. Non-CHR PO output is byte-for-byte unchanged.

  3. Vendor + order-name plumbed through the 850 pipeline. Both 850 entry points pass the new context through:

    • The OMS 850 generator (the fixed-width file format Church Hill consumes), which previously rebuilt the PO internally without vendor awareness. The generator now reads vendor code from data.vendor.tpCode and order name from data.header.webOrderNumber and forwards them to the PO builder.
    • The EDI 850 (X12) generator path, for consistency, even though Church Hill primarily consumes the OMS format.
  4. OMS 850 fixed-width record unchanged. Church Hill's file layout (HDR/BIT/SHT/SOT/RET/DTL lines, byte positions) is unchanged. Only the value written to HDR positions 12-33 (the PO field, 22 chars total) is shorter; the 10-character PO is right-padded with spaces so every downstream column still starts at its original byte offset.

  5. SFTP filename format unchanged. Files continue to follow the 850oms.CRH.{PO}.{date}.txt pattern; the new PO simply slots into the PO segment.