sendDebitNoteEmail
Requires permission purchase:debit_note:update.
Emails a debit note to the supplier. A customerEmail you pass (it is the recipient address, here the supplier's) wins; otherwise the supplier's active email contact is used, and with neither the call reports that no address is on file. A failure is returned as success false with a message rather than as an error. A user cannot email a note they cannot open.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation SendDebitNoteEmail($debitNoteId: ID!) {
sendDebitNoteEmail(debitNoteId: $debitNoteId) {
emailActivityId
error
message
messageId
replyToAddress
success
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation SendDebitNoteEmail($debitNoteId: ID!) {\n sendDebitNoteEmail(debitNoteId: $debitNoteId) {\n emailActivityId\n error\n message\n messageId\n replyToAddress\n success\n }\n}",
"variables": {
"debitNoteId": "id"
}
}
EOF
Variables:
{
"debitNoteId": "id"
}
Response:
{
"data": {
"sendDebitNoteEmail": {
"emailActivityId": "string",
"error": "string",
"message": "string",
"messageId": "string",
"replyToAddress": "string",
"success": true
}
}
}
sendDebitNoteEmail(
customerEmail: String
debitNoteId: ID!
): SendEmailResult!
Arguments
sendDebitNoteEmail.customerEmail ● String scalar
The email address to send to. Omit to use the customer on the record.
sendDebitNoteEmail.debitNoteId ● ID! non-null scalar
The ID of the debit note.
Type
SendEmailResult object
The result of sending an email.