Skip to content

Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling#538

Merged
kieran-osgood-shopify merged 1 commit intomainfrom
cx-migrate-accelerated-checkout-2025-07
Mar 27, 2026
Merged

Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling#538
kieran-osgood-shopify merged 1 commit intomainfrom
cx-migrate-accelerated-checkout-2025-07

Conversation

@kieran-osgood-shopify
Copy link
Copy Markdown
Contributor

@kieran-osgood-shopify kieran-osgood-shopify commented Mar 20, 2026

Summary

  • Bump Storefront API usage to 2025-07
  • apply existing cartSubmitForCompletion error mapping on cartPrepareForCompletion

Why

Storefront API 2025-04 is deprecated next months
Traffic will then re-route to 2025-07
2025-07 contains breaking changes in behaviour, where 'userErrors' previously surfaced in cartSubitForCompletion, during didAuthorize they will now surface during cartPrepareForCompletion

How

  1. I changed the control flow in cartPrepareForCompletion so that it would no longer throw a generic error when userErrors are returned.
  2. I extended ErrorHandler to handle prepare for completion responses
  3. Added violations filter via ErrorHandler.filterApplePayResolvableViolations - I intend to refactor this area in future to make it clearer but the intent here is that violations that can be resolved in the sheet will not cause an action .interrupt.

@kieran-osgood-shopify kieran-osgood-shopify requested a review from a team as a code owner March 20, 2026 14:23
@kieran-osgood-shopify kieran-osgood-shopify changed the title Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling [Draft] Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling Mar 20, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 4b6378a to d47ce44 Compare March 20, 2026 18:07
Copy link
Copy Markdown
Contributor Author

kieran-osgood-shopify commented Mar 23, 2026

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch 8 times, most recently from 71cede9 to 9967300 Compare March 24, 2026 16:12
@kieran-osgood-shopify kieran-osgood-shopify changed the title [Draft] Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling Migrate Accelerated Checkout to Storefront API 2025-07; unify cart completion errors & prepare-stage handling Mar 24, 2026
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 9967300 to 524ce92 Compare March 24, 2026 16:18
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from main to graphite-base/538 March 24, 2026 17:40
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 524ce92 to 37a7c0e Compare March 24, 2026 17:41
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from graphite-base/538 to kieran-osgood/03-24-fixcirunningoldswiftdoesntmatchconcurrencywarnings March 24, 2026 17:41
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/03-24-fixcirunningoldswiftdoesntmatchconcurrencywarnings branch from 78098e2 to ff03083 Compare March 24, 2026 17:43
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch 2 times, most recently from cf8ce1b to ac8be1b Compare March 25, 2026 09:55
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/03-24-fixcirunningoldswiftdoesntmatchconcurrencywarnings branch from ff03083 to 5123e02 Compare March 25, 2026 09:55
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from ac8be1b to ace8ef8 Compare March 25, 2026 10:03
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the kieran-osgood/03-24-fixcirunningoldswiftdoesntmatchconcurrencywarnings branch from 5123e02 to 8269be8 Compare March 25, 2026 10:03
@kieran-osgood-shopify kieran-osgood-shopify changed the base branch from kieran-osgood/03-24-fixcirunningoldswiftdoesntmatchconcurrencywarnings to graphite-base/538 March 25, 2026 10:56
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from ace8ef8 to 5c0c208 Compare March 25, 2026 10:56
@graphite-app graphite-app bot changed the base branch from graphite-base/538 to main March 25, 2026 10:57
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 5c0c208 to 248488f Compare March 25, 2026 10:57
// If the only error is paymentsUnacceptablePaymentAmount, return it
// MARK: - Helpers

private static let applePayResolvableViolationCodes: Set<StorefrontAPI.CartCompletionErrorCode> = [
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like something we should maintain and share in collab on the backend with wallets on web

let result = try await controller.storefront.cartPrepareForCompletion(id: id)
try setCart(to: result.cart)
return result.cart
} catch let error as StorefrontAPI.Errors {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to catch non-response errors? i.e network timeouts, decode failures etc

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any other error will follow the existing error handling which will be caught and handled in the callsite (those indicate an unexpected error and will abort to checkout kit)

@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 6e79928 to 187eb31 Compare March 26, 2026 17:49
@kieran-osgood-shopify kieran-osgood-shopify force-pushed the cx-migrate-accelerated-checkout-2025-07 branch from 187eb31 to 37178a2 Compare March 26, 2026 17:56
@kieran-osgood-shopify kieran-osgood-shopify merged commit 3c029bc into main Mar 27, 2026
7 of 8 checks passed
@kieran-osgood-shopify kieran-osgood-shopify deleted the cx-migrate-accelerated-checkout-2025-07 branch March 27, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants