Incorrect Selling Plan Payment Terms

I’ve got a Try Before You Buy (TBYB) app which uses Selling Plans. A new customer of mine recently setup their Selling Plan Group and Selling Plan with a remainingBalanceChargeTimeAfterCheckoutof 30 days.

When I purchase an item from their store using the TBYB option, everything looks correct. However, the order’s Payment Terms that comes in through the orders/create webhook doesn’t match with what they configured.

The Checkout page is correct when placing the order. However, the Confirmation page is a little weird as well.

I’ve noticed this issue happening occasionally for other customers also.

According to Shopify’s dev docs on TBYB :backhand_index_pointing_down:

Shopify creates an order, and then creates the payment term and the fulfillment for the order. Shopify also vaults the payment method.

Hi @chrismgala

What exactly are the differences? Is it only happening for this one store or all that you test?

Hey @Liam-Shopify,

It’s happening consistently for this store and occasionally for others. It’s worth noting that I’m on the 2024-01API version. I’m going through the migration process and am reviewing the Release Notes for newer API versions.

The difference is in the data which comes back in this field:
order > paymentTerms > paymentSchedules > dueAt

Based on the setup of the Selling Plan Billing Policy via remainingBalanceChargeTimeAfterCheckout, there should be an appropriate amount of days added to the dueAt field.

This merchant should have a remainingBalanceChargeTimeAfterCheckout of 30 days. This means the dueAt field for an order on October 1st should be October 31st. However, the dueAt keeps coming back as the same day the order was placed. It’s causing their customers’ orders to process way earlier than the stated date during checkout (see screenshot).

Turns out this was due to my ignorance on multiple payment schedules and our codebase defaulting to the first one. If there’s any kind of prepay or mixed bag order with non-TBYB items, there’s multiple payment schedules. The first one had the “wrong” due date and was affecting a small portion of orders.