What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Apply a discount code to checkout via API

Solved

Apply a discount code to checkout via API

adityamertia
Visitor
2 0 1

Hello,

 

We are generating discount codes for users from API and want to apply this discount code to the currently active checkout object of the user using an API. If a discount code is already applied to the checkout then remove and apply the one specified in the API. Which API can help to achieve this?

 

Thanks

Aditya

Accepted Solution (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Depending on how you have things set up checkoutDiscountCodeApplyV2 and checkoutDiscountCodeRemove may do what you need.

View solution in original post

Reply 1 (1)

c10s
Shopify Partner
67 12 27

This is an accepted solution.

Depending on how you have things set up checkoutDiscountCodeApplyV2 and checkoutDiscountCodeRemove may do what you need.