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. Goodstack 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
- DirectDonation with Organisation ID
- DirectDonation with User ID
oneOf
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.
120
Three-letter ISO currency code. Only currency codes supported by our foundations will be accepted.
GBP
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.
{"key1":"value1","key2":"value2"}
120
Three-letter ISO currency code.
GBP
user_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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.
{"key1":"value1","key2":"value2"}
Responses​
- 200
- 400
- 401
- 403
Successfully created a Donation
- application/json
- Schema
- Example (from schema)
Schema
data
object
donation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Donation amount. A positive integer representing donation amount in the smallest currency unit, for example 100 pence for a donation of £1.00.
123
Three-letter ISO currency code
AUD
2020-10-13T17:46:54.000Z
Possible values: [ACTIVE
, REQUESTED_PAYMENT
, RECEIVED_PAYMENT
, DISBURSED
, CANCELLED
]
Users first name.
Users last name.
Users email.
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.
Possible values: [yes
, no
]
metadata
object
nullable
Key-value data that you can attach to an object.
2020-10-13T17:46:54.000Z
donationrequest_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
account_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Possible values: [direct
]
donation
{
"data": {},
"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
forbidden
Forbidden
Access is denied due to missing scope permissions
{
"error": {
"code": "forbidden",
"title": "Forbidden",
"message": "Access is denied due to missing scope permissions"
}
}