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": "7y9-oV41A",
"billing": {
"address": {
"_id": "bd427a2aedee4175996d794f",
"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": "rdq-fCnxR",
"value": "value",
"redeemType": "redeemType"
}
},
"shipping": {
"method": "method",
"address": {
"_id": "454651cd3f2cde7628f52a1e",
"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": "84d83332839112d06ef32da1",
"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": "cb6860586ab3d088cd183df6",
"id": "XLI-2WBru",
"configRef": "9504db6ca3fafa37f12219ab",
"origin": "example",
"created": 1715705638233,
"shipping": {
"status": "example",
"date": 1754357641385,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": "example"
},
"billing": {
"status": "example",
"paymentDate": 1720423059459,
"refundDate": 1747175825833
},
"orderId": "example",
"note": {
"date": 1775500765546,
"content": "example"
},
"items": [
{
"_id": "4f4952217402ae9c4ab8f866",
"id": "65l-Nqlvd",
"quantity": 1.23,
"added": 1755434891479,
"total": 29.99,
"unavailable": true
}
],
"buyer": {
"_id": "67e06029f073fdc05bb16e28",
"email": "email@example.com",
"firstName": "example",
"id": 1.23,
"lastName": "example",
"name": "example",
"telephone": "example",
"organisation": "example",
"taxNumber": "example",
"isGuest": true
},
"seller": {
"_id": "de9c7faf82eaa0316f688b9c",
"id": "pqd-le5SL",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"telephone": "example",
"taxNumber": "example"
},
"updated": 1762775900505,
"expires": 1752899230479,
"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