Skip to main content

Charge


Endpoint

/v1/External/Charge

Http Request Method

PUT

Request Body

NameTypeDescriptionChild Attributes
campaignNum numberUnique campaign number.Placeholder
campaignName stringName of the campaign.Placeholder
amount numberAmount paid.Placeholder
ccNum stringCredit card number used for the transaction.Placeholder
expiry stringCredit card expiry date in MMYY format.Placeholder
cvv stringCredit card security code.Placeholder
note stringAny additional notes regarding the payment.Placeholder
paymentDate stringDate of the payment in ISO format.Placeholder
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
Placeholder
uniqueTransactionId stringUnique identifier for the transaction.Placeholder
currency stringCurrency used in the transaction.Placeholder
bankAccount stringBank account details if applicable.Placeholder
orgGUID stringUnique identifier for the organization.Placeholder

Response

NameTypeDescriptionChild Attributes
paymentId numberUnique identifier for the payment.Placeholder
statusId numberStatus ID of the payment.Placeholder
serverRejected stringServer rejection reason, if any.Placeholder
approval stringApproval status of the payment.Placeholder
receiptNum stringReceipt number of the payment.Placeholder
accountId numberAccount ID associated with the payment.Placeholder
currencyAmount numberAmount of the payment in currency.Placeholder
currency stringCurrency type (e.g., USD).Placeholder
paymentStatus stringStatus of the payment (e.g., Success, Failed).Placeholder
isRecurring booleanIndicates if the payment is recurring.Placeholder
responseTitle stringTitle of the response message.Placeholder
isPaymentExist booleanIndicates if the payment already exists.Placeholder
errorResponse stringError response message, if any.Placeholder

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
}
}