MageSmith
MutationPaymentServicesPaypal · Magento 2.4.9

createPaymentOrder

createPaymentOrder is a Magento 2 GraphQL mutation in the PaymentServicesPaypal module. Creates a payment order for further payment processing. It returns CreatePaymentOrderOutput and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

CreatePaymentOrderOutput

Resolver class

\Magento\PaymentServicesPaypalGraphQl\Model\Resolver\CreatePaymentOrder

Arguments

input CreatePaymentOrderInput! Required

Contains payment order details that are used while processing the payment order

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: CreatePaymentOrderInput!) {
  createPaymentOrder(input: $input) {
    status
    mp_order_id
    id
    amount
    currency_code
  }
}

Variables

{
  "input": {
    "cartId": "",
    "location": "PRODUCT_DETAIL",
    "methodCode": "",
    "paymentSource": ""
  }
}

Every Magento dev tool, in one hosted workspace.

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