sendCreditNoteEmail
Requires permission sales:credit_note:update.
Emails a credit note to the customer. A customerEmail you pass wins; otherwise the customer's email on record is used. 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 SendCreditNoteEmail($creditNoteId: ID!) {
sendCreditNoteEmail(creditNoteId: $creditNoteId) {
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 SendCreditNoteEmail($creditNoteId: ID!) {\n sendCreditNoteEmail(creditNoteId: $creditNoteId) {\n emailActivityId\n error\n message\n messageId\n replyToAddress\n success\n }\n}",
"variables": {
"creditNoteId": "id"
}
}
EOF
Variables:
{
"creditNoteId": "id"
}
Response:
{
"data": {
"sendCreditNoteEmail": {
"emailActivityId": "string",
"error": "string",
"message": "string",
"messageId": "string",
"replyToAddress": "string",
"success": true
}
}
}
sendCreditNoteEmail(
creditNoteId: ID!
customerEmail: String
): SendEmailResult!
Arguments
sendCreditNoteEmail.creditNoteId ● ID! non-null scalar
The ID of the credit note.
sendCreditNoteEmail.customerEmail ● String scalar
The email address to send to. Omit to use the customer on the record.
Type
SendEmailResult object
The result of sending an email.