Funds

The Fundraise API allows to manage comprehensive fundraising activities by handling funds (base entity for collecting money), campaigns (targeted fundraising initiatives tied to specific funds), pledges (promises for future donations), and actual donations. Create and track multiple fundraising campaigns simultaneously, each connected to one or more funds, while managing incoming donations and pledges.

The Donation object

A donation records an actual monetary contribution to a specific fund, optionally associated with a campaign and potentially fulfilling one or more pledges through the applications array. Each donation tracks its amount, currency, and can be linked to a specific customer, sales channel, and campaign, with optional notes and external references for integration purposes. If a donation fullfils a pledge, it can be linked to the corresponding pledge by pledgeId while creating the donation (The applications will be handled automatically and are not allowed to be set by payload).

Required attributes

  • Name
    _id
    Type
    string
    Description

    The ID of the Donation

  • Name
    amount
    Type
    number
    Description

    The amount of the donation

  • Name
    currency
    Type
    enum(EUR, USD, GBP, AUD, CHF, THB, ILS, COP, MXN, DKK, NOK, SEK, QAR, CAD, ISK, GTQ, INR, DOP, SGD, PLN, SAR, TTD, ZAR, KYD, HKD, CZK, KRW, JPY, NZD, AED, MAD, TWD, BRL, BWP, NAD, KES, SCR, TRY, SZL, LSL, TZS, UGX, ZMW, ZWG, GHS, NGN, SLE, LRD, XOF, XAF, GEL, IDR, ARS, CRC, HUF, EGP, MYR, VND, PHP)
    Description

    The currency of the donation

  • Name
    customerId
    Type
    string
    Description

    The ID of the customer of the donation

  • Name
    fundId
    Type
    string
    Description

    The ID of the fund of the donation

  • Name
    sellerId
    Type
    string
    Description

    The ID of the seller owning the donation

  • Name
    createdAt
    Type
    string
    Description

    An ISO timestamp indicating when the donation was created.

  • Name
    updatedAt
    Type
    string
    Description

    An ISO timestamp indicating when the donation was updated.

Optional attributes

  • Name
    applications
    Type
    array<object>
    Description

    An array of pledges that have been fulfilled through this donation.

    Required nested attributes (2)
    • Name
      pledgeId
      Type
      string
      Description

      The ID of the pledge that was fulfilled through this donation.

    • Name
      amount
      Type
      number
      Description

      The amount of the donation that was applied to the pledge.

  • Name
    campaignId
    Type
    string
    Description

    The ID of the campaign of the donation

  • Name
    salesChannelId
    Type
    string
    Description

    The ID of the sales channel of the donation

  • Name
    notes
    Type
    string
    Description

    The notes of the donation

  • Name
    externalId
    Type
    string
    Description

    The external ID of the donation

  • Name
    cartItemId
    Type
    string
    Description

    The ID of the cart item from which the donation created

  • Name
    appliedAt
    Type
    string
    Description

    An ISO timestamp indicating when the donation was applied. (esp. helpful for donations from external integrations)

Example

{
  "_id": "507f191e810c19729de860ea",
  "amount": 10.5,
  "currency": "EUR",
  "customerId": "507f191e810c19729de860ea",
  "fundId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "applications": [
    {
      "pledgeId": "507f191e810c19729de860ea",
      "amount": 10.5
    }
  ],
  "campaignId": "507f191e810c19729de860ea",
  "salesChannelId": "507f191e810c19729de860ea",
  "notes": "string",
  "externalId": "507f191e810c19729de860ea",
  "cartItemId": "507f191e810c19729de860ea",
  "appliedAt": "2030-01-23T23:00:00.123Z"
}

POST/api/fundraise/donations

Create a Donation

Create a Donation

Payload

Required attributes

  • Name
    amount
    Type
    number
    Description

    The amount of the donation

  • Name
    fundId
    Type
    string
    Description

    The ID of the fund of the donation

  • Name
    customerId
    Type
    string
    Description

    The ID of the customer of the donation

Optional attributes

  • Name
    campaignId
    Type
    string
    Description

    The ID of the campaign of the donation

  • Name
    salesChannelId
    Type
    string
    Description

    The ID of the sales channel of the donation

  • Name
    notes
    Type
    string
    Description

    The notes of the donation

  • Name
    externalId
    Type
    string
    Description

    The external ID of the donation

  • Name
    appliedAt
    Type
    string
    Description

    An ISO timestamp indicating when the donation was applied. (esp. helpful for donations from external integrations)

  • Name
    pledgeId
    Type
    string
    Description

    The ID of the pledge that will fulfill (partly or fully) through this donation.

Request

POST
/api/fundraise/donations
const response = await fetch('https://vivenu.com/api/fundraise/donations', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "amount": 10.5,
    "fundId": "507f191e810c19729de860ea",
    "customerId": "507f191e810c19729de860ea",
    "campaignId": "507f191e810c19729de860ea",
    "salesChannelId": "507f191e810c19729de860ea",
    "notes": "string",
    "externalId": "507f191e810c19729de860ea",
    "appliedAt": "2030-01-23T23:00:00.123Z",
    "pledgeId": "507f191e810c19729de860ea"
  }),
})

const data = await response.json()

Response (201)

{
  "_id": "507f191e810c19729de860ea",
  "amount": 10.5,
  "currency": "EUR",
  "customerId": "507f191e810c19729de860ea",
  "fundId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "applications": [
    {
      "pledgeId": "507f191e810c19729de860ea",
      "amount": 10.5
    }
  ],
  "campaignId": "507f191e810c19729de860ea",
  "salesChannelId": "507f191e810c19729de860ea",
  "notes": "string",
  "externalId": "507f191e810c19729de860ea",
  "cartItemId": "507f191e810c19729de860ea",
  "appliedAt": "2030-01-23T23:00:00.123Z"
}

GET/api/fundraise/donations/:id

Get a Donation

Get a Donation

Request

GET
/api/fundraise/donations/:id
const response = await fetch('https://vivenu.com/api/fundraise/donations/507f191e810c19729de860ea', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "amount": 10.5,
  "currency": "EUR",
  "customerId": "507f191e810c19729de860ea",
  "fundId": "507f191e810c19729de860ea",
  "sellerId": "507f191e810c19729de860ea",
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z",
  "applications": [
    {
      "pledgeId": "507f191e810c19729de860ea",
      "amount": 10.5
    }
  ],
  "campaignId": "507f191e810c19729de860ea",
  "salesChannelId": "507f191e810c19729de860ea",
  "notes": "string",
  "externalId": "507f191e810c19729de860ea",
  "cartItemId": "507f191e810c19729de860ea",
  "appliedAt": "2030-01-23T23:00:00.123Z"
}

Was this page helpful?