Skip to main content

orderAddVoucher Mutation

Description​

Applies a voucher to an order.

mutation orderAddVoucher($orderRef: ID!, $voucherRef: ID!) {
orderAddVoucher(orderRef: $orderRef, voucherRef: $voucherRef) {
_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": "55abf9b404df0a65877153cf",
"voucherRef": "273e2bbd0b2c66fd2c56fb3e"
}

Response​

{
"orderAddVoucher": {
"_id": "82b47334ede219bde09e5d31",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1781778383192,
"modified": 1755721218898,
"shipping": {
"status": "Pending",
"fulfilled": true,
"date": 1783009174790,
"method": "example",
"freeShippingThreshold": 1.23,
"tracking": "example",
"shopCollection": true,
"weight": 1.23,
"packingSlip": "example"
},
"billing": {
"status": "example",
"fulfilled": true,
"paymentDate": 1771413436411,
"refundDate": 1733856072873
},
"orderId": "example",
"notes": [
{
"date": 1744713166632,
"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": "0a99b7c1943edac6371efef1",
"quantity": 1,
"unavailable": true,
"added": 1794142561566
}
],
"messages": [
{
"_id": "a9bd921216ad305b830c3e07",
"created": 1779180151544,
"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": "8379d768f17bb2d81929594d",
"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": 1793486455659,
"ip": "example"
}
],
"seller": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "04f2918e1ec7ddf57e40e217"
},
"updated": 1772624048613,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"mergeableOrders": [
{
"_id": "2d255e404d47596f1aa8b69e",
"id": "example",
"created": 1743394553348,
"total": 29.99,
"description": "example"
}
],
"path": "/release/1763553751/release-artist-release-name"
}
}

Arguments​

NameTypeDescription
orderRefID!Reference ID of the order.
voucherRefID!Reference ID of the voucher to apply.

Returns​

Order!