Cancel a Donation
POST/v1/donations/:id/cancel
Applicable only to direct
type Donations created directly through the Create A Donation API.
Request​
Path Parameters
Id of the Donation to cancel.
Responses​
- 200
- 400
- 401
- 403
Successfully cancelled 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)
- InvalidState
Schema
error object
{
"error": {
"code": "string",
"title": "string",
"message": "string",
"reasons": [
"string"
]
}
}
Donation - Invalid state
{
"error": {
"code": "donation/invalid_state",
"title": "Bad request",
"message": "Donation is not in a valid state to update"
}
}
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"
}
}