Skip to main content

Transactions

Learn how to add, update, and delete Transactions using the Donorfy API.

Cristina Gruita avatar
Written by Cristina Gruita
Updated over 2 months ago

⚠️Important:

Adding a Transaction via the API does not collect a payment from your payment gateway (e.g., Stripe, GoCardless). You must process the payment separately using the gateway’s required method.


Add Transactions

A Transaction in Donorfy contains:

  • One payment

  • One or more allocations

When adding a new Transaction via the API:

  1. A payment and its first allocation are created together.

  2. To add additional allocations, use the AddAllocation method.

Example for Multiple Allocations

If a payment of £20 requires allocations of £15 and £5:

  1. Add a Transaction for £15 using the relevant Product.

  2. Add the £5 allocation using AddAllocation for the same Transaction.

📌 Note:
For Recurring Payment Instructions (RPIs), use the RPI PaymentCollected endpoint:
https://data.donorfy.com/api/v1/<your api key>/rpis/<id>/PaymentCollected


Mandatory and Optional Look-Up Properties

When adding or updating a Transaction, certain fields must reference valid values from your Donorfy settings.

Required Properties

Property

Must Match

Product

A valid Product

Campaign

A valid Campaign

PaymentMethod

A valid Payment Method

Fund

A valid Fund

Optional Properties

Property

Requirement

Channel

Must exist in Channels

Currency

Must exist in Currencies

Department

Must exist in Departments

BankAccount

Must exist in Bank Accounts

Acknowledgement

Must exist in Acknowledgements

GiftAidDeclarationMethod

Required if AddGiftAidDeclaration = true


Constituent Information

When adding a Transaction, you can:

  • Add a new constituent

  • Assign the Transaction to an existing constituent

  • Make the Transaction anonymous by using:
    00000000-0000-0000-0000-000000000000 as ExistingConstituentId

For more detail, see: Linking New Entities to a New or Existing Constituent in the related article.


Gift Aid Options

When adding a Transaction, the API supports the following properties:

Property

Description

CanRecoverTax

If true, the Transaction is eligible for Gift Aid (subject to rules).

GiftAidClaimed

Indicates Gift Aid has already been claimed; Donorfy will not reclaim it.

AddGiftAidDeclaration

Creates a new declaration for a new or existing constituent if one does not already exist.

GiftAidDeclarationMethod

Optional. Defaults to Web if not supplied.


Update Transactions

To update a Transaction:

  1. Pass in the Id of the payment element.

  2. Only single-allocation Transactions can be updated.

  3. If a Transaction has multiple allocations, use allocation-specific endpoints to make adjustments.


Connected Constituents and Beneficiaries

You can specify the ID of a connected constituent or beneficiary when adding or updating a Transaction.

To clear a connected constituent or beneficiary, pass:

00000000-0000-0000-0000-000000000000


Delete Transactions

To delete a Transaction:

  1. Pass the Id of the payment element.

  2. The payment and all associated allocations are deleted.

⚠️Important: The Donorfy API is a Professional only feature. Essential subscribers, please contact us to find out more about upgrading.

Did this answer your question?