MageSmith
QuerySales · Magento 2.4.9

guestOrder

guestOrder is a Magento 2 GraphQL query in the Sales module. Retrieve guest order details based on number, email and billing last name. It returns CustomerOrder! and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

CustomerOrder!

Resolver class

Magento\SalesGraphQl\Model\Resolver\GuestOrder

Cache

cacheable: no

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

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

query ($input: GuestOrderInformationInput!) {
  guestOrder(input: $input) {
    gift_message {
      to
      from
      message
    }
    id
    order_date
    status
    number
    items {
      gift_message {
        to
        from
        message
      }
      id
      product_name
      product_sku
      product_url_key
      product_type
      status
      product_sale_price {
        value
        currency
      }
      discounts {
        amount { ... }
        applied_to
        label
        coupon { ... }
      }
      selected_options {
        label
        value
      }
      entered_options {
        label
        value
      }
      quantity_ordered
      quantity_shipped
      quantity_refunded
      quantity_invoiced
      quantity_canceled
      quantity_returned
      product {
        id
        uid
        name
        sku
        description { ... }
        short_description { ... }
        special_price
        special_from_date
        special_to_date
        attribute_set_id
        meta_title
        meta_keyword
        meta_description
        image { ... }
        small_image { ... }
        thumbnail { ... }
        new_from_date
        new_to_date
        tier_price
        options_container
        created_at
        updated_at
        country_of_manufacture
        type_id
        websites { ... }
        product_links { ... }
        media_gallery_entries { ... }
        price { ... }
        price_range { ... }
        gift_message_available
        manufacturer
        categories { ... }
        canonical_url
        media_gallery { ... }
        custom_attributesV2 { ... }
        tier_prices { ... }
        price_tiers { ... }
        only_x_left_in_stock
        stock_status
        quantity
        min_sale_qty
        max_sale_qty
        url_key
        url_suffix
        url_path
        url_rewrites { ... }
        related_products { ... }
        upsell_products { ... }
        crosssell_products { ... }
        rating_summary
        review_count
        reviews { ... }
        swatch_image
      }
      prices {
        price { ... }
        price_including_tax { ... }
        row_total { ... }
        row_total_including_tax { ... }
        discounts { ... }
        total_item_discount { ... }
        original_price { ... }
        original_price_including_tax { ... }
        original_row_total { ... }
        original_row_total_including_tax { ... }
        fixed_product_taxes { ... }
      }
    }
    total {
      subtotal {
        value
        currency
      }
      discounts {
        amount { ... }
        applied_to
        label
        coupon { ... }
      }
      total_tax {
        value
        currency
      }
      taxes {
        amount { ... }
        title
        rate
      }
      grand_total {
        value
        currency
      }
      base_grand_total {
        value
        currency
      }
      total_shipping {
        value
        currency
      }
      shipping_handling {
        total_amount { ... }
        amount_including_tax { ... }
        amount_excluding_tax { ... }
        taxes { ... }
        discounts { ... }
      }
      subtotal_incl_tax {
        value
        currency
      }
      subtotal_excl_tax {
        value
        currency
      }
      grand_total_excl_tax {
        value
        currency
      }
    }
    invoices {
      id
      number
      total {
        subtotal { ... }
        discounts { ... }
        total_tax { ... }
        taxes { ... }
        grand_total { ... }
        base_grand_total { ... }
        total_shipping { ... }
        shipping_handling { ... }
      }
      items {
        id
        order_item { ... }
        product_name
        product_sku
        product_sale_price { ... }
        discounts { ... }
        quantity_invoiced
      }
      comments {
        timestamp
        message
      }
    }
    shipments {
      id
      number
      tracking {
        title
        carrier
        number
      }
      items {
        id
        order_item { ... }
        product_name
        product_sku
        product_sale_price { ... }
        quantity_shipped
      }
      comments {
        timestamp
        message
      }
    }
    credit_memos {
      id
      number
      items {
        id
        order_item { ... }
        product_name
        product_sku
        product_sale_price { ... }
        discounts { ... }
        quantity_refunded
      }
      total {
        subtotal { ... }
        discounts { ... }
        total_tax { ... }
        taxes { ... }
        grand_total { ... }
        base_grand_total { ... }
        total_shipping { ... }
        shipping_handling { ... }
        adjustment { ... }
      }
      comments {
        timestamp
        message
      }
    }
    payment_methods {
      name
      type
      additional_data {
        name
        value
      }
    }
    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
  }
}

Variables

{
  "input": {
    "email": "",
    "lastname": "",
    "number": ""
  }
}

Every Magento dev tool, in one hosted workspace.

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