checkoutUpdateBuyer Mutation
Description
Updates or removes the buyer associated with the checkout. If buyerRef is provided, updates buyer information and shipping address. If null, removes the buyer.
mutation checkoutUpdateBuyer($id: String!, $buyerRef: ID, $version: Int) {
checkoutUpdateBuyer(id: $id, buyerRef: $buyerRef, 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
{
"id": "CxI-8IgEJ",
"buyerRef": "9f3b634438998f64430141ff",
"version": 42
}
Response
{
"checkoutUpdateBuyer": {
"_id": "3afa8e056a004c596536e180",
"id": "QOa-x4poT",
"version": 42,
"origin": "example",
"created": 1791657252365,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1791421054620,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1752631934360,
"refundDate": 1748760409435
},
"orderId": "example",
"note": {
"date": 1786508197188,
"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": "3b507ceda0dade0e46afd3b2",
"quantity": 1,
"unavailable": true,
"added": 1737378768411
}
],
"buyer": {
"_id": "933eeb34442ae5415a1913d5",
"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": "a30944caa23a5d800335fa93"
},
"updated": 1773988511522,
"expires": 1781715237281,
"status": "open",
"urls": {
"checkout": "example",
"storefront": "example"
},
"useSingleAddress": true,
"taxProfile": {
"isNationalShipping": true
},
"locationRef": "5e84a72b4f23946e2ee7371b"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
id | String! | String identifier of the checkout. |
buyerRef | ID | Reference ID of the buyer to associate with the checkout. If null, removes the current buyer. |
version | Int | Current version number of the checkout for optimistic locking. Prevents conflicts when multiple users edit simultaneously. |