Orders
magento-2Consulta de pedidos, invoices, shipments, refund. Reorder. Cancel order.
query customer.orders
Bearer
query customer.orders — List orders of authenticated customer (same as in Customer section, full reference here)
query customer.orders
List orders of authenticated customer (same as in Customer section, full reference here).
{
customer {
orders(
filter: { number: { match: "00000" } }
sort: { sort_field: CREATED_AT, sort_direction: DESC }
pageSize: 10, currentPage: 1
) {
total_count
page_info { total_pages }
items {
id number order_date status created_at
billing_address { firstname lastname city country_code }
shipping_address { firstname lastname city country_code }
payment_methods { name type additional_data { name value } }
items {
product_name product_sku product_url_key
quantity_ordered quantity_invoiced quantity_shipped
product_sale_price { value currency }
}
total {
grand_total { value currency }
subtotal { value }
total_tax { value }
total_shipping { value }
discounts { amount { value } label }
}
invoices { number total { grand_total { value } } }
shipments {
number
tracking { carrier title number }
}
credit_memos { number total { grand_total { value } } }
}
}
}
}
query guestOrderByToken
query guestOrderByToken — Retrieve a guest order using the email token
query guestOrderByToken
Retrieve a guest order using the email token.
Permite que um guest consulte o próprio pedido sem criar conta — útil no "my account as guest" pós-pedido.
query guestOrder
query guestOrder — Retrieve a guest order by order number + email
query guestOrder
Retrieve a guest order by order number + email.
query {
guestOrder(input: {
number: "000000042"
email: "guest@example.com"
postcode: "12345"
}) {
number status
items { product_name quantity_ordered }
total { grand_total { value currency } }
}
}
mutation reorderItems
Bearer
mutation reorderItems — Re-add a previous order's items to the current cart
mutation reorderItems
Re-add a previous order's items to the current cart.
Só funciona para o cliente logado (usa token). Retorna user_input_errors caso algum item esteja indisponível.
mutation cancelOrder
Bearer
mutation cancelOrder — Cancel a customer order (pending/on-hold)
mutation cancelOrder
Cancel a customer order (pending/on-hold).
Requer que a config Sales > Cancellation > Enable Order Cancellation esteja ativa. Apenas pedidos em status pending, pending_payment ou on_hold.