MageSmith
MutationOrderCancellation · Magento 2.4.9

requestGuestOrderCancel

requestGuestOrderCancel is a Magento 2 GraphQL mutation in the OrderCancellation module. Request to cancel specified guest order. It returns CancelOrderOutput and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

CancelOrderOutput

Resolver class

Magento\OrderCancellationGraphQl\Model\Resolver\RequestGuestOrderCancel

Arguments

input GuestOrderCancelInput! Required

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: GuestOrderCancelInput!) {
  requestGuestOrderCancel(input: $input) {
    error
    order {
      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
    }
    errorV2 {
      message
      code
    }
  }
}

Variables

{
  "input": {
    "reason": "",
    "token": ""
  }
}

Every Magento dev tool, in one hosted workspace.

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