Skip to main content

orderAddRefundMethod Mutation

Description​

Adds a refund method to an order. The refund amount is recorded in the order's payment methods. Refunds reduce the total paid amount for the order.

mutation orderAddRefundMethod(
$orderRef: ID!
$orderPaymentMethodInput: OrderPaymentMethodInput!
) {
orderAddRefundMethod(
orderRef: $orderRef
orderPaymentMethodInput: $orderPaymentMethodInput
) {
_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": "516a1be8059eaf26545f0ee6",
"orderPaymentMethodInput": {
"origin": "origin",
"amount": 29.99,
"ref": "749f6f3b3e7b7c01229c33e8",
"intentId": "intentId",
"added": 1747707323230
}
}

Response​

{
"orderAddRefundMethod": {
"_id": "12e52ee53ad52134b5b7d704",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1743344041084,
"modified": 1740227091793,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1755375210059,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1741314033178,
"refundDate": 1789555880865
},
"orderId": "example",
"notes": [
{
"date": 1748039505349,
"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": "bdc3b18d88b7776411241505",
"quantity": 1,
"unavailable": true,
"added": 1733447859325
}
],
"messages": [
{
"_id": "6f6013bee495a866d2beadb0",
"created": 1762991452832,
"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": "9aae551518e50fc916102f11",
"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": 1773327860928,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "075e8e3cd7c574d8d1077d68"
},
"updated": 1760899973408,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "e724b2febb57ed3fb6f80d45",
"id": "example",
"created": 1741271593865,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}

Arguments​

NameTypeDescription
orderRefID!Reference ID of the order to add a refund method to.
orderPaymentMethodInputOrderPaymentMethodInput!Refund method details including origin, amount, optional reference, and date.

Returns​

Order!