Skip to content

Get Payment Methods ​

List the payment methods available for the current cart.

Endpoint ​

GET /api/shop/payment-methods

The path is /payment-methods. /api/shop/checkout-payment-methods accepts POST only — that is Set Payment Method, not the read.

Request Headers ​

HeaderRequiredDescription
AcceptYesapplication/json
X-STOREFRONT-KEYYesYour storefront API key
AuthorizationYesBearer <cartToken> for a guest, or the customer's Bearer token when signed in

Response Fields ​

The response is a bare array of methods.

FieldTypeDescription
idstringMethod identifier, the same value as method.
methodstringMethod code — send this to Set Payment Method.
titlestringDisplay name configured by the merchant.
descriptionstringDescription shown alongside the option.
iconstringAbsolute URL of the method's icon.
additionalDataobjectExtra configuration a gateway supplies, or null.
isAllowedbooleanWhether the method may be selected for this cart.

Order of the checkout steps ​

Payment methods depend on the steps before them. Calling this before they are complete returns an empty array rather than an error:

  1. Save the checkout address with Set Checkout Address.
  2. Select a rate with Set Shipping Method.
  3. Read this list and let the shopper choose.

Use Cases ​

  • Render the payment step — one call gives the title, icon, and code for every option.
  • Filter what is selectable — hide or disable any method whose isAllowed is false rather than letting the shopper pick it and fail at order placement.

Best Practices ​

  1. Send method, not title, when selecting — the code is the identifier the set endpoint expects
  2. Treat an empty array as "steps outstanding" — it means no address or no shipping method yet, not that the store accepts no payments
  3. Re-read after changing the address — availability can differ by country, so a shipping-address change can add or remove methods
  4. Check isAllowed before rendering — a method can be listed but blocked for this particular cart

Released under the MIT License.