LPN can be nullable in pre-processing events
by Brian GoodmanTo better support partners, whose LPN formats vary depending on the site receiving the return, we're changing our internal LPN generation to happen only after a site has been assigned to the return line item.
This ensures the LPN format used is the correct one for the site the return line item is graded at. Previously, the LPN was assigned to the return line item when it was created. This meant that the LPN value in webhook payloads was never null, since all webhook events from Two Boxes would trigger after the line item creation point. However going forward, since the LPN won't be assigned until the site is known some events which are triggered prior to this point can have a null LPN value.
How this works:
- An LPN is generated only when the return containing the RLI is first scanned. This assignment happens either during the x-ray scan or when the package is scanned for grading using the grading app.
- Before that first scan, we may not yet know the correct site and generating an LPN too early could lead to an invalid format.
- Once an LPN is created, it is permanent and cannot be cleared or regenerated. Impacted events include: return-initiated
For all post-processing webhook events, the lpn field will always have a value, ensuring downstream systems consistently receive the finalized, site-appropriate LPN.
