Skip to main content

Email Invoice PDF API

POST /emailInvoicePDF

Description

This API endpoint sends an invoice PDF to specified email addresses. It is used to distribute invoices electronically.

Request Body

The request utilizes GraphQL to perform the emailInvoicePDF mutation.

Mutation:

mutation emailInvoicePDF ($invoicePdf: InvoicePDF) {
emailInvoicePDF (invoicePdf: $invoicePdf)
}

Variables:

{
"invoicePdf": {
"invoiceId": <Invoice_Id>,
"emailsToSend": [
"<Email_Address>"
]
}
}
  • invoiceId (Int): The ID of the invoice whose PDF is to be sent.
  • emailsToSend (Array of Strings): A list of email addresses to which the invoice PDF will be sent.

Response:

  • Success (200 OK):

    • If the email is successfully sent, the response will indicate that the process was successful.
    {
    "data": {
    "emailInvoicePDF": null
    }
    }
  • Error (4XX/5XX):

    • If there is an issue with sending the invoice PDF, the response will include an appropriate error message and status code.

Note:

Ensure that the invoiceId is valid and that the email addresses are correctly formatted. This API will send the specified invoice PDF to the provided list of email addresses.