toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'parent_id': parentId,
    'number': number,
    'order_key': orderKey,
    'created_via': createdVia,
    'version': version,
    'status': status,
    'currency': currency,
    'date_created': dateCreated?.toIso8601String(),
    'date_created_gmt': dateCreatedGmt?.toIso8601String(),
    'date_modified': dateModified?.toIso8601String(),
    'date_modified_gmt': dateModifiedGmt?.toIso8601String(),
    'discount_total': discountTotal,
    'discount_tax': discountTax,
    'shipping_total': shippingTotal,
    'shipping_tax': shippingTax,
    'cart_tax': cartTax,
    'total': total,
    'total_tax': totalTax,
    'prices_include_tax': pricesIncludeTax,
    'customer_id': customerId,
    'customer_ip_address': customerIpAddress,
    'customer_user_agent': customerUserAgent,
    'customer_note': customerNote,
    'billing': billing,
    'shipping': shipping,
    'payment_method': paymentMethod,
    'payment_method_title': paymentMethodTitle,
    'transaction_id': transactionId,
    'date_paid': datePaid?.toIso8601String(),
    'date_paid_gmt': datePaidGmt?.toIso8601String(),
    'date_completed': dateCompleted?.toIso8601String(),
    'date_completed_gmt': dateCompletedGmt?.toIso8601String(),
    'cart_hash': cartHash,
    'meta_data': metaData,
    'line_items': lineItems,
    'tax_lines': taxLines,
    'shipping_lines': shippingLines,
    'fee_lines': feeLines,
    'coupon_lines': couponLines,
    'refunds': refunds,
    'set_paid': setPaid,
  };
}