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 Campaign object

A campaign represents a targeted fundraising initiative that can be linked to multiple funds, allowing organizations to run specific fundraising drives with optional financial targets and deadlines. Each campaign can be associated with a fund, enabling organizations to track and manage multiple fundraising efforts across different funds simultaneously.

Required attributes

  • Name
    _id
    Type
    string
    Description

    The ID of the marketing campaign

  • Name
    name
    Type
    string
    Description

    The name of the marketing campaign

  • Name
    code
    Type
    string
    Description

    The code of the marketing campaign

  • Name
    createdBy
    Type
    object
    Description

    The entity that created this marketing campaign

    Required nested attributes (2)
    • Name
      type
      Type
      enum(USER, APP, API_KEY, SYSTEM)
      Description

      The type of the entity

    • Name
      id
      Type
      string
      Description

      The ID of the entity

  • Name
    sellerId
    Type
    string
    Description

    The ID of the seller owning the marketing campaign

  • Name
    isArchived
    Type
    boolean
    Description

    Whether the marketing campaign is archived or not.

  • Name
    createdAt
    Type
    string
    Description

    An ISO timestamp indicating when the marketing campaign was created.

  • Name
    updatedAt
    Type
    string
    Description

    An ISO timestamp indicating when the marketing campaign was updated.

Example

{
  "_id": "507f191e810c19729de860ea",
  "name": "Example Name",
  "code": "string",
  "createdBy": {
    "type": "USER",
    "id": "507f191e810c19729de860ea"
  },
  "sellerId": "507f191e810c19729de860ea",
  "isArchived": false,
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z"
}

POST/api/fundraise/campaigns

Create a Campaign

Create a Campaign

Payload

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the campaign

Optional attributes

  • Name
    target
    Type
    object
    Description

    The target (goal) amount and date of the campaign

    Optional nested attributes (2)
    • Name
      amount
      Type
      number
      Description

      The target amount of the campaign

    • Name
      date
      Type
      string
      Description

      An ISO timestamp indicating when the campaign is planned to reach the goal (amount).

  • Name
    externalId
    Type
    string
    Description

    The external ID of the campaign

Request

POST
/api/fundraise/campaigns
const response = await fetch('https://vivenu.com/api/fundraise/campaigns', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "name": "Example Name",
    "target": {
      "amount": 10.5,
      "date": "2030-01-23T23:00:00.123Z"
    },
    "externalId": "507f191e810c19729de860ea"
  }),
})

const data = await response.json()

Response (201)

{
  "_id": "507f191e810c19729de860ea",
  "name": "Example Name",
  "code": "string",
  "createdBy": {
    "type": "USER",
    "id": "507f191e810c19729de860ea"
  },
  "sellerId": "507f191e810c19729de860ea",
  "isArchived": false,
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z"
}

PUT/api/fundraise/campaigns/:id

Update a Campaign

Update a Campaign

Payload

Optional attributes

  • Name
    name
    Type
    string
    Description

    The name of the campaign

  • Name
    target
    Type
    object
    Description

    The target (goal) amount and date of the campaign

    Optional nested attributes (2)
    • Name
      amount
      Type
      number
      Description

      The target amount of the campaign

    • Name
      date
      Type
      string
      Description

      An ISO timestamp indicating when the campaign is planned to reach the goal (amount).

  • Name
    externalId
    Type
    string
    Description

    The external ID of the campaign

Request

PUT
/api/fundraise/campaigns/:id
const response = await fetch('https://vivenu.com/api/fundraise/campaigns/507f191e810c19729de860ea', {
  method: 'PUT',
  headers: {
    Authorization: 'Bearer {token}',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(  {
    "name": "Example Name",
    "target": {
      "amount": 10.5,
      "date": "2030-01-23T23:00:00.123Z"
    },
    "externalId": "507f191e810c19729de860ea"
  }),
})

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "name": "Example Name",
  "code": "string",
  "createdBy": {
    "type": "USER",
    "id": "507f191e810c19729de860ea"
  },
  "sellerId": "507f191e810c19729de860ea",
  "isArchived": false,
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z"
}

GET/api/fundraise/campaigns/:id

Get a Campaign

Get a Campaign

Request

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

const data = await response.json()

Response (200)

{
  "_id": "507f191e810c19729de860ea",
  "name": "Example Name",
  "code": "string",
  "createdBy": {
    "type": "USER",
    "id": "507f191e810c19729de860ea"
  },
  "sellerId": "507f191e810c19729de860ea",
  "isArchived": false,
  "createdAt": "2030-01-23T23:00:00.123Z",
  "updatedAt": "2030-01-23T23:00:00.123Z"
}

GET/api/fundraise/campaigns

Get All Campaigns

Get All Campaigns

Query parameters

Required query parameters

  • Name
    top
    Type
    integer
    Description

    A limit on the number of objects to be returned. Can range between 1 and 1000.

  • Name
    skip
    Type
    integer
    Description

    The number of objects to skip for the requested result

Optional query parameters

  • Name
    _id
    Type
    string
    Description

    The ID of the campaign to search for

  • Name
    name
    Type
    string
    Description

    The name of the campaign to search for

  • Name
    externalId
    Type
    string
    Description

    The external ID of the campaign to search for

Request

GET
/api/fundraise/campaigns
const response = await fetch('https://vivenu.com/api/fundraise/campaigns?top=1&skip=1&_id=507f191e810c19729de860ea&name=Example+Name&externalId=507f191e810c19729de860ea', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer {token}',
  },
})

const data = await response.json()

Response (200)

{
  "docs": [],
  "total": 10.5
}

Was this page helpful?