Edit a Donation
PATCH/v1/donations/:id
Update the recipient organisation, metadata of a Donation. The recipient organisation can only be changed for direct
type Donations created directly through the Create A Donation API that are in an ACTIVE
status.
Request​
Path Parameters
Id of the Donation.
- application/json
Body
required
Key-value data that you can attach to a Donation.
{"key1":"value1","key2":"value2"}
Responses​
- 200
- 400
- 401
- 403
Successfully edited a particular 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
- InvalidState
- InvalidMetadata
- InvalidTypeForEditOrganisation
- MissingOrganisation
- WrongTargetCurrency
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 - Invalid state
{
"error": {
"code": "donation/invalid_state",
"title": "Bad request",
"message": "Donation is not in a valid state to update"
}
}
400 Bad request
{
"error": {
"title": "Bad request",
"message": "Metadata can only contain from 1 up to 20 keys, with key names up to 50 characters long and values up to 500 characters long",
"code": "donation/invalid_metadata"
}
}
Donation - Organisation cannot be updated for this type of donation
{
"error": {
"code": "donation/cannot_edit_organisation_invalid_donation_type",
"title": "Bad request",
"message": "Organisation cannot be updated for this type of donation"
}
}
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"
}
}
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"
}
}