Skip to content

Add gift card

POST/store/v1/carts/{cart_id}/gift-cards
  • Idempotency-Key supported

Apply a gift card by its code. It pays part (or all) of the cart when checkout starts; see gift_cards and amount_due.

Path parameters

  • cart_idstringrequired

    The cart's ID, like cart_01k8qs5s….

Headers

  • X-Cart-Tokenstringrequired

    The cart's token

  • Idempotency-Keystring

    Send the same key to retry safely: the first answer is replayed for 24 hours.

  • shop-api-versionYYYY-MM

    The version to answer in. Without it, your app’s pinned version, else the newest.

Body

  • codestringrequired

    As printed or typed, with or without dashes.

Returns

200 The updated cart.

Errors

  • 404not_foundNo such cart.
  • 409A payment is in progress, or the cart is completed.
  • 422validation_failedUnknown, used up, expired or disabled card, or too many cards.