Fórum
Ver pergunta

Trigger invoice sending via API   

36 visualizações
0
0

Hello!

We’re looking forward to trigger sending of the invoice to Customer programmatically, via API, after the invoice have been created and communicated.
We’ve discovered in the interface the functionality, where you can send it, but you have to manually provide the address every time.

We couldn’t find any mentioning of this functionality in ROSE API docs.

The question is, how can we trigger automatic sending of an invoice to Customer’s e-mail via API?

Thanks!

Faça login para poder traduzir
Integração
API Endpoints
ROSE
Marcado como spam
Criado há 4 meses e 4 semanas kilobanan
k
kilobanan Iniciante
1 respostas
0
Resposta privada

Hi,

Please excuse us for the delayed response.

When sending a notification to the customer, unless it's a One Time Party, you don't need to provide the e-mail address everytime. If it's a regular customer, the e-mail should be configured in its record for the notification to work properly.

As for sending the notification programmatically via API, you have two options:

  • Print the document (in PDF format) through the following endpoint, then send it to the customer's e-mail with your own template.

    GET /billing/invoices/{id}/print?template={template} 

  • Alternatively, the following endpoints case be used to mimic the same feature you see on the interface. However, these aren't listed in the Rose API documentation.

    First, retrieve the notification resource (which includes ToAddress, Subject, Body, etc) and change any fields to suit your needs. The body field matches the template configured in the document type's notification.

    GET /billing/invoices/{id}/emailInfo

Then, send the e-mail notification:

POST /billing/invoices/{id}/send

For reference, the previous endpoints ({id}/emailInfo and {id}/send) are transversal to any document type supporting notification (e.g. Invoice, Memo, Invoice Receipt, Receipt, Order, Quotations, etc).

Hope this helps.

 

Faça login para poder traduzir
Marcado como spam
Criado há 3 meses e 1 semana miguelpeixoto
miguelpeixoto Iniciante