Skip to main content
Accept donations with preset amount buttons and custom input.

Enable Donation Mode

Set checkoutMode to "donation" when creating a session.
Tax Exempt: Donation mode is automatically tax-exempt. No tax will be calculated or charged on donations—this is standard for charitable contributions.
{
  "merchantId": "your_merchant_id",
  "merchantName": "My Charity",
  "successUrl": "https://mycharity.org/thank-you",
  "cancelUrl": "https://mycharity.org/donate",
  "errorUrl": "https://mycharity.org/error",
  "checkoutMode": "donation",
  "donationConfig": {
    "presets": [10, 25, 50, 100],
    "defaultAmount": 25,
    "allowCustomAmount": true
  }
}
Note: You don’t need to specify amount – the donor chooses the amount on the checkout page.
Donation mode cannot be combined with items array. The API will reject requests that include both checkoutMode: "donation" and an items array.

Donation Config Options

FieldTypeDefaultDescription
presetsarray[5, 15, 25, 50]Suggested donation amounts (buttons)
defaultAmountnumberFirst presetPre-selected amount
allowCustomAmountbooleantrueAllow donors to enter custom amount
minAmountnumber1Minimum donation amount
maxAmountnumber999999Maximum donation amount
Validation:
  • presets must be within the minAmount-maxAmount range
  • defaultAmount must be within the minAmount-maxAmount range
  • Custom input is limited to 9 characters

What the Donor Sees

  1. Preset buttons for quick selection (e.g., 10,10, 25, 50,50, 100)
  2. “Other” option to enter a custom amount (if enabled)
  3. Standard payment form
  4. “Donate” button

Example: Simple Preset

{
  "checkoutMode": "donation",
  "donationConfig": {
    "presets": [5, 10, 25]
  }
}
Donor sees three buttons: 5,5, 10, $25

Example: Monthly Campaign

{
  "checkoutMode": "donation",
  "donationConfig": {
    "presets": [25, 50, 100, 250],
    "defaultAmount": 50,
    "allowCustomAmount": true
  }
}
Donor sees 25,25, 50 (pre-selected), 100,100, 250, and “Other” option.

Example: With Min/Max Limits

{
  "checkoutMode": "donation",
  "donationConfig": {
    "presets": [10, 25, 50, 100],
    "minAmount": 5,
    "maxAmount": 10000,
    "allowCustomAmount": true
  }
}
  • Donors can enter any custom amount between 5and5 and 10,000
  • If they try to enter less than 5,theysee:"Donationmustbeatleast5, they see: "Donation must be at least 5.00”
  • If they try to enter more than 10,000,theysee:"Donationcannotexceed10,000, they see: "Donation cannot exceed 10,000.00”
Create a shareable donation link via POST /api/payment-links/create:
{
  "merchantId": "your_merchant_id",
  "merchantName": "My Charity",
  "successUrl": "https://mycharity.org/thank-you",
  "cancelUrl": "https://mycharity.org/donate", 
  "errorUrl": "https://mycharity.org/error",
  "checkoutMode": "donation",
  "donationConfig": {
    "presets": [10, 25, 50, 100]
  }
}
Share the resulting url on social media, email campaigns, or your website. See Payment Links for full details.