Search

Are you looking for test card numbers?

Would you like to contact support?

Online-payment icon

Adyen Giving for API only

Add Adyen Giving to an existing API-only integration.

Accept Adyen Giving donations using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

With Adyen Giving, you can give your shoppers the option to donate to a charity after a payment has been completed. When your shopper chooses to make a donation, this is charged to the same payment method they used for the payment.

Before you begin

These instructions explain how to add Adyen Giving to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your Adyen Giving integration, make sure that:

  1. You have set up your back end implementation.
  2. Adyen Giving has been enabled for your account, and your chosen charity has been onboarded. You can confirm this by contacting either your Adyen Account Manager or our Support Team.

Build your form for Adyen Giving

Before giving your shopper the option to donate, you will need to make a payment with a payment method that supports donations. If this payment is successful (the payment result is either Authorised, Received, or Pending Received), present your shopper with the option to make a donation.

Render a donation form with either:

  • A field where the shopper can enter their own donation amount.
  • Buttons for fixed donation amounts. For example, Donate €3, Donate €5, and Donate €10.

Your donation form will also need to:

  • Show the name of the charity, and some information about them.
  • Link to the charity's Privacy Policy and Terms & Conditions.
  • Have an option to not donate. A button with Not now, for example.
  • Inform the shopper that they will see two charges on their bank statement (one for the purchase, and one for the donation), and from two separate entities (you, and the charity).

Make a donation

When the shopper chooses to donate, make a POST request to /donate . In this request, specify:

  • donationAccount: The Adyen account name of your charity. We will provide you with this account name once your chosen charity has been onboarded.
  • reference: Your unique reference for this donation.
  • modificationAmount: The currency and value of the donation.
  • originalReference: The PSP reference of the payment.

The example below is for a donation of 5 EUR, made after a payment that the PSP reference 991559660454807J.

{
  "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
  "donationAccount":"CHARITY_ACCOUNT",
  "reference":"YOUR_DONATION_REFERENCE",
  "modificationAmount":{
    "currency":"EUR",
    "value":500
  },
  "{hint:The pspReference of the payment}originalReference{/hint}":"991559660454807J"
}

The /donate response contains:

  • additionalData.merchantReference: Echoes the reference you provided in the /donate request.
  • pspReference: Adyen's unique reference for the donation.
  • response: [donation-received]
/donate response
{
    "additionalData":{
        "merchantReference":"YOUR_DONATION_REFERENCE"
    },
    "pspReference":"852561121120573B",
    "response":"[donation-received]"
}

Present the donation result

If the donation is successfully received (the response is [donation-received]), present the shopper with a message thanking them for their donation.

Test and go live

When you onboard with Adyen Giving, we create a test charity account that you can use for testing purposes. You will get a separate Customer Area login for this account and a corresponding donationAccount.

To test whether your donation flow is working correctly:

  1. Make a /donate request, providing the donationAccount of your test charity.
  2. Log in to the Customer Area account for your test charity, and navigate to Transactions > Payments.

    If the donation is successful it appears in this transaction list.

When you are live with Adyen Giving, you can confirm whether your chosen charity is receiving donations by contacting either your Adyen Account Manager or our Support Team.

See also