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": "b2ccdcd16c7e80d3f7940199",
"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": "6f6f8bb3b4981c1e2214df2d",
"invoiceId": "invoiceId",
"buyerDetails": {
"firstName": "John",
"lastName": "Doe",
"email": "email@example.com",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber"
},
"updateCustomer": true
}
Response
{
"orderBillingUpdate": {
"_id": "cc7168ab2450f79ae28a62ea",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1739118347524,
"modified": 1766882931543,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1737293131368,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1747026222980,
"refundDate": 1773310481087
},
"orderId": "example",
"notes": [
{
"date": 1787582802358,
"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": "25054107ee82921d4343b59a",
"quantity": 1,
"unavailable": true,
"added": 1741260299195
}
],
"messages": [
{
"_id": "69bd44015946b1ac84e8ccf7",
"created": 1740556266660,
"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": "94d876b6265c7036ca2d8ad5",
"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": 1777133594849,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "584fb8c4ce14b3056001f79c"
},
"updated": 1783724229840,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "44fb18d33ebfc5092916a8e0",
"id": "example",
"created": 1779496591433,
"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. |