Is it possible to retrieve amounts on a contribution page via API only?

I can retrieve the details of a CiviCRM Contribution Page via API.

cv api ContributionPage.get id=1

A missing detail I'd like in this result is the amounts which appear on the contribution page / membership form / event registration etc.

I can retrieve PriceSet and PriceField information via API, and this permits me to filter by the type of entity that PriceSet is associated with - but not the specific entity by ID.

cv api PriceSet.get extends=CiviContribute

In the PriceSet results, there's data available which would let me filter the results after retrieval, but I'm looking for a means to get the data by the most direct route.

I see there's a method used internally to retrieve pricesets associated with a specific contribution page entity, ex:

CRM_Price_BAO_PriceSet::getFor('civicrm_contribution_page', 1));

Your Answer

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

Browse other questions tagged or ask your own question.