Shopify / ui-extensions

MIT License
269 stars 35 forks source link

Post-Purchase API Requests #114

Open gil-- opened 3 years ago

gil-- commented 3 years ago

Please list the related package(s)

argo-post-purchase

If this related to specific APIs or components, please list them here

Post purchase initialPurchase API data

Is your feature request related to a problem? Please describe.

I'm having to call the Shopify checkout API to get all the information I need for eligibility which is causing a major problem:

I can't really cache this information since it's different for every checkout instance.

Describe the changes you are looking for

I am hoping the team might be able to reconsider surfacing additional data points to prevent the need of an API call:

Customer first & last name

Right now I call the customer API to grab the first & last name since I use that to personalize the offer. There's no other way get this information. I wonder if it could be solved by passing in the primary billing address like the checkout extension does: https://github.com/Shopify/argo/blob/main/packages/argo-checkout/src/extension-points/api/standard/index.ts#L262 & https://github.com/Shopify/argo/blob/main/packages/argo-checkout/src/extension-points/api/standard/index.ts#L394

Product Tags & (Vendor/SKU)

Merchants sometimes want to limit post purchase eligibility by the products ordered based on tags and vendor/sku and this isn't surfaced on the Product interface: https://github.com/Shopify/argo/blob/main/packages/argo-post-purchase/src/extension-points/api/post-purchase/post-purchase.ts#L89

Honestly, vendor/sku is less important. Is there no efficient way to pass through the tags? It's such a key component to merchant merchandising efforts.

Subtotal

You're surfacing totalPriceSet (https://github.com/Shopify/argo/blob/main/packages/argo-post-purchase/src/extension-points/api/post-purchase/post-purchase.ts#L67) which is great but can we get a subtotal value that excludes shipping and tax? Given tax and shipping are specific to the customer, some merchants like targeting dollar thresholds based on the subtotal since that's more consistent across customers.

Line Items ID

When successfully applying a changeset, can we get the line item ids returned? It's for internal tracking and to remove if somehow payment is due.

Describe alternatives you’ve considered

Currently calling 1-2 Shopify APIs during the eligibility determination which wasn't a huge issue but is starting to become one with Shop Pay.

Additional context

n/a?

IntegralParts commented 1 year ago

+1 for subtotal. This would make my life easier.

dani-sanomads commented 1 year ago

@gil-- Looks like we are behind in post purchase as compared to the checkout ui extensions. Many components are not working as intended with fewer options.