How to programmatically apply a gift card at checkout?

Topic summary

A developer is trying to programmatically apply a gift card during the Shopify checkout process but is struggling to obtain the necessary checkout ID.

Key Questions:

  • How to retrieve the checkout ID for applying gift cards programmatically
  • Whether webhooks are the only method to obtain the checkout ID
  • If the checkout token available from the frontend corresponds to the checkout ID sent via the checkout create webhook

Current Status:
The discussion remains open with no solutions provided yet. The developer can access the checkout token from the frontend but needs clarification on whether this token matches the ID used in webhook events.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

I can’t figure out how to get the checkout ID to programmatically apply a gift card at checkout. Is the only option to use Webhooks to get the Checkout ID?

I can get the checkout Token from the frontend. Will the same checkout Token be sent along with the Checkout ID when using the webhook for cheakouts/create?