I can see that the invoices I have created are in the civicrm/custom map as invoiceID.pdf, but how can I link to them using Civicrm api?

  • What do you mean link to them?
    – Xavier
    Feb 11 '16 at 9:02
  • Please update bit more details - like what are you trying to do - do you want to send this Invoice in email ?? Feb 11 '16 at 9:02
  • The invoices have been sent by mail. I want to make a my/invoices page where the current user has a linked list of all the invoices that have been sent to her. Feb 12 '16 at 18:09

Invoices can be send via email or can be downloaded. Both create an activity (of type "Emailed Invoice" or "Downloaded Invoice"). The invoice pdfs are attached to that activity.

When you first get the activity via the API and collect the Activity ID, you can get information about the attachment via the "Attachment-Get" API function, where "entity_table" then should be "civicrm_activity" and "entity_id" should be the activity id.

For example in php:

$result = civicrm_api3('Attachment', 'get', array(
  'sequential' => 1,
  'entity_table' => "civicrm_activity",
  'entity_id' => #activity_id#,

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.