MageSmith
MutationPaypal · Magento 2.4.9

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

PaypalExpressTokenOutput

Resolver class

\Magento\PaypalGraphQl\Model\Resolver\PaypalExpressToken

Arguments

input PaypalExpressTokenInput! Required

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

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline
Authorization
Bearer <CUSTOMER_TOKEN> obtain from generateCustomerToken mutation

Query

mutation ($input: PaypalExpressTokenInput!) {
  createPaypalExpressToken(input: $input) {
    token
    paypal_urls {
      start
      edit
    }
  }
}

Variables

{
  "input": {
    "cart_id": "",
    "code": "",
    "urls": {
      "cancel_url": "",
      "return_url": ""
    }
  }
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.