createPaypalExpressToken
createPaypalExpressToken is a Magento 2 GraphQL mutation in the Paypal module. Initiate an Express Checkout transaction and receive a token. Use this mutation for Express Checkout and Payments Standard payment methods. It returns PaypalExpressTokenOutput and requires an Authorization header (Bearer customer token).
Last verified: against Magento 2.4.9.
Returns
Resolver class
\Magento\PaypalGraphQl\Model\Resolver\PaypalExpressToken
Arguments
An input object that defines the requirements to receive a payment token.
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 ($input: PaypalExpressTokenInput!) {
createPaypalExpressToken(input: $input) {
token
paypal_urls {
start
edit
}
}
}Variables
{
"input": {
"cart_id": "",
"code": "",
"urls": {
"cancel_url": "",
"return_url": ""
}
}
}Related in PaypalGraphQl
Other fields shipped by the same module.
createPayflowProToken
Initiate a transaction and receive a token. Use this mutation for Payflow Pro and Payments Pro payment methods
Paypal · returns CreatePayflowProTokenOutput
getHostedProUrl
Retrieve the secure PayPal URL for a Payments Pro Hosted Solution transaction.
Paypal · returns HostedProUrl
getPayflowLinkToken
Retrieve payment credentials for a transaction. Use this query for Payflow Link and Payments Advanced payment methods.
Paypal · returns PayflowLinkToken
handlePayflowProResponse
Handle a payment response and save the payment in Quote. Use this mutation for Payflow Pro and Payments Pro payment methods.
Paypal · returns PayflowProResponseOutput
Every Magento dev tool, in one hosted workspace.
Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.