Donation

This will add a donation to selected campaign from Ayobantu partner.

Create Donation

POST {base_url}/api/v1/partner/donation

Submit new donation to the selected campaign

Headers

Name
Type
Value

Accept

String

application/json

Authorization

String

Bearer <api_token>

Content-Type*

String

application/json

Request Body

Name
Type
Description

name*

String

John Doe (Alpha/Numeric Only)

email

Email

[email protected] (required if is_fundraiser is true)

partner_code*

String

Provided by Ayobantu. See more, click here

signature_key*

String

Signature code generated every time you make a request. See more, click here.

Formula:

hash("sha512", name + phone + email + amount + is_anonymous + campaign_id + partner_code + secret_key);

Example Output: a2a1d0baa527318794f77122e8b35eb19c83498fb535897d58bcf0fc6a00b3c0de5a113a1d53caa748a0bdcf0b0d6fd941d1ffa6801f0bb99d370f1c83aa13db

campaign_id*

Integer

id is obtained from campaign submitted by partners or can be provided by Ayobantu.

phone*

Numeric

0812345678 or 6287812345678

amount*

Numeric

100000 (without any . or ,)

is_anonymous

Numeric

0 or 1 (default 0)

is_fundraiser (Optional)

Boolean

true or false (default false)

{ 
   "status_code": "200", 
   "message": "Success", 
   "data": {
         "reference_id" : 8181,
         "amount" : 100000
   } 
}
// Example Generate Signature Key 
//secret_key = '353656da-1695-434b-9f61-a3c9ff90894f';
hash("sha512", 'John Doe0812345678johndoe@example.com500000123AYB12345353656da-1695-434b-9f61-a3c9ff90894f')

//Result
a52fce4c70337fd8749c984f1c8019e3205622b01cd18fc9d3dd3b5c333307c18981a7e90454665e7b42059e4b062c9c306c18bf25da40adafd5040956eacb36
curl -X POST \
  {base_url}/api/v1/partner/donation \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer 88A4B7FEADD1667B' \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
        "name"  : "John Doe",
        "phone" : "0812345678",
        "amount" : "50000",
        "email" : "[email protected]",
        "partner_code" : "AYB12345",
        "signature_key" : "a52fce4c70337fd8749c984f1c8019e3205622b01cd18fc9d3dd3b5c333307c18981a7e90454665e7b42059e4b062c9c306c18bf25da40adafd5040956eacb36",
        "campaign_id"   : 123,
        "is_anonymous"    : 0,
        "is_fundraiser" : false
}'

Last updated