API ReferenceView as MarkdownOpenAPI

Donations

View as Markdown

Donations are fundraising campaigns: a story, an optional target amount, predefined amounts to give and add-on options such as a gift.

Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.

5 endpoints.

List all donations

The donations page, or the campaigns as JSON with ?ionic. Paged with ?skip. Cached for an hour.

User with accessOptional user

Needs a signed-in user whose plan grants access.

Query parameters
publishedstring

Only donations with this published.

completedstring

Only donations with this completed.

sortBystring

The order of the results.

collectionstring

Only results in this collection.

skipstring

How many results to skip - for paging.

wherestring

Only donations with this where.

Returns

Returns a list of Donation objects.

Status codes

200 401 402 404 500

GET/donations
curl -X GET 'http://smartman.max-media.io/donations?ionic=true&published=...&completed=...&sortBy=...' \
  -H 'Authorization: Bearer <TOKEN>'
Response
[
  {
    "enabled": false,
    "has_shippable_items": false,
    "medias": [
      {
        "media": "6543210fedcba98765432100",
        "gcs_url": "example-item",
        "gcs_480_30_url": "example-item",
        "gcs_720_30_url": "example-item",
        "gcs_1080_30_url": "example-item",
        "duration": 1,
        "vimeo_uri": "example",
        "vimeo_picture": "example",
        "vimeo_url": "example-item",
        "youtube_url": "example-item",
        "youtube_picture": "example",
        "thumbnail": "example",
        "_id": "6543210fedcba98765432100"
      }
    ],
    "url": "example-item",
    "static_url": "example-item",
    "title": "Example",
    "description": "Text shown on the site.",
    "about_page": "6543210fedcba98765432100",
    "collection_id": "6543210fedcba98765432100",
    "topics": [
      {
        "collection_id": "6543210fedcba98765432100",
        "_id": "6543210fedcba98765432100"
      }
    ],
    "owner_id": "6543210fedcba98765432100",
    "options": [
      {
        "name": "Example",
        "options": [],
        "_id": "6543210fedcba98765432100"
      }
    ],
    "_id": "6543210fedcba98765432100",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "createdAt": "2026-11-04T12:00:00.000Z",
    "target_amount": {
      "enabled": false,
      "amount": 0
    },
    "predefined_amounts": {
      "enabled": false,
      "amounts": "example"
    }
  }
]

Create a donation

Creates a donation campaign. Answers 201 with the campaign.

Admin token

Needs a site admin token.

Parameters
titlestring

Name of the campaign, required.

Returns

Returns the Donation object.

Status codes

201 400 401 500

POST/donations
curl -X POST 'http://smartman.max-media.io/donations?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "title": "..." }'
Response
{
  "enabled": false,
  "has_shippable_items": false,
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gcs_480_30_url": "example-item",
      "gcs_720_30_url": "example-item",
      "gcs_1080_30_url": "example-item",
      "duration": 1,
      "vimeo_uri": "example",
      "vimeo_picture": "example",
      "vimeo_url": "example-item",
      "youtube_url": "example-item",
      "youtube_picture": "example",
      "thumbnail": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "url": "example-item",
  "static_url": "example-item",
  "title": "Example",
  "description": "Text shown on the site.",
  "about_page": "6543210fedcba98765432100",
  "collection_id": "6543210fedcba98765432100",
  "topics": [
    {
      "collection_id": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "owner_id": "6543210fedcba98765432100",
  "options": [
    {
      "name": "Example",
      "options": [],
      "_id": "6543210fedcba98765432100"
    }
  ],
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "target_amount": {
    "enabled": false,
    "amount": 0
  },
  "predefined_amounts": {
    "enabled": false,
    "amounts": "example"
  }
}

Update a donation

Updates a donation campaign. Answers the campaign, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the donation.

Returns

Returns the Donation object.

Status codes

200 400 401 404 500

PATCH/donations/:id
curl -X PATCH 'http://smartman.max-media.io/donations/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "enabled": false,
  "has_shippable_items": false,
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gcs_480_30_url": "example-item",
      "gcs_720_30_url": "example-item",
      "gcs_1080_30_url": "example-item",
      "duration": 1,
      "vimeo_uri": "example",
      "vimeo_picture": "example",
      "vimeo_url": "example-item",
      "youtube_url": "example-item",
      "youtube_picture": "example",
      "thumbnail": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "url": "example-item",
  "static_url": "example-item",
  "title": "Example",
  "description": "Text shown on the site.",
  "about_page": "6543210fedcba98765432100",
  "collection_id": "6543210fedcba98765432100",
  "topics": [
    {
      "collection_id": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "owner_id": "6543210fedcba98765432100",
  "options": [
    {
      "name": "Example",
      "options": [],
      "_id": "6543210fedcba98765432100"
    }
  ],
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "target_amount": {
    "enabled": false,
    "amount": 0
  },
  "predefined_amounts": {
    "enabled": false,
    "amounts": "example"
  }
}

Delete a donation

Deletes a donation campaign. Answers the deleted campaign, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the donation.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/donations/:id
curl -X DELETE 'http://smartman.max-media.io/donations/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve a donation

A campaign's page, or JSON with ?ionic. By url, not id. 404 when there is no such campaign.

Page accessOptional user

Pages limited to some users check the token when one is sent.

Path parameters
urlstringRequired

The donation's URL slug, as in its address on the site.

Query parameters
sessionIdstring

Only donations with this session id.

Returns

Returns the Donation object.

Status codes

200 401 402 404 500

GET/donations/:url
curl -X GET 'http://smartman.max-media.io/donations/{url}?ionic=true&sessionId=...'
Response
{
  "enabled": false,
  "has_shippable_items": false,
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gcs_480_30_url": "example-item",
      "gcs_720_30_url": "example-item",
      "gcs_1080_30_url": "example-item",
      "duration": 1,
      "vimeo_uri": "example",
      "vimeo_picture": "example",
      "vimeo_url": "example-item",
      "youtube_url": "example-item",
      "youtube_picture": "example",
      "thumbnail": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "url": "example-item",
  "static_url": "example-item",
  "title": "Example",
  "description": "Text shown on the site.",
  "about_page": "6543210fedcba98765432100",
  "collection_id": "6543210fedcba98765432100",
  "topics": [
    {
      "collection_id": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "owner_id": "6543210fedcba98765432100",
  "options": [
    {
      "name": "Example",
      "options": [],
      "_id": "6543210fedcba98765432100"
    }
  ],
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "target_amount": {
    "enabled": false,
    "amount": 0
  },
  "predefined_amounts": {
    "enabled": false,
    "amounts": "example"
  }
}
↑↓ Navigate↵ GoEsc Close