Payment Methods
This endpoint tells you which payment methods are available for a particular site. You'll use it in the Advanced flow when you want to control what's shown to the customer, or when you're using individual Adyen Components instead of the Drop-in.
If you're using the Sessions flow, you don't need this -- the Drop-in gets payment methods on its own.
This mirrors Adyen's /paymentMethods endpoint.
Request
POST /v1/ecom/{siteId}/payment-methods
Path:
| Parameter | Type | What it is |
|---|---|---|
siteId | string | Your ecommerce site ID |
Headers:
| Header | Needed? | What to send |
|---|---|---|
Authorization | Yes | Bearer YOUR_API_KEY |
Content-Type | Yes | application/json |
Idempotency-Key | No | A unique key to stop duplicates. See Best Practices. |
Body:
| Field | Type | Needed? | What it is |
|---|---|---|---|
amount | object | Yes | The payment amount. This helps filter methods by what's available for that amount. |
amount.value | integer | Yes | Amount in minor units (so 1000 for 10.00). |
amount.currency | string | Yes | Three-letter currency code, like GBP. |
blockedPaymentMethods | string[] | No | Any extra payment methods you want to leave out. |
shopperLocale | string | No | Locale for localised method names, like en-GB. Defaults to en-GB if you leave it out. |
Things we handle for you
- Blocked methods:
sepadirectdebit,bacs, anddirectdebit_GBare always left out. Anything you add toblockedPaymentMethodsgets added to that list. - Channel: Automatically set to
Web. - Country: Set to your merchant's registered country.
- Filtering: Results only include methods that are available for your specific site.
Response
You'll get back an Adyen PaymentMethodsResponse with a list of what's available. Pass this to Adyen Components on the frontend.
| Field | Type | What it is |
|---|---|---|
paymentMethods | object[] | The payment methods your customer can use. |
storedPaymentMethods | object[] | Any saved (tokenised) payment methods, if there are any. |
The full shape follows Adyen's paymentMethods response.
Example
Making the request:
curl -X POST https://api.yeti.host/v1/ecom/YOUR_SITE_ID/payment-methods \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": {
"value": 5000,
"currency": "GBP"
},
"shopperLocale": "en-GB"
}'
Using it on the frontend:
const paymentMethodsResponse = await fetchPaymentMethods(); // your server call
const checkout = await AdyenCheckout({
environment: "live",
clientKey: clientToken,
paymentMethodsResponse,
onSubmit: async (state, component) => {
// Send state.data.paymentMethod to POST /payments on your server
const result = await makePayment(state.data);
// Then handle the result
},
onAdditionalDetails: async (state, component) => {
// Send state.data to POST /payments/details on your server
const result = await submitDetails(state.data);
// Then handle the result
},
});
checkout.create("card").mount("#card-container");
For the full frontend setup, check out the Adyen Web Components guide.
What could go wrong
| Status | Code | What it means |
|---|---|---|
| 400 | yp_2002 | Something's wrong with the request |
| 403 | yp_1002 | Your API key isn't allowed to call this endpoint |
| 404 | yp_3004 | We can't find that site, or it's not an ecommerce site |
| 404 | yp_3005 | We can't find the merchant |
| 409 | yp_3004 | This site type can't be used for this |
| 422 | yp_5003 | Your merchant account isn't set up for ECOM yet |
| 500 | yp_4002 | Something went wrong fetching payment methods |