setPaymentMethodAndPlaceOrder
setPaymentMethodAndPlaceOrder is a Magento 2 GraphQL mutation in the Quote module. Set the cart payment method and convert the cart into an order. It returns PlaceOrderOutput and requires an Authorization header (Bearer customer token).
Deprecated: Should use setPaymentMethodOnCart and placeOrder mutations in single request.
Last verified: against Magento 2.4.9.
Returns
Resolver class
\Magento\QuoteGraphQl\Model\Resolver\SetPaymentAndPlaceOrder
Arguments
Example request
Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.
Headers
Query
mutation {
setPaymentMethodAndPlaceOrder {
order {
order_number
order_id
}
orderV2 {
gift_message {
to
from
message
}
id
order_date
status
number
items {
gift_message { ... }
id
product_name
product_sku
product_url_key
product_type
status
product_sale_price { ... }
discounts { ... }
selected_options { ... }
entered_options { ... }
quantity_ordered
quantity_shipped
quantity_refunded
quantity_invoiced
quantity_canceled
quantity_returned
product { ... }
prices { ... }
}
total {
subtotal { ... }
discounts { ... }
total_tax { ... }
taxes { ... }
grand_total { ... }
base_grand_total { ... }
total_shipping { ... }
shipping_handling { ... }
subtotal_incl_tax { ... }
subtotal_excl_tax { ... }
grand_total_excl_tax { ... }
}
invoices {
id
number
total { ... }
items { ... }
comments { ... }
}
shipments {
id
number
tracking { ... }
items { ... }
comments { ... }
}
credit_memos {
id
number
items { ... }
total { ... }
comments { ... }
}
payment_methods {
name
type
additional_data { ... }
}
shipping_address {
firstname
lastname
middlename
region
region_id
country_code
street
company
telephone
fax
postcode
city
prefix
suffix
vat_id
}
billing_address {
firstname
lastname
middlename
region
region_id
country_code
street
company
telephone
fax
postcode
city
prefix
suffix
vat_id
}
carrier
shipping_method
comments {
timestamp
message
}
increment_id
order_number
created_at
grand_total
token
applied_coupons {
code
}
email
is_virtual
available_actions
customer_info {
firstname
lastname
middlename
prefix
suffix
}
order_status_change_date
}
errors {
message
code
}
}
}Variables
{}Related in QuoteGraphQl
Other fields shipped by the same module.
addProductsToCart
Add any type of product to the cart.
Quote · returns AddProductsToCartOutput
addSimpleProductsToCart
Add one or more simple products to the specified cart. We recommend using `addProductsToCart` instead.
Quote · returns AddSimpleProductsToCartOutput
addVirtualProductsToCart
Add one or more virtual products to the specified cart. We recommend using `addProductsToCart` instead.
Quote · returns AddVirtualProductsToCartOutput
applyCouponToCart
Apply a pre-defined coupon code to the specified cart.
Quote · returns ApplyCouponToCartOutput
assignCustomerToGuestCart
phpcs:ignore Magento2.GraphQL.ValidArgumentName
Quote · returns Cart!
cart
phpcs:ignore Magento2.GraphQL.ValidArgumentName
Quote · returns Cart
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.