Are you looking for test card numbers?

Would you like to contact support?

No momento, esta página não está disponível em português
Marketpay icon

Add payment methods

Learn how to add and manage payment methods for your users.

The steps on this page are required if you have a platform setup. Do not perform these steps if you have a marketplace setup.

With a platform setup, payment methods are directly connected to stores. For a list of payment methods that you can add to your users' stores, see supported payment methods.

Before you begin

This page assumes you have already:

Before you begin, you need to know:

To get a list of all merchant accounts accessible with your API credentials, make a GET /merchants request.

Add a payment method

To request adding a payment method to your user's store, make a POST /merchants/{merchantId}/paymentMethodSettings request with your merchant account in the path. In your request, specify:

Parameter Required Description
type -white_check_mark- Payment method variant. Some payment methods require an additional object with payment method details.
businessLineId -white_check_mark- The unique identifier of your user's business line that you want to request a payment method for.
storeId -white_check_mark- The id of the store that you get when creating a store for your user.
countries The list of countries to enable with the payment method. To enable all countries supported by the payment method, set to ANY or send empty.
currencies The list of currencies to enable with the payment method. To enable all currencies supported by the payment method, set to ANY or send empty.

Note that some payment methods require additional parameters. Make sure to collect this information from your users before adding the payment method. For more information, see Supported payment methods.

Here's an example of a request to add Visa payments in the Netherlands:

Add a payment method to a store
# Set your X-API-KEY with the API key from the Customer Area.
curl https://management-test.adyen.com/v1/merchants/{merchantId}/paymentMethodSettings \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-X POST \
-d '{
    "type": "visa",
    "businessLineId":"BL00000000000000000000001",
    "storeId":"ST00000000000000000000001",
    "currencies": [
        "EUR"
    ],
    "countries": [
        "NL"
    ]
}
'

The response contains the id of the requested payment method.

Response
{
    "id": "PM00000000000000000000001",
    "businessLineId":"BL00000000000000000000001",
    "storeId": "ST00000000000000000000001",
    "type": "visa",
    "currencies": [
        "EUR"
    ],
    "countries": [
        "NL"
    ]
}

Adyen reviews and approves your requests to add payment methods. This means that you will receive the outcome of your request asynchronously in a webhook.

Update a payment method

To update the settings of a payment method, make a PATCH /merchants/{merchantId}/paymentMethodSettings/{paymentMethodId} with your merchant account in the path. In your request, specify:

Parameter Required Description
countries The list of countries to enable with the payment method. If sent empty, then all countries are supported by the payment method.
currencies The list of currencies to enable with the payment method. If sent empty, then all currencies are supported by the payment method.
enabled Indicates whether the payment method is enabled (true) or disabled (false).

Here's an example of requesting to update Visa with adding payments in the United States:

Update payment method's settings
# Set your X-API-KEY with the API key from the Customer Area.
curl https://management-test.adyen.com/v1/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId} \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-X PATCH \
-d '{
    "countries": [
        "NL",
        "US"
    ],
    "currencies": [
        "EUR",
        "USD"
    ]
}
'

The response contains the id of the requested payment method and the updated list of payment method settings.

Response
{
    "id": "PM00000000000000000000001",
    "type": "visa",
    "enabled": true,
    "countries": [
        "NL",
        "US"
    ],
    "currencies": [
        "EUR",
        "USD"
    ]
}

Get payment method details

You can get the details of a single payment method available on the merchant account or all payment methods available on the merchant account, store, and business line.

To get the details of a single payment method available on the merchant account, make a GET /merchants/{merchantId}/paymentMethodSettings/{paymentMethodId} request with your merchant account and the payment method ID in the path:

Get the settings of a single payment method
# Set your X-API-KEY with the API key from the Customer Area.
curl https://management-test.adyen.com/v1/merchants/{merchantId}/paymentMethodSettings/{paymentMethodId} \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-X GET \
-d '{
}
'

To get the details of all payment methods available on the merchant account, make a GET /paymentMethodSettings/{paymentMethodId} request with your merchant account in the path.

You can filter the response using the following query parameters:

  • storeId: The unique identifier of the store for which to return the payment methods.
  • businessLineId: The unique identifier of the business line for which to return the payment methods.
Get the settings of all payment methods
# Set your X-API-KEY with the API key from the Customer Area.
curl https://management-test.adyen.com/v1/merchants/{merchantId}/paymentMethodSettings?storeId={storeId}&businessLineId={businessLineId} \
-H "x-API-key: YOUR_X-API-KEY" \
-H "content-type: application/json" \
-X GET \
-d '{
}
'

Receive webhooks

Adyen sends webhooks through webhooks to inform your system about events that occur in the balance platform, such as adding a payment method.

After the payment method has been added to your store, you'll receive a paymentMethod.created webhook.

Here's an example for adding Visa to your payment methods:

Payment method created webhook
{
  "createdAt": "2022-01-24T14:59:11+01:00",
  "data": {
    "id": "PM00000000000000000000001",
    "merchantId": "MERCHANT_ACCOUNT",
    "result": "SUCCESS",
    "storeId": "ST00000000000000000000001",
    "type": "visa"
  },
  "environment": "test",
  "type": "paymentMethod.created"
}

To configure and accept webhooks, see Set up webhooks.