Skip to main content

voucherNoteUpdate Mutation

Description

Updates the note on a voucher. Replaces any existing note with the new note content.

mutation voucherNoteUpdate($voucherRef: ID!, $note: String!) {
voucherNoteUpdate(voucherRef: $voucherRef, note: $note) {
_id
type
id
value
originalValue
redeemType
redeemed
isInRange
singleSpending
unlimited
spendings {
orderId
orderRef
amount
origin
date
}
spendingLimit
startDate
expires
resourcePath
user {
type
name
email
ref
}
created
createdBy {
type
name
email
ref
}
note {
date
content
}
logs {
action
description
date
ip
}
recipients {
recipient
date
}
pdf
}
}

Variables

{
"voucherRef": "e908576a8c5fb47e1d534bc7",
"note": "note"
}

Response

{
"voucherNoteUpdate": {
"_id": "ed5952020541e72a0afafbfd",
"type": "coupon",
"id": "example",
"value": 1.23,
"originalValue": 1.23,
"redeemType": "value",
"redeemed": true,
"isInRange": true,
"singleSpending": true,
"unlimited": true,
"spendings": [
{
"orderId": "example",
"orderRef": "b38b34be2cfd3f6e9b7ef488",
"amount": 29.99,
"origin": "example",
"date": 1764159013344
}
],
"spendingLimit": 42,
"startDate": 1766370521699,
"expires": 1747316226329,
"resourcePath": "example",
"user": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "c2ff6524bb818e45bf197b32"
},
"created": 1749741757658,
"createdBy": {
"type": "example",
"name": "example",
"email": "email@example.com",
"ref": "2606ea0b64c5a33b019ab302"
},
"note": {
"date": 1773903059108,
"content": "example"
},
"logs": [
{
"action": "example",
"description": "example",
"date": 1736237427167,
"ip": "example"
}
],
"recipients": [
{
"recipient": "example",
"date": 1740076278935
}
],
"pdf": "example"
}
}

Arguments

NameTypeDescription
voucherRefID!Reference ID of the voucher to update the note for.
noteString!New note content to set on the voucher.

Returns

Voucher!