Queries
paymentMethods
Payment methods offered at the store's checkout.
paymentMethods returns the checkout's payment methods: the ones the store enabled that can be charged in its country and currency. Use it to show how shoppers can pay before they reach checkout.
paymentMethods: [StorefrontPaymentMethodDto!]!It takes no arguments. A store with no available methods returns [].
StorefrontPaymentMethodDto
| Field | Type | Description |
|---|---|---|
code | String! | Method code, for example card or cash_on_delivery. |
name | String! | Name shown to the shopper. |
kind | String! | offline, card, wallet or other. |
sortOrder | Int! | Position set by the store. |
brands | [String!]! | Brands to display, for example visa. Can be []. |
The list comes in checkout order: the default method first, then the rest by sortOrder and name. Display it in that order.
Example
curl --request POST "https://storefront.ecomiq.pe/graphql" \
--header "Content-Type: application/json" \
--header "x-Store-Domain: my-store" \
--data-binary '{
"query": "query PaymentMethods { paymentMethods { code name kind sortOrder brands } }"
}'{
"data": {
"paymentMethods": [
{
"code": "card",
"name": "Credit or debit card",
"kind": "card",
"sortOrder": 30,
"brands": ["visa", "mastercard", "amex"]
},
{
"code": "cash_on_delivery",
"name": "Cash on delivery",
"kind": "offline",
"sortOrder": 10,
"brands": []
},
{
"code": "apple_pay",
"name": "Apple Pay",
"kind": "wallet",
"sortOrder": 32,
"brands": []
}
]
}
}card comes first because it's the default method, even though its sortOrder is higher.
Errors
| Code | Cause |
|---|---|
STORE_CONTEXT_REQUIRED | x-Store-Domain is missing or doesn't match a store. |
REST equivalent
GET / returns the same list.
Last updated: