OrderApi class

Order API for Magento integration.

This class provides comprehensive order management functionality for Magento, including order retrieval, tracking, and order-related operations.

Features

  • Order Listing: Get customer orders with pagination and filtering
  • Order Details: Retrieve detailed order information by ID
  • Order Tracking: Track order status and shipment information
  • Order History: Access complete order history for customers
  • Order Search: Search orders by various criteria
  • Order Status: Check order status and updates

Usage

final orderApi = OrderApi(apiClient);

// Get customer orders
final orders = await orderApi.getCustomerOrders(
  page: 1,
  pageSize: 20,
);

// Get specific order
final order = await orderApi.getOrder('ORDER-123');

Constructors

OrderApi.new(MagentoApiClient _client)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancelOrder(String orderId, {String? reason}) Future<bool>
Cancel order
cancelReturn(String returnId) Future<bool>
Cancel return
createReturn({required String orderId, required List<ReturnItem> items, String? comment}) Future<Return>
Create return for order
getCreditMemo(String creditMemoId) Future<CreditMemo>
Get credit memo details
getCreditMemoPdf(String creditMemoId) Future<String>
Get credit memo PDF
getCustomerOrders({int page = 1, int pageSize = 20, Map<String, dynamic>? filters}) Future<OrderListResponse>
Get customer orders with pagination and filters
getCustomerReturns({int page = 1, int pageSize = 20, Map<String, dynamic>? filters}) Future<List<Return>>
Get customer returns
getInvoice(String invoiceId) Future<Invoice>
Get invoice details
getInvoicePdf(String invoiceId) Future<String>
Get invoice PDF
getOrder(String orderId) Future<Order>
Get order by ID
getOrderByIncrementId(String incrementId) Future<Order>
Get order by increment ID
getOrderComments(String orderId) Future<List<OrderComment>>
Get order comments
getOrderCreditMemos(String orderId) Future<List<CreditMemo>>
Get order credit memos
getOrderHistory(String orderId) Future<List<OrderHistory>>
Get order history
getOrderInvoices(String orderId) Future<List<Invoice>>
Get order invoices
getOrderItems(String orderId) Future<List<OrderItem>>
Get order items
getOrderShipments(String orderId) Future<List<Shipment>>
Get order shipments
getOrderStatus(String orderId) Future<String>
Get order status
getOrderTotals(String orderId) Future<OrderTotals>
Get order totals
getReturn(String returnId) Future<Return>
Get return details
getShipment(String shipmentId) Future<Shipment>
Get shipment details
getShipmentTracking(String shipmentId) Future<List<ShipmentTracking>>
Get shipment tracking
getShippingLabel(String shipmentId) Future<String>
Get shipping label
holdOrder(String orderId) Future<bool>
Hold order
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reorder(String orderId) Future<Cart>
Reorder - create new cart from existing order
toString() String
A string representation of this object.
inherited
unholdOrder(String orderId) Future<bool>
Unhold order
updateReturn({required String returnId, required Map<String, dynamic> data}) Future<Return>
Update return

Operators

operator ==(Object other) bool
The equality operator.
inherited