Charge
The Charge Payment API processes one-time payments within Donary. It returns a payment ID, status, and confirmation, allowing for quick and secure transaction processing.
Endpoint
/v1/External/Charge
Http Request Method
POST
Request Header
See authorization.
Request Body
note
* Indicates required field.
* Required when using a credit card.
* Indicates suggested field.
* Required when using ACH.
Name | Type | Description | Child Attributes | |
---|---|---|---|---|
orgGUID * | string | Identifier for the organization receiving the funds. | ||
donor | object | Information about the donor. Learn more about matching to an existing donor or creating a new donor record. | ||
campaign | object | Campaign details. Learn more about matching to an existing campaign or creating a new record. | ||
reason | object | Provide when the donation should be applied to one reason. Learn more about matching to an existing reason record or creating one. | ||
amount * | double | Amount of the payment. | ||
card * | object | Credit card information; for a credit card payment. | ||
note | string | Any additional notes regarding the payment. | ||
paymentDate | string | Date of the payment in UTC format. | ||
paymentMethodId | string | Method of payment, please format as follows:
OJC
Credit_Card
Matbia
Pledger
Donors_Fund
ACH | ||
uniqueTransactionId * | string | Unique identifier for the transaction in GUID format. | ||
currency * | string | Currency of the transaction, the following currencies are supported:
USD
ILS
EUR
CAD
GBP | ⚠️ Your account needs to be set up to accept the necessary currencies. | |
reasons | array of objects | Provide when there are multiple reasons the payment should be applied to. | ||
bankAccount * | object | Bank account information; for an ACH payment. |
Response
Name | Type | Description | Child Attributes | |
---|---|---|---|---|
receiptNum | string | Receipt number of the payment. | ||
amount | double | Amount of the payment. | ||
accountId | int | Account ID of the donor associated with the payment. | ||
currency | string | Currency of the transaction. | ||
paymentStatus | string | Status of the payment:
Success
Failed | ||
responseTitle | string | Status | ||
error | object | Detailed error information. |
Example:
cURL:
curl --location --request PUT 'https://sandbox-api.donary.com/v1/External/Charge' \
--header 'Authorization: YOUR_AUTH_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{"donor":{"accountNum":"10","firstName":"Yaakov","lastName":"Freedman","phoneNumber":"7185556666"},"campaignNum":5,"campaignName":"Beis Medresh","reason":{"reasonNum":1000,"reasonName":"Keren Habinyan"},"amount":10,"ccNum":"4242424242424242","expiry":"12/28","cvv":"456","note":"Charge Test","paymentDate":"2024-10-29T10:30:43.007Z","paymentMethodId":"Credit_Card","uniqueTransactionId":"586f0af4-9409-e684-3ef9-b81bda1fd6c971-152[8g","currency":"USD","reasons":null,"bankAccount":null,"orgGUID":"115e9d3d-baf2-4089-b896-9b2621ffcf1b"}'
Payload:
{
"orgGUID": "115e9d3d-baf2-4089-b896-9b2621ffcf1b",
"donor": {
"accountNum": 10,
"firstName": "Yaakov",
"lastName": "Freedman",
"phoneNumber": "7185556666"
},
"campaign": {
"campaignNum": 5,
"campaignName": "Beis Medresh"
},
"reason":
{
"reasonNum": 1000,
"reasonName": "Keren Habinyan"
},
"amount": 10,
"card": {
"ccNum": "4242424242424242",
"expiry": "12/28",
"cvv": "456"
},
"note": "Charge Test",
"paymentDate": "2024-10-29T10:30:43.007Z",
"paymentMethodId": "Credit_Card",
"uniqueTransactionId": "586f0af4-9409-e684-3ef9-b81bda1fd6c971-152[8g",
"currency": "USD",
"reasons": null,
"bankAccount": null
}
Response:
{
"receiptNum": "1238",
"amount": 10.0000,
"accountNum": "10",
"currency": "USD",
"paymentStatus": "Success",
"responseTitle": "Success !!",
"error": {
"errorCode": null,
"message": null
}
}