orderBillingUpdate Mutation
Description
Updates the billing information for an order, including billing address and invoice ID.
mutation orderBillingUpdate(
$orderRef: ID!
$billingAddress: AddressInput
$buyerRef: ID
$invoiceId: String
$buyerDetails: OrderBuyerDetailsInput
$updateCustomer: Boolean
) {
orderBillingUpdate(
orderRef: $orderRef
billingAddress: $billingAddress
buyerRef: $buyerRef
invoiceId: $invoiceId
buyerDetails: $buyerDetails
updateCustomer: $updateCustomer
) {
_id
id
incId
origin
created
modified
shipping {
status
fulfilled
date
method
freeShippingThreshold
tracking
shopCollection
weight
packingSlip
}
billing {
status
fulfilled
paymentDate
refundDate
}
orderId
notes {
date
content
}
instructions
totals {
subtotal
subtotalBeforeTaxes
tax
grand
leftToPay
itemQuantity
discount
shipping
creditNote
balance
}
items {
_id
quantity
unavailable
added
}
messages {
_id
created
subject
message
fromBuyer
flagged
archived
isSystem
content
read
orderId
orderIncId
uri
via
}
buyer {
_id
firstName
lastName
email
name
path
telephone
organisation
taxNumber
}
logs {
action
description
date
ip
}
seller {
type
name
email
ref
}
updated
status
discogsStatus
buyerWasContacted
unreadMessagesCount
mergeableOrders {
_id
id
created
total
description
}
path
}
}
Variables
{
"orderRef": "4bb0033877494ed66db568cf",
"billingAddress": {
"description": "A description",
"addressLine1": "addressLine1",
"addressLine2": "addressLine2",
"streetNumber": 42,
"city": "Montreal",
"state": "Quebec",
"postCode": "postCode",
"alpha2": "alpha2",
"country": "Canada",
"stateCode": "stateCode",
"type": "type",
"geoLoc": {
"type": "type",
"coordinates": [
30.7
]
}
},
"buyerRef": "1e637e3504ed0e14f41baf28",
"invoiceId": "invoiceId",
"buyerDetails": {
"firstName": "John",
"lastName": "Doe",
"email": "email@example.com",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber"
},
"updateCustomer": true
}
Response
{
"orderBillingUpdate": {
"_id": "5c37ac4664235143576ed2eb",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1784251946110,
"modified": 1763649029530,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1787595337753,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1787214442239,
"refundDate": 1787830217047
},
"orderId": "example",
"notes": [
{
"date": 1738966734439,
"content": "example"
}
],
"instructions": "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": "7409b8096f6f56e1eb3050d1",
"quantity": 1,
"unavailable": true,
"added": 1792789751096
}
],
"messages": [
{
"_id": "2d49b29c39b5d50e9b982dda",
"created": 1743991863536,
"subject": "example",
"message": "example",
"fromBuyer": true,
"flagged": true,
"archived": true,
"isSystem": true,
"content": "example",
"read": true,
"orderId": "example",
"orderIncId": 42,
"uri": "https://www.my-common-ground-store.com/release/1763553751/release-artist-release-name",
"via": "example"
}
],
"buyer": {
"_id": "d87e4ad3a2e6b17bbe3ff68f",
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example"
},
"logs": [
{
"action": "example",
"description": "example",
"date": 1778354997231,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "3f34f47f4f3ddd3f091df217"
},
"updated": 1735475217369,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "45b9bd0f1e0d822772511df6",
"id": "example",
"created": 1767007501460,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
orderRef | ID! | Reference ID of the order to update. |
billingAddress | AddressInput | Billing address for the order. If not provided, the billing address remains unchanged. |
buyerRef | ID | Reference ID of the buyer to assign to the order. Pass null to unassign the current buyer. |
invoiceId | String | Custom invoice ID to set on the order's billing. |
buyerDetails | OrderBuyerDetailsInput | Corrected customer details for this order only. The order keeps its own copy of the customer, which is what its invoice is issued to. |
updateCustomer | Boolean | With buyerDetails, also apply the correction to the linked customer record, for future orders. Past orders keep their own copy. |