Payment Methods
Update a Payment Method
Storefront API
- Authentication
- Account
- Account / Address
- Account / Credit Cards
- Account / Orders
- Order Status
- Cart
- Cart / Line Items
- Cart / Other
- Cart / Coupons
- Checkout
- Checkout / State
- Checkout / Shipments
- Checkout / Payments
- Checkout / Store Credit
- Stripe
- Products
- Vendors
- Stores
- Taxons
- Countries
- CMS Pages
- Menus
- Wishlists
- Wishlists / Wished Items
- Digital Downloads
Platform API
- Authentication
- Addresses
- Adjustments
- Classifications
- CMS Pages
- CMS Sections
- Countries
- Data Feeds
- Digital Links
- Digital Assets
- Line Items
- Menu Items
- Menus
- Option Types
- Option Values
- Orders
- Payment Methods
- Payments
- Products
- Promotion Actions
- Promotion Categories
- Promotion Rules
- Promotions
- Roles
- Shipments
- Shipping Categories
- Shipping Methods
- States
- Stock Items
- Stock Locations
- Store Credit Categories
- Store Credit Types
- Store Credits
- Tax Categories
- Tax Rates
- Taxonomies
- Taxons
- Users
- Variants
- Vendors
- Webhook Events
- Webhook Subscribers
- Wished Items
- Wishlists
- Zones
Payment Methods
Update a Payment Method
Updates a Payment Method
PATCH
/
api
/
v2
/
platform
/
payment_methods
/
{id}
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/payment_methods/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_method": {
"name": "Test Payment Method",
"active": true,
"auto_capture": true,
"description": "This is a test payment method",
"type": "Spree::Gateway::Bogus",
"display_on": "both",
"store_ids": [
"2"
],
"public_metadata": {},
"private_metadata": {}
}
}'
{
"data": {
"id": "40",
"type": "payment_method",
"attributes": {
"name": "Credit Card",
"type": "Spree::Gateway::Bogus",
"description": null,
"active": true,
"display_on": "both",
"auto_capture": null,
"position": 3,
"created_at": "2022-11-08T19:34:49.452Z",
"updated_at": "2022-11-08T19:34:49.687Z",
"deleted_at": null,
"public_metadata": {},
"private_metadata": {},
"preferences": {
"dummy_key": "UPDATED-DUMMY-KEY-123",
"test_mode": false,
"server": "production"
}
},
"relationships": {
"stores": {
"data": [
{
"id": "301",
"type": "store"
}
]
}
}
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
Query Parameters
Select which associated resources you would like to fetch, see: <a href="https://jsonapi.org/format/#fetching-includes">https://jsonapi.org/format/#fetching-includes</a>
Body
application/json
Example:
"Test Payment Method"
Example:
"This is a test payment method"
Available options:
Spree::Gateway::Bogus
, Spree::PaymentMethod::Check
Example:
"Spree::Gateway::Bogus"
Available options:
both
, back_end
, front_end
Example:
"both"
Was this page helpful?
curl --request PATCH \
--url http://{defaultHost}/api/v2/platform/payment_methods/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_method": {
"name": "Test Payment Method",
"active": true,
"auto_capture": true,
"description": "This is a test payment method",
"type": "Spree::Gateway::Bogus",
"display_on": "both",
"store_ids": [
"2"
],
"public_metadata": {},
"private_metadata": {}
}
}'
{
"data": {
"id": "40",
"type": "payment_method",
"attributes": {
"name": "Credit Card",
"type": "Spree::Gateway::Bogus",
"description": null,
"active": true,
"display_on": "both",
"auto_capture": null,
"position": 3,
"created_at": "2022-11-08T19:34:49.452Z",
"updated_at": "2022-11-08T19:34:49.687Z",
"deleted_at": null,
"public_metadata": {},
"private_metadata": {},
"preferences": {
"dummy_key": "UPDATED-DUMMY-KEY-123",
"test_mode": false,
"server": "production"
}
},
"relationships": {
"stores": {
"data": [
{
"id": "301",
"type": "store"
}
]
}
}
}
}