Cart Attributes Disappearing from Checkout After Partial Payment and Email Send

Issue

My app successfully adds cart attributes to orders. These attributes appear correctly in the order page under “Notes”:

However, when an order is partially paid and the merchant sends an email to the customer, the cart attributes disappear from the checkout. While attributes remain visible in the admin order notes, they are no longer present in the customer-facing checkout and in Shopify functions:

Expected Behavior

Cart attributes should persist throughout the entire checkout and payment process, regardless of partial payments or email communications.

Actual Behavior

Cart attributes are lost from the checkout after:

  • An order is partially paid.
  • The merchant sends an email to the customer.

Steps to Reproduce

  1. Create an order with cart attributes (it works with both private and public attributes)
  2. Verify attributes appear in order notes (admin).
  3. Process a partial payment on the order.
  4. Send an email to the customer from the order page.
  5. Customer accesses checkout; cart attributes are missing.

Questions

  1. Is this expected behavior or a bug?
  2. Are cart attributes supposed to persist through partial payment flows?
  3. Is there a recommended approach to maintain these attributes throughout the checkout lifecycle?

Threads reporting same problem:

Hey @David_Arbias :waving_hand: - just confirming my understanding here. The initial cart is successfully converted into a order, but the order is just marked as partially paid and the attributes appear correctly on the created order?

If so, that is expected behaviour, carts usually are deleted after they’re converted into an order. Just out of curiosity, are you still able to access the original carts after they’ve been converted into a partially paid order? Essentially, if a partially paid order is created from a cart, we do consider that cart’s journey as completed. So, if a customer is returning back to the checkout to pay the rest of their invoice, this is technically considered a “new” checkout, even if it originated from an old cart.

Hope this helps/makes sense - let me know if I can clarify anything or if I’m misunderstanding here, happy to help!

It is possible to access a cart in shopify functions after the order has been partially paid, but all of the original cart and line item attributes get removed.

This greatly reduces what you can do in for example payment functions, because you can’t access information about the order, since shopify functions are intended to actually run during the cart phase.

We’re trying to solve this using customer metafields, but this is not a good solution since customers may have more than one partially paid order.

Hey @David_Arbias, thanks for the follow-up.

Unfortunately this is expected behaviour based on how the partial payment flow works. When the original cart converts into an order (even a partially paid one), that cart’s lifecycle is considered complete. When the customer comes back to pay the rest, they’re entering a fresh checkout context rather than continuing the original cart/checkout session, which is why the attributes aren’t there for your payment function to read there.

Shopify Functions are really designed to operate during that initial phase, so they don’t have an easy way to pull in data from an already-created order. It’s definitely a limitation for use cases like yours.

The workarounds aren’t ideal for sure, but customer metafields are a decent idea though, and might work depending on your setup.

Before I dig into the specifics of how we can structure that though, just a couple quick questions:

  1. How common is it for a single customer to have multiple partially paid orders at once? If it’s rare or basically never happens, the implementation is pretty straightforward – just store the attributes directly on the customer metafield and clear them when the order is fully paid. If it’s common though, we’d need to key the data by order ID, and the tricky part is that the payment function during return-to-pay doesn’t really have order context to do that lookup which you mentioned earlier

  2. What is your payment function actually trying to do with these attributes? Understanding the end goal might help us figure out if there’s a different approach that sidesteps this limitation entirely.

Hope to hear from you soon, happy to look into this further.

  1. I’ve spoke with the merchant facing this issue and it seems he’s ok with customer tags since it’s really rare that a customer will have more than one partially paid order at the same time.

  2. I’ve asked permission to share more details, but unfortunately they denied it :frowning:

Hey @David_Arbias :waving_hand: - thanks for circling back.

Glad the customer tags approach will work for this merchant’s use case.

I’ll make sure this feedback gets logged - the fact that original cart info doesn’t carry over when a customer returns to finish paying is worth having on our radar.

Let me know if anything else comes up - happy to help!

1 Like