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:
- Your merchant account
- Your user's business line ID
- Your user's store ID
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 | ![]() |
Payment method variant. Some payment methods require an additional object with payment method details. | |
businessLineId | ![]() |
The unique identifier of your user's business line that you want to request a payment method for. | |
storeId | ![]() |
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:
# 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.
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:
# 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.
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:
# 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.
# 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:
To configure and accept webhooks, see Set up webhooks.