This documentation relates to CiviCRM version 3.2. It's not maintained anymore.
Current version of documentation.

Contribution APIs

Skip to end of metadata
Go to start of metadata

This page refers to outdated version of CiviCRM. Check current version of documentation.


Documentation Search


CiviCRM 3.2 Documentation

Support and Participation

Developer Resources


CiviCRM book!

Make sure to check out Understanding CiviCRM as well! You can also support this project by ordering a hard copy.

Contribution APIs

civicrm_contribution_add( &$params )

Availability: v1.8

Add or update the contribution

Parameters:

  • 'params' (array) array of name-value for contribution
  • for updating contribution record pass contribution id in array like $params['id']

Returns:

  • (array) id of created/updated contribution on success, error message otherwise
Creating a Contribution
Result

civicrm_contribution_get( $params )

Availability: v1.8

Retrieve a specific contribution, given a set of input params
If more than one contribution exists, return an error, unless the client has requested to return the first found contact (set 'returnFirst' to true in $params array)
If you want to particular return properties rather than default return properties, pass 'return.propertyname => 1' in params array

Parameters:

  • 'params' (array) Array of name-value for contribution

Returns:

  • array of contribution values
    Get a Contribution
    Result

civicrm_contribution_delete( $params )

Availability: v1.8

Delete a specified contribution.

Parameters:

  • Array containing contribution_id

Returns:

  • success message if successful, error message otherwise
    Delete Contribution
Result

civicrm_contribution_search( $params )

Availability: v1.8

Retrieve a set of contributions, given a set of input params
You can optionally put sort, offset, rowCount in params array
The rowCount parameter is set to 25 by default, so if you want the possibility of more than 25 Contributions to be returned by this function, you have to set this parameter
If you want particular return properties rather than default return properties, pass 'return.propertyname => 1' in params array

Parameters:

  • 'params' (array) input parameters for search.

Returns:

  • Array of all found contributions
    Contribution Search
    Result
  • If empty array is passed to the function
    Default Contribution Search
Result
Labels
  • None

Creative Commons License
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-Share Alike 3.0 United States Licence.