Retrieve donation session
GET/v1/donation-sessions/:id
Retrieve donation session
Request​
Path Parameters
id stringrequired
Id of the donation session to retrieve.
Responses​
- 200
- 400
- 401
- 403
- 404
Successfully retrieved a donation session
- application/json
- Schema
- Example (from schema)
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
{
"data": {
"id": "donationsession_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"organisationId": "organisation_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"successUrl": "https://example.com/donation-completed",
"userId": "user_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"accountId": "account_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"url": "https://donate.poweredbypercent.com/donation-session",
"status": "open",
"createdAt": "2021-10-13T17:46:54.000Z",
"expiresAt": "2021-10-13T17:46:54.000Z",
"language": "en-GB",
"metadata": {
"key1": "value1",
"key2": "value2"
},
"currency": "GBP"
},
"object": "donation_session"
}
Bad request
- application/json
- Schema
- Example (from schema)
- BadRequest
Schema
error
object
codestring
titlestring
messagestring
reasonsstring[]nullable
{
"error": {
"code": "string",
"title": "string",
"message": "string",
"reasons": [
"string"
]
}
}
400 Bad Request
{
"error": {
"code": "bad_request",
"title": "Bad request",
"message": "Something is wrong with your request, please check any parameters and try again"
}
}
Unauthorized
Forbidden (scope)
- application/json
- Schema
- Example (from schema)
Schema
error
object
codestring
Example:
forbidden
titlestring
Example:
Forbidden
messagestring
Example:
Access is denied due to missing scope permissions
{
"error": {
"code": "forbidden",
"title": "Forbidden",
"message": "Access is denied due to missing scope permissions"
}
}
The specified resource was not found
- application/json
- Schema
- Example (from schema)
Schema
error
object
codestring
Example:
not_found
titlestring
Example:
Resource not found
messagestring
Example:
This endpoint is unavailable or can not be found
{
"error": {
"code": "not_found",
"title": "Resource not found",
"message": "This endpoint is unavailable or can not be found"
}
}