Cloud Jasmin Common Use Cases
Common Use Cases
Common Use Cases
Back | List of Articles

How to get a document pdf?

Last changed in 31/08/2022

The cloud products' API allows you to obtain the PDF associated with the various types of documents in the system, whether Purchase Invoices, Sales Invoices, Credit Notes, Journal Entries or Receipts. Two ways to obtain the PDF are available, either by entering the record identifier or the natural key.

To print a document

https://baseurl/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/print

To Reprint a document

https://baseurl/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/printOriginal

To generate a PDF in a language other than the original one, you must specify this in the request header. For example, to reprint in Portuguese a document originally printed in English, use Accept-Language –> pt-PT.

using (HttpClient client = new HttpClient())
{
    try
    {
        Console.WriteLine("Requesting the access token from the authorization server...");

        client.BaseAddress = new Uri(RoseConstants.appBaseUrl);
        client.DefaultRequestHeaders.Add("Accept-Language", "pt-PT");
        
        (...)
        
    }
    catch (Exception ex)
    {
        throw new Exception(string.Format("Error getting token. {0}", ex.Message));
    }
}

Templates

The printing templates allow to define the document layout, so when they are not indicated in the request the default template associated to the entity is always used. To specify the template, you must add the parameter as indicated:

//?template
https://baseural/api/{{tenant}}/{{organization}}/billing/invoices/{{companyKey}}/{documentType}/{serie}/{seriesNumber}/print?template={ReportModelDefinitions}

The following is a list of some available templates for guides, orders and journal entries:

  • Sales_OrderReport
  • Sales_QuotationReport
  • Billing_MaterialsInvoiceReport
  • Billing_MemoReport
  • Billing_ServicesInvoiceReport
  • Billing_MaterialsInvoiceReportTaxExclusive
  • Billing_ServicesInvoiceReportTaxExclusive
  • Purchases_OrderReport
  • InvoiceReceipt_InvoiceReport
  • InvoiceReceipt_MemoReport
  • Shipping_DeliveryReport
  • Shipping_DeliveryReportWithoutPrices
  • GoodsReceipt_GoodsReceiptReport
  • Accounting_JournalEntryReport
Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Como obter uma lista de encomendas? Como criar uma encomenda de vendas? Como obter o pdf de um documento? Como obter uma lista de encomendas? Como criar uma encomenda de vendas?