> ## Documentation Index
> Fetch the complete documentation index at: https://docs.plude.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Adyen

Adyen is a Dutch payment provider supported various means of payment methods including VISA, Mastercard and Swiss.

# Introduction

Our integration with Adyen support the following payment methods:

<Tabs>
  <Tab title="Credit card">
    VISA, Mastercard, Maestro, Dankort.
  </Tab>

  <Tab title="Klarna">
    Supported
  </Tab>

  <Tab title="Swiss">
    Supported
  </Tab>

  <Tab title="Apple & Google Pay">
    Supported
  </Tab>

  <Tab title="Paypal">
    Supported
  </Tab>

  <Tab title="iDeal & SEPA">
    Supported
  </Tab>
</Tabs>

# Getting started

Sign up for an Adyen account, using the following [link](https://www.adyen.com).

## Enabling Adyen

Before enabling Adyen, you will need to collect your account with username and password.

To enable Adyen as a payment provider, use the following snippet:

```bash theme={null}
curl -X POST \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer {your_token_here}" \
     -H "X-environment: {your_environment_id_here}" \
     -H "X-version: 2022-03" \
     -d '{ "name": "adyen" }' \
     https://api.plude.io/paymentproviders/
```

You will receive a response as follows:

```json theme={null}
{
    "name": "adyen",
    "message": "Please open the url in a browser to complete the connect.",
    "url": "https://ca-live.adyen.com/ca/ca/oauth/connect.shtml?client_id=OACL4295Q22..."
}
```

Open a browser and navigate to the `url` provided in the response. Authenticate using your username and password and authorize the provider to connect.

## Configuring Adyen

Nothing to configure.

# Payment sources

## Adding a Credit card

To add a credit card payment method to a Customer, use the following snippet:

```bash theme={null}
curl -X PUT \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer {your_token_here}" \
     -H "X-environment: {your_environment_id_here}" \
     -H "X-version: 2022-03" \
     -d '{ "provider": "adyen", "redirect" : "(your redirect url here)" }' \
     https://api.plude.io/customers/{552dabcf-31e5-4998-9d24-0689448ae7cf}/paymentmethods/
```

Your request will return the following response:

```json theme={null}
{
    "url": "https://live.adyen.link/...",
    "message": "Redirect the user to the following url.",
    "state": "initial"
}
```

Redirect the user to the provided URL. Provide a creditcard and solve any 3d-secure consent.

## Adding an stored Adyen source

You can add an existing stored payment method from Adyen, by providing the `shopperReference` and the `storedPaymentMethodId`.

Use the following snippet:

```bash theme={null}
curl -X PUT \
     -H "Content-Type: application/json" \
     -H "Authorization: Bearer {your_token_here}" \
     -H "X-environment: {your_environment_id_here}" \
     -H "X-version: 2022-03" \
     -d '{ "provider": "adyen", "source" : "{\"shopperReference\" : \"..\", \"storedPaymentMethodId\" : \"..\"}" }' \
     https://api.plude.io/customers/{552dabcf-31e5-4998-9d24-0689448ae7cf}/paymentmethods/
```

Your request will return the following response:
