How to create a checkout with a discount in a single request using client side JS?

ramblinmatt
Tourist
3 0 0

I'm trying to create a checkout with an existing discount in JS on the client. I am currently using the Storefront API, though I would be happy to use an alternate API if it worked.

Currently, I make 2 separate mutations, the first to createCheckout and the second to checkoutDiscountCodeApplyV2. These calls are slow, so I'd prefer to make a single call where I create a checkout with a given discount code.

How can I do this in a single request?

0 Likes