Charge
Endpoint
/v1/External/Charge
Http Request Method
PUT
Request Body
Name | Type | Description | Child Attributes |
---|---|---|---|
donor | object | Information about the donor. | |
campaignNum | number | Unique campaign number. | |
campaignName | string | Name of the campaign. | |
reason | object | Reason for the donation. | |
amount | number | Amount paid. | |
ccNum | string | Credit card number used for the transaction. | |
expiry | string | Credit card expiry date in MMYY format. | |
cvv | string | Credit card security code. | |
note | string | Any additional notes regarding the payment. | |
paymentDate | string | Date of the payment in ISO format. | |
paymentMethodId | number |
ID of the payment method used:
1 - Cash
2 - Check
3 - OJC
4 - Credit Card
5 - Other
6 - Matbia
7 - Pledger
8 - DonorsFund
9 - ACH
10 - Charity Voucher
11 - Apple Pay
12 - Google Pay
13 - Matbia Tokens
14 - OJC Vouchers
15 - Quick Pay
16 - Wire Transfer
| |
uniqueTransactionId | string | Unique identifier for the transaction. | |
currency | string | Currency used in the transaction. | |
reasons | array of objects | List of reasons for payment. | |
bankAccount | string | Bank account details if applicable. | |
orgGUID | string | Unique identifier for the organization. |
Response
Name | Type | Description | Child Attributes |
---|---|---|---|
paymentId | number | Unique identifier for the payment. | |
statusId | number | Status ID of the payment. | |
serverRejected | string | Server rejection reason, if any. | |
approval | string | Approval status of the payment. | |
receiptNum | string | Receipt number of the payment. | |
accountId | number | Account ID associated with the payment. | |
currencyAmount | number | Amount of the payment in currency. | |
currency | string | Currency type (e.g., USD). | |
paymentStatus | string | Status of the payment (e.g., Success, Failed). | |
isRecurring | boolean | Indicates if the payment is recurring. | |
responseTitle | string | Title of the response message. | |
isPaymentExist | boolean | Indicates if the payment already exists. | |
errorResponse | string | Error response message, if any. | |
error | object | Detailed error information. |
See list of possible errors.
Example:
cURL:
curl --location --request PUT 'https://dev.api.donary.com/v1/External/Charge' \
--header 'APIKey: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"donor":{"accountNum":"0000000","firstName":"Test","lastName":"Charity","phoneNumber":"2162162166"},"campaignNum":1001,"campaignName":"Gold Page","reason":{"reasonNum":null,"reasonName":null},"amount":100,"ccNum":"4242424242424242","expiry":"1228","cvv":"456","note":"Test","paymentDate":"2024-08-15T10:30:43.007Z","paymentMethodId":4,"uniqueTransactionId":"120202","currency":"USD","reasons":[{"reasonNum":"1002","reasonName":"Reason A","reasonAmount":5},{"reasonNum":"1004","reasonName":"Reason c","reasonAmount":5},{"reasonNum":"1003","reasonName":"Reason b","reasonAmount":90}],"bankAccount":null,"orgGUID":"115e9d3d-baf2-4089-b896-9b2621ffcf1b"}'
Payload:
{
"donor": {
"accountNum": "0000000",
"firstName": "Test",
"lastName": "Charity",
"phoneNumber": "2162162166"
},
"campaignNum": 1001,
"campaignName": "Gold Page",
"reason": {
"reasonNum": null,
"reasonName": null
},
"amount": 100,
"ccNum": "4242424242424242",
"expiry": "1228",
"cvv": "456",
"note": "Test",
"paymentDate": "2024-08-15T10:30:43.007Z",
"paymentMethodId": 4,
"uniqueTransactionId": "120202",
"currency": "USD",
"reasons": [
{
"reasonNum": "1002",
"reasonName": "Reason A",
"reasonAmount": 5
},
{
"reasonNum": "1004",
"reasonName": "Reason c",
"reasonAmount": 5
},
{
"reasonNum": "1003",
"reasonName": "Reason b",
"reasonAmount": 90
}
],
"bankAccount": null,
"orgGUID": "115e9d3d-baf2-4089-b896-9b2621ffcf1b"
}
Response:
{
"paymentId": 4886064,
"statusId": 1,
"serverRejected": "",
"approval": "Success",
"receiptNum": "1094",
"accountId": 3703699,
"currencyAmount": 100.0000,
"currency": "USD",
"paymentStatus": "Success",
"isRecurring": false,
"responseTitle": "Success !!",
"isPaymentExist": false,
"errorResponse": "",
"error": {
"errorCode": null,
"message": null
}
}