Skip to main content

Create a Donation Session

POST 

/v1/donation-sessions

To create a Donation Session you must supply the organisationId of the nonprofit you want to let your user donate to.

After creating the Donation Session, direct your user to the URL for the hosted Donation gateway returned in the response. Your user will receive an email receipt after a successful Donation.

The status field of the Donation Session object after creation will be open. After a successful Donation is made the status will transition to completed otherwise if no Donation is completed before the expiresAt time the status will be expired.

Request​

Body

required

    organisationIdstringrequired

    Organisation that can be donated to during Donation session.

    Example: organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    successUrlstring

    Optional URL the donor will be directed to after making a Donation.

    Example: https://example.com/donation-completed
    userIdstring

    Id of the User who this donation belongs to, if one exists.

    Example: user_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    metadataobject

    Key-value data that you can attach to a DonationSession. When a Donation is created from a DonationSession, the DonationSession copies its metadata to the Donation.

    Example: {"key1":"value1","key2":"value2"}
    languagestring

    Donation session's default language

    Possible values: [en-US, en-GB, en-IE, en-NZ, de-DE, de-CH, de-AT, fr-FR, fr-BE, it-IT, nl-NL, sv-SE, da-DK, pl-PL, en-AU, fr-CA, en-CA, es-ES, ja-JP, es-MX, ko-KR, pt-BR, en-SG, ms-MY, th-TH, id-ID, vi-VN, hu-HU, cs-CZ, ro-RO, fil-PH, tr-TR]

    currencystring

    3-letter currency code

    Example: GBP

Responses​

Successfully created a Donation Session

Schema

    data

    object

    idstring
    Example: donationsession_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    organisationIdstring
    Example: organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    successUrlstringnullable

    Optional URL the donor will be directed to after making a donation.

    Example: https://example.com/donation-completed
    userIdstringnullable

    Id of the User who this donation belongs to, if one exists.

    Example: user_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    accountIdstringnullable

    Id of the Account who this donation belongs to, if one exists.

    Example: account_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    urlstring
    Example: https://donate.poweredbypercent.com/donation-session
    statusstring

    Possible values: [open, completed, expired]

    createdAtdate-time
    Example: 2021-10-13T17:46:54.000Z
    expiresAtdate-time
    Example: 2021-10-13T17:46:54.000Z
    languagestring
    Default value: en-GB
    Example: en-GB
    metadataobjectnullable

    Key-value data that you can attach to an object. When a Donation is created from a DonationSession, the DonationSession copies its metadata to the Donation.

    Example: {"key1":"value1","key2":"value2"}
    currencystringnullable
    Example: GBP
    objectstring
    Example: donation_session