MageSmith
QuerySales · Magento 2.4.9 Deprecated

customerOrders

customerOrders is a Magento 2 GraphQL query in the Sales module. It returns CustomerOrders and requires an Authorization header (Bearer customer token).

Deprecated: Use the `customer` query instead.

Last verified: against Magento 2.4.9.

Returns

CustomerOrders

Resolver class

Magento\SalesGraphQl\Model\Resolver\Orders

Cache

cacheable: no

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 {
  customerOrders {
    items {
      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
    }
    page_info {
      page_size
      current_page
      total_pages
    }
    total_count
    date_of_first_order
  }
}

Variables

{}

Every Magento dev tool, in one hosted workspace.

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