Skip to content
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

FieldTypeDescription
codeString!Method code, for example card or cash_on_delivery.
nameString!Name shown to the shopper.
kindString!offline, card, wallet or other.
sortOrderInt!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

Terminal
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 } }"
  }'
Response
{
  "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

CodeCause
STORE_CONTEXT_REQUIREDx-Store-Domain is missing or doesn't match a store.

REST equivalent

GET /v1/payments/methods returns the same list.

Last updated:

On this page