Create a donation
POST/v1/donations
Creates a new Donation of type direct
. We will request payment from you for the Donations aggregated over a period. Percent and our associated foundations will then handle the ongoing safe and efficient disbursement of funds to the nonprofit.
Please note that if you are creating with a userId
and no organisationId
the user must be already supporting an organisation.
Request​
Header Parameters
Idempotency key.
- application/json
Body
required
- MOD1
- MOD2
Amount to be donated. A positive integer representing how much to donate in the smallest currency unit, for example 100 pence to donate £1.00.
Three-letter ISO currency code. Can only be AUD for AUS nonprofits, USD for USA nonprofits, and GBP for every-other nonprofit.
Possible values: <= 255 characters
Possible values: <= 255 characters
Possible values: <= 255 characters
Possible values: [yes
, no
]
Possible values: [yes
, no
]
Key-value data that you can attach to a Donation.
Three-letter ISO currency code.
Possible values: <= 255 characters
Possible values: <= 255 characters
Possible values: <= 255 characters
Possible values: [yes
, no
]
Possible values: [yes
, no
]
Key-value data that you can attach to a Donation.
Responses​
- 200
- 400
- 401
- 403
Successfully created a Donation
- application/json
- Schema
- Example (from schema)
Schema
data object
Donation amount. A positive integer representing donation amount in the smallest currency unit, for example 100 pence for a donation of £1.00.
Three-letter ISO currency code
Possible values: [ACTIVE
, REQUESTED_PAYMENT
, RECEIVED_PAYMENT
, DISBURSED
, CANCELLED
]
Users first name.
Users last name.
Users email.
Possible values: [yes
, no
]
Whether the user consented to be contacted by the benefitting organisation.
Possible values: [yes
, no
]
Whether the user wants to share their donation publicly or not.
metadata objectnullable
Key-value data that you can attach to an object.
Possible values: [direct
]
{
"data": {
"id": "donation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"userId": "string",
"organisationId": "string",
"amount": 123,
"currencyCode": "AUD",
"createdAt": "2020-10-13T17:46:54.000Z",
"status": "ACTIVE",
"firstName": "string",
"lastName": "string",
"email": "string",
"consentedToBeContacted": "yes",
"anonymous": "yes",
"metadata": {},
"giftAidId": "string",
"cancelledAt": "2020-10-13T17:46:54.000Z",
"donationRequestId": "donationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"accountId": "account_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"type": "direct"
},
"object": "donation"
}
Bad request
- application/json
- Schema
- Example (from schema)
- IncorrectParams
- UserNotFound
- MissingOrganisation
- WrongTargetCurrency
- WrongPartnerCurrency
- CannotAcceptDonations
- GiftAidMissing
- OriginalCallInProgress
- SameKeyDifferentData
- KeyInUse
Schema
error object
{
"error": {
"code": "string",
"title": "string",
"message": "string",
"reasons": [
"string"
]
}
}
400 Incorrect Parameters
{
"error": {
"code": "bad_request",
"title": "Bad request",
"message": "One or more of the inputs were invalid",
"reasons": [
"pageSize must be greater than or equal to 0"
]
}
}
Donation - User not found
{
"error": {
"code": "donation/user_not_found",
"title": "Bad request",
"message": "User not found"
}
}
Donation - Organisation missing
{
"error": {
"code": "donation/missing_organisation",
"title": "Bad request",
"message": "User must be supporting a cause, or organisationId must be provided"
}
}
Donation - Wrong target currency
{
"error": {
"code": "donation/wrong_target_currency",
"title": "Bad request",
"message": "This organisation can not accept donations in GBP"
}
}
Donation - Wrong partner currency
{
"error": {
"code": "donation/wrong_partner_currency",
"title": "Bad request",
"message": "You can only donate in GBP"
}
}
Donation - Organisation can not accept donations
{
"error": {
"code": "donation/cannot_accept_donations",
"title": "Bad request",
"message": "This organisation is currently unable to accept donations"
}
}
Donation - GiftAid missing
{
"error": {
"code": "donation/gift_aid_missing",
"title": "Bad request",
"message": "Can not find required gift aid for this donation"
}
}
Idempotency - Original call in progress
{
"error": {
"code": "idempotency/original_call_in_progress",
"title": "Bad request",
"message": "Original call with this idempotency key is still in progress"
}
}
Idempotency - Data has changed from previous request
{
"error": {
"code": "idempotency/same_key_different_data",
"title": "Bad request",
"message": "Data has changed from previous request"
}
}
Idempotency - Key in use
{
"error": {
"code": "idempotency/key_already_in_use",
"title": "Bad request",
"message": "Idempotency Key is already in use"
}
}
Unauthorized
Forbidden (scope)
- application/json
- Schema
- Example (from schema)
Schema
error object
{
"error": {
"code": "forbidden",
"title": "Forbidden",
"message": "Access is denied due to missing scope permissions"
}
}