Skip to main content

checkoutUpdate Mutation

Description

Updates checkout information including billing, shipping, and buyer details.

mutation checkoutUpdate(
$id: String!
$billing: CheckoutBillingInput
$shipping: CheckoutShippingInput
$buyer: CheckoutBuyerInput
$createAccount: Boolean
$useSingleAddress: Boolean
) {
checkoutUpdate(
id: $id
billing: $billing
shipping: $shipping
buyer: $buyer
createAccount: $createAccount
useSingleAddress: $useSingleAddress
) {
_id
id
configRef
origin
created
shipping {
status
date
method
freeShippingThreshold
tracking
shopCollection
weight
}
billing {
status
paymentDate
refundDate
}
orderId
note {
date
content
}
items {
_id
id
quantity
added
total
unavailable
}
buyer {
_id
email
firstName
id
lastName
name
telephone
organisation
taxNumber
isGuest
}
seller {
_id
id
firstName
lastName
name
email
telephone
taxNumber
}
updated
expires
status
message
totals {
grand
leftToPay
discount
itemsQuantity
itemQuantity
subtotal
subtotalBeforeTaxes
shipping
tax
}
urls {
checkout
storefront
}
useSingleAddress
}
}

Variables

{
"id": "NYb-O8WCo",
"billing": {
"address": {
"_id": "b944c621766d432336e76df0",
"description": "A description",
"firstName": "John",
"lastName": "Doe",
"addressLine1": "addressLine1",
"addressLine2": "addressLine2",
"streetNumber": "streetNumber",
"city": "Montreal",
"state": "Quebec",
"stateCode": "stateCode",
"postCode": "postCode",
"country": "Canada",
"alpha2": "alpha2",
"type": "type"
},
"voucher": {
"id": "EHK-AcpnY",
"value": "value",
"redeemType": "redeemType"
}
},
"shipping": {
"method": "method",
"address": {
"_id": "010cdfc2d093d60505e5df93",
"description": "A description",
"firstName": "John",
"lastName": "Doe",
"addressLine1": "addressLine1",
"addressLine2": "addressLine2",
"streetNumber": "streetNumber",
"city": "Montreal",
"state": "Quebec",
"stateCode": "stateCode",
"postCode": "postCode",
"country": "Canada",
"alpha2": "alpha2",
"type": "type"
},
"tracking": "tracking",
"confirmationEmail": {
"recipient": "recipient"
},
"shopCollection": true
},
"buyer": {
"_id": "723fd382cbf2dccb0247ffdb",
"email": "email@example.com",
"firstName": "John",
"id": 30.7,
"lastName": "Doe",
"name": "A name",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber",
"isGuest": true
},
"createAccount": true,
"useSingleAddress": true
}

Response

{
"checkoutUpdate": {
"_id": "38e80a186e4f456cd08a4411",
"id": "Fd4-9mDWF",
"configRef": "80b9bca232b2c73d9364f627",
"origin": "example",
"created": 1749641542743,
"shipping": {
"status": "example",
"date": 1741335264924,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": "example"
},
"billing": {
"status": "example",
"paymentDate": 1735476489672,
"refundDate": 1721355217819
},
"orderId": "example",
"note": {
"date": 1739243044599,
"content": "example"
},
"items": [
{
"_id": "ede7e3996f0b52c53aebb7b1",
"id": "Wgg-PUU36",
"quantity": 1.23,
"added": 1757627511530,
"total": 29.99,
"unavailable": true
}
],
"buyer": {
"_id": "6aa3c658b19cf4f548dd00e5",
"email": "email@example.com",
"firstName": "example",
"id": 1.23,
"lastName": "example",
"name": "example",
"telephone": "example",
"organisation": "example",
"taxNumber": "example",
"isGuest": true
},
"seller": {
"_id": "831af7e4db026fa1221cee45",
"id": "HMY-A3QOE",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"telephone": "example",
"taxNumber": "example"
},
"updated": 1748735241624,
"expires": 1748227335306,
"status": "example",
"message": "example",
"totals": {
"grand": 1.23,
"leftToPay": 1.23,
"discount": 0.1,
"itemsQuantity": 1.23,
"itemQuantity": 42,
"subtotal": 1.23,
"subtotalBeforeTaxes": 1.23,
"shipping": 1.23,
"tax": 1.23
},
"urls": {
"checkout": "example",
"storefront": "example"
},
"useSingleAddress": true
}
}

Arguments

NameTypeDescription
idString!Checkout identifier string.
billingCheckoutBillingInputBilling address and voucher information.
shippingCheckoutShippingInputShipping address and method information.
buyerCheckoutBuyerInputBuyer information.
createAccountBooleanWhether to create a user account for the buyer.
useSingleAddressBooleanWhether to use the same address for billing and shipping.

Returns

Checkout