List Payment Methods
Returns a list of available payment methods for this checkout.
GET
/
api
/
v2
/
storefront
/
checkout
/
payment_methods
List Payment Methods
const options = {method: 'GET', headers: {'X-Spree-Order-Token': '<api-key>'}};
fetch('https://demo.spreecommerce.org/api/v2/storefront/checkout/payment_methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://demo.spreecommerce.org/api/v2/storefront/checkout/payment_methods \
--header 'X-Spree-Order-Token: <api-key>'{
"data": [
{
"id": "1",
"type": "payment_method",
"attributes": {
"type": "Spree::Gateway::Bogus",
"name": "Credit Card",
"description": "Bogus payment gateway.",
"preferences": {
"dummy_key": "PUBLICKEY123"
}
}
},
{
"id": "2",
"type": "payment_method",
"attributes": {
"type": "Spree::PaymentMethod::Check",
"name": "Check",
"description": "Pay by check.",
"preferences": {}
}
}
]
}{
"error": "The resource you were looking for could not be found."
}Authorizations
orderTokenbearerAuth
Order token to authorize Cart and Checkout requests.
Response
200 Success - Returns an array of payment_method objects.
Show child attributes
Show child attributes
Was this page helpful?
List Payment Methods
const options = {method: 'GET', headers: {'X-Spree-Order-Token': '<api-key>'}};
fetch('https://demo.spreecommerce.org/api/v2/storefront/checkout/payment_methods', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://demo.spreecommerce.org/api/v2/storefront/checkout/payment_methods \
--header 'X-Spree-Order-Token: <api-key>'{
"data": [
{
"id": "1",
"type": "payment_method",
"attributes": {
"type": "Spree::Gateway::Bogus",
"name": "Credit Card",
"description": "Bogus payment gateway.",
"preferences": {
"dummy_key": "PUBLICKEY123"
}
}
},
{
"id": "2",
"type": "payment_method",
"attributes": {
"type": "Spree::PaymentMethod::Check",
"name": "Check",
"description": "Pay by check.",
"preferences": {}
}
}
]
}{
"error": "The resource you were looking for could not be found."
}
