Skip to main content

checkoutUpdateGiftCard Mutation

Description​

Applies or removes a gift card payment from the checkout. Only one gift card can be applied at a time.

mutation checkoutUpdateGiftCard(
$checkoutRef: ID!
$voucherRef: ID
$version: Int
) {
checkoutUpdateGiftCard(
checkoutRef: $checkoutRef
voucherRef: $voucherRef
version: $version
) {
_id
id
version
origin
created
shipping {
status
fulfilled
date
method
freeShippingThreshold
tracking
shopCollection
weight
packingSlip
}
billing {
status
fulfilled
paymentDate
refundDate
}
orderId
note {
date
content
}
totals {
subtotal
subtotalBeforeTaxes
tax
grand
leftToPay
itemQuantity
discount
shipping
creditNote
balance
}
items {
_id
quantity
unavailable
added
}
buyer {
_id
firstName
lastName
email
name
path
telephone
organisation
taxNumber
}
seller {
type
name
email
ref
}
updated
expires
status
urls {
checkout
storefront
}
useSingleAddress
taxProfile {
isNationalShipping
}
locationRef
}
}

Variables​

{
"checkoutRef": "78c0f485038c4202f2e422bb",
"voucherRef": "574fcaf25e91cb63813fb81b",
"version": 42
}

Response​

{
"checkoutUpdateGiftCard": {
"_id": "f74a9aa21016d9c6fcb5c48c",
"id": "Vbh-3nKqC",
"version": 42,
"origin": "example",
"created": 1792160166400,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1791342915103,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1745150040659,
"refundDate": 1745663559693
},
"orderId": "example",
"note": {
"date": 1755261663576,
"content": "example"
},
"totals": {
"subtotal": 1.23,
"subtotalBeforeTaxes": 1.23,
"tax": 1.23,
"grand": 1.23,
"leftToPay": 1.23,
"itemQuantity": 1.23,
"discount": 0.1,
"shipping": 1.23,
"creditNote": 1.23,
"balance": 1.23
},
"items": [
{
"_id": "7e553ab61776e97b076639f1",
"quantity": 1,
"unavailable": true,
"added": 1760119089891
}
],
"buyer": {
"_id": "8126bba81b72d2564794f3a6",
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example"
},
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "83f2da1209696f47c574a856"
},
"updated": 1775744840719,
"expires": 1789530015730,
"status": "open",
"urls": {
"checkout": "example",
"storefront": "example"
},
"useSingleAddress": true,
"taxProfile": {
"isNationalShipping": true
},
"locationRef": "d4c4f183044f97c7a3261687"
}
}

Arguments​

NameTypeDescription
checkoutRefID!Reference ID of the checkout to update.
voucherRefIDReference ID of the gift card voucher to apply. If null, removes the current gift card.
versionIntCurrent version number of the checkout for optimistic locking. Prevents conflicts when multiple users edit simultaneously.

Returns​

Checkout!