Online-payment icon

Giving for API only

Add Adyen Giving to an existing API only integration.

Accept donations for a nonprofit with the Giving API-only integration that gives you more flexibility to customize the donation flow.

You can build your own donation form to accept donations for a nonprofit and have full control of the style, visual elements, and user interface. When the shopper chooses to make a donation, it is charged to the same payment method they use for the original transaction.

You can choose one of the following implementations:

For this implementation, you add the option to donate without changing the checkout process. You show the option to donate after the shopper submits the payment form, so that they can make a donation after they pay for their original transaction.

For example:

  • Show a donation button on the confirmation page for the shopper's original payment.
  • Redirect the shopper to a page about your donation campaign. Include the donation form on this page.

This gives you flexibility to align Giving with your existing checkout process and allows the shopper to contribute to your donation campaign after their transaction.

Example confirmation page.

Before you begin

Adyen Help

Our Giving section answers your questions about donations with Giving.

This page assumes you have already:

Before starting your Giving integration:

  1. Enable and integrate a supported payment method.
  2. Enable Giving in your test Customer Area.
  3. Set up the Adyen Giving merchant webhook in your Customer Area.

How it works

After the shopper completes their payment for the original transaction:

  1. Show the shopper a donation form.
  2. From your server, make a /donations request to make a donation.
  3. Get the outcome from a webhook and show it to the shopper.

The following diagram shows the donation flow after the shopper finishes their original payment:

Step 1: Show a donation form

Before you show the option to donate, the shopper must make a payment with a payment method that supports donations. If their payment is successful, show the shopper a donation form.

Show a donation form with either:

  • A field for the shopper to enter a donation amount.
  • Buttons for the shopper to select a donation amount. For example, Donate €3, Donate €5, and Donate €10.

The donation form must:

  • Show the name of the nonprofit, and some information about them.
  • Link to the nonprofit's Privacy Policy and Terms & Conditions.
  • Have the option for the shopper to decline to donate. For example, a Not now button.
  • Tell the shopper that two different transactions will show up in their bank statement: one for the purchase (paid to your account) and another for the donation (paid to the nonprofit is account).

If the shopper paid with iDeal and chooses to donate:

  • Tell the shopper that the donation is a SEPA Direct Debit from the bank account associated with their iDeal payment and get their consent to process the donation.
  • Tell the shopper that the donation transaction will show up in their bank statement a day or more later.

Step 2: Make a donation

Try it out!

You can make a donation either with the same payment method that the shopper used for the original transaction or with a stored payment method.

From your server, make a POST request to /donations, specifying:

Field name Required Description
paymentMethod -white_check_mark- For cards, type: scheme.
For iDeal, type: sepadirectdebit.
amount -white_check_mark- The currency and value of the donation.
donationAccount -white_check_mark- The Adyen account name of your nonprofit.
For testing, use MyCharity_Giving_TEST.
For accepting live donations, use the account name that we give you after choosing your nonprofit.
donationOriginalPspReference -white_check_mark- The PSP reference of the original payment.
donationToken -white_check_mark- For cards, the donationToken from the /payments response.
For iDeal, the donationToken from the /payments/details response.

Step 3: Get the donation outcome

You get the donation outcome of each donation in a webhook. To receive these webhooks, enable the Adyen Giving merchant webhook, which includes eventCode: DONATION.

For a successful donation, the event contains success: true.

Use the originalReference to associate the donation to the shopper's original transaction.

Test and go live

Before going live with your integration, use our test cards to test your integration.

See also