API Documentation
Base URL
https://app.donorsync.io/api/v1
🔑 Authentication
The API uses Basic Authentication. Each charity has a username and password generated during signup.
All requests must include the Authorization header:
Authorization: Basic {base64(username:password)}
Accept: application/json
Example (cURL):
curl -X POST https://app.donorsync.io/api/v1/me \
-H "Accept: application/json" \
-u charity_user:charity_pass
📍 Endpoints
1. Test Connection
Verify that your API credentials are valid.
Endpoint:
POST /me
Request:
No body required.
Response (200):
{
"success": true,
"message": "Authenticated",
"data": {
"name": "Username",
"email": "Email"
}
}
Error (401):
{
"message": "Unauthorized"
}
2. Create Donation
Create a new donation record.
Endpoint:
POST /donation/create
Request Body:
{
"donor_first_name": "John",
"donor_last_name": "Doe",
"donor_email": "john.doe@example.com",
"donor_phone": "123456789",
"donor_address": "Hotel Gotham",
"donor_city": "Manchester",
"donor_postcode": "SW1Y 4PH",
"donor_ip": "",
"gift_aid": "yes",
"amount": "20",
"payment_method": "cash",
"payment_confirmation_number": "",
"donation_type": "one-time",
"donation_date": "25-02-2021",
"zakat_donation": "yes"
}
Validation Rules:
donor_email: required, valid emailgift_aid: required, must beyesornoamount: required, numeric, minimum0.01donation_type: required, one ofone-time,recurring,renewal- Other donor fields are optional but recommended
Successful Response (200):
{
"data": {
"id": 2013,
"donor_first_name": "John",
"donor_last_name": "Doe",
"donor_email": "john.doe@example.com",
"donor_phone": "123456789",
"donor_address": "Hotel Gotham",
"donor_city": "Manchester",
"donor_postcode": "SW1Y 4PH",
"donor_ip": null,
"gift_aid": "yes",
"amount": "20",
"payment_method": "cash",
"payment_confirmation_number": "",
"donation_type": "one-time",
"donation_date": "2021-02-25T12:41:39.000000Z",
"zakat_donation": true
}
}
Error Response (422):
{
"message": "The given data was invalid.",
"errors": {
"donor_email": [
"The donor email is required."
]
}
}
⚠️ Error Codes
| Status Code | Meaning |
|---|---|
| 200 | Success |
| 201 | Resource created successfully |
| 401 | Unauthorized (invalid credentials) |
| 422 | Validation error in request data |
| 500 | Internal server error |