Purchase Queries
This section documents the GraphQL queries available for retrieving information about purchases and orders in the YSCP platform. Purchase queries allow you to fetch details about order history, order status, and specific order details.
Available Queries
The following purchase queries are available:
- CustomerOrdersQuery - Retrieves a list of orders placed by the currently authenticated customer, including order status, date, and total amount.
- OrderQuery - Retrieves detailed information about a specific order by its ID or order number, including items, addresses, totals, and other order-related information.
Common Parameters
Most purchase queries require the following parameters:
orderId: (Optional) The unique identifier of a specific order to retrieve information aboutemail: (Optional) The email address associated with guest orderssiteId: (Optional) The site ID where the order was placed
Authentication
Purchase queries have different authentication requirements:
- Customer order queries (like CustomerOrdersQuery) require the user to be authenticated
- Guest order queries require the email address used during checkout and the order ID
Order Structure
The order structure returned by purchase queries typically includes:
- Order Information: Order ID, date, status, and other basic details
- Customer Information: Customer name, email, and other customer details
- Billing Address: The billing address used for the order
- Shipping Address: The shipping address used for the order
- Payment Information: Payment method and transaction details
- Shipping Information: Shipping method and tracking details
- Items: Products included in the order, with quantities and prices
- Totals: Various total amounts, including subtotal, tax, shipping, and grand total
Examples
Each query documentation includes examples showing how to use the query and what response to expect.