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": "YRe-Wy3un",
"buyerRef": "eea6701e01f9f0d3c0ebcf07",
"version": 42
}
Response
{
"checkoutUpdateBuyer": {
"_id": "b03ce7550dda79d46c8c623b",
"id": "XOK-MnrfU",
"version": 42,
"origin": "example",
"created": 1775403438929,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1778013294929,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1780381832732,
"refundDate": 1748384514125
},
"orderId": "example",
"note": {
"date": 1793098089694,
"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": "f85fc4faee1af5f0daa1341a",
"quantity": 1,
"unavailable": true,
"added": 1738893244586
}
],
"buyer": {
"_id": "ef0f811df869ad0388ecc516",
"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": "b32652b185d7ea8e4a59cb6a"
},
"updated": 1789930500853,
"expires": 1748820246909,
"status": "open",
"urls": {
"checkout": "example",
"storefront": "example"
},
"useSingleAddress": true,
"taxProfile": {
"isNationalShipping": true
},
"locationRef": "7c220fe4ca6ecc7b6615c254"
}
}
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. |