orderSendInvoiceWithAccountCreation Mutation
Description
Sends an invoice email to the buyer and optionally creates a buyer account if one doesn't exist. If createAccount is true and no buyer account exists for the email, a new account is created. Returns information about the order, buyer, and account creation status.
mutation orderSendInvoiceWithAccountCreation(
$orderRef: ID!
$orderInvoiceInput: OrderInvoiceInput!
$createAccount: Boolean
) {
orderSendInvoiceWithAccountCreation(
orderRef: $orderRef
orderInvoiceInput: $orderInvoiceInput
createAccount: $createAccount
) {
order {
_id
id
incId
origin
created
modified
orderId
instructions
updated
status
discogsStatus
buyerWasContacted
unreadMessagesCount
path
}
buyer {
_id
created
updated
lastLogin
active
birthdate
firstName
lastName
email
name
path
telephone
organisation
taxNumber
accountCreated
notes
orderCount
orderTotal
creditNotesCount
wantsCount
vouchersCount
type
}
accountStatus
}
}
Variables
{
"orderRef": "b97ae1686ec8679abb846776",
"orderInvoiceInput": {
"recipient": "recipient",
"message": "message",
"subject": "subject",
"ccMe": true
},
"createAccount": true
}
Response
{
"orderSendInvoiceWithAccountCreation": {
"order": {
"_id": "500d67042841cc8e97d6caeb",
"id": "example",
"incId": 42,
"origin": "example",
"created": 1740920163804,
"modified": 1707683414326,
"orderId": "example",
"instructions": "example",
"updated": 1738944812872,
"status": "example",
"discogsStatus": "example",
"buyerWasContacted": true,
"unreadMessagesCount": 42,
"path": "/release/1763553751/release-artist-release-name"
},
"buyer": {
"_id": "08012e9551ae72ef30fe114e",
"created": 1752972378360,
"updated": 1707459543078,
"lastLogin": 1745632722298,
"active": true,
"birthdate": 1726820744777,
"firstName": "example",
"lastName": "example",
"email": "email@example.com",
"name": "example",
"path": "/release/1763553751/release-artist-release-name",
"telephone": "example",
"organisation": "example",
"taxNumber": "example",
"accountCreated": true,
"notes": "example",
"orderCount": 42,
"orderTotal": 1.23,
"creditNotesCount": 42,
"wantsCount": 42,
"vouchersCount": 42,
"type": "example"
},
"accountStatus": "CREATED"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
orderRef | ID! | Reference ID of the order to send an invoice for. |
orderInvoiceInput | OrderInvoiceInput! | Invoice email details including recipient, subject, message, and whether to CC the sender. |
createAccount | Boolean | Whether to create a buyer account if one doesn't exist for the invoice recipient email address. |