Hmx Accounts

<back to all web services

GetPurchaseOrders

The following routes are available for this service:
GET/api/purchaseordersSearch for PurchaseOrders
import 'package:servicestack/servicestack.dart';

class PurchaseOrderItem implements IConvertible
{
    int? id;
    // @References(typeof(PurchaseOrder))
    int? purchaseOrderId;

    // @References(typeof(Product))
    String? productId;

    String? productName;
    int? quantity;
    double? price;
    String? discountDescription;
    String? discountSource;
    double? discount;
    DateTime? createdDate;

    PurchaseOrderItem({this.id,this.purchaseOrderId,this.productId,this.productName,this.quantity,this.price,this.discountDescription,this.discountSource,this.discount,this.createdDate});
    PurchaseOrderItem.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        purchaseOrderId = json['purchaseOrderId'];
        productId = json['productId'];
        productName = json['productName'];
        quantity = json['quantity'];
        price = JsonConverters.toDouble(json['price']);
        discountDescription = json['discountDescription'];
        discountSource = json['discountSource'];
        discount = JsonConverters.toDouble(json['discount']);
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'purchaseOrderId': purchaseOrderId,
        'productId': productId,
        'productName': productName,
        'quantity': quantity,
        'price': price,
        'discountDescription': discountDescription,
        'discountSource': discountSource,
        'discount': discount,
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!)
    };

    getTypeName() => "PurchaseOrderItem";
    TypeContext? context = _ctx;
}

class PurchaseOrderDto implements IConvertible
{
    int? id;
    String? userId;
    DateTime? createdDate;
    String? paymentType;
    bool? Void;
    bool? paid;
    String? transactionIdentifier;
    String? couponCode;
    List<PurchaseOrderItem>? orderItems;
    String? payer;
    String? billingAddressLine1;
    String? billingAddressCity;
    String? billingAddressState;
    String? billingAddressPostalCode;
    String? billingAddressCountryCode;

    PurchaseOrderDto({this.id,this.userId,this.createdDate,this.paymentType,this.Void,this.paid,this.transactionIdentifier,this.couponCode,this.orderItems,this.payer,this.billingAddressLine1,this.billingAddressCity,this.billingAddressState,this.billingAddressPostalCode,this.billingAddressCountryCode});
    PurchaseOrderDto.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        userId = json['userId'];
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        paymentType = json['paymentType'];
        Void = json['void'];
        paid = json['paid'];
        transactionIdentifier = json['transactionIdentifier'];
        couponCode = json['couponCode'];
        orderItems = JsonConverters.fromJson(json['orderItems'],'List<PurchaseOrderItem>',context!);
        payer = json['payer'];
        billingAddressLine1 = json['billingAddressLine1'];
        billingAddressCity = json['billingAddressCity'];
        billingAddressState = json['billingAddressState'];
        billingAddressPostalCode = json['billingAddressPostalCode'];
        billingAddressCountryCode = json['billingAddressCountryCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'userId': userId,
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'paymentType': paymentType,
        'void': Void,
        'paid': paid,
        'transactionIdentifier': transactionIdentifier,
        'couponCode': couponCode,
        'orderItems': JsonConverters.toJson(orderItems,'List<PurchaseOrderItem>',context!),
        'payer': payer,
        'billingAddressLine1': billingAddressLine1,
        'billingAddressCity': billingAddressCity,
        'billingAddressState': billingAddressState,
        'billingAddressPostalCode': billingAddressPostalCode,
        'billingAddressCountryCode': billingAddressCountryCode
    };

    getTypeName() => "PurchaseOrderDto";
    TypeContext? context = _ctx;
}

class GetPurchaseOrdersResponse implements IConvertible
{
    List<PurchaseOrderDto>? results;

    GetPurchaseOrdersResponse({this.results});
    GetPurchaseOrdersResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        results = JsonConverters.fromJson(json['results'],'List<PurchaseOrderDto>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'results': JsonConverters.toJson(results,'List<PurchaseOrderDto>',context!)
    };

    getTypeName() => "GetPurchaseOrdersResponse";
    TypeContext? context = _ctx;
}

class GetPurchaseOrders implements IConvertible
{
    String? userId;
    DateTime? fromDate;
    DateTime? toDate;
    bool? Void;
    bool? paid;
    String? transactionIdentifier;
    String? couponCode;

    GetPurchaseOrders({this.userId,this.fromDate,this.toDate,this.Void,this.paid,this.transactionIdentifier,this.couponCode});
    GetPurchaseOrders.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        userId = json['userId'];
        fromDate = JsonConverters.fromJson(json['fromDate'],'DateTime',context!);
        toDate = JsonConverters.fromJson(json['toDate'],'DateTime',context!);
        Void = json['void'];
        paid = json['paid'];
        transactionIdentifier = json['transactionIdentifier'];
        couponCode = json['couponCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'userId': userId,
        'fromDate': JsonConverters.toJson(fromDate,'DateTime',context!),
        'toDate': JsonConverters.toJson(toDate,'DateTime',context!),
        'void': Void,
        'paid': paid,
        'transactionIdentifier': transactionIdentifier,
        'couponCode': couponCode
    };

    getTypeName() => "GetPurchaseOrders";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'accounts.dev.healthmonix.com', types: <String, TypeInfo> {
    'PurchaseOrderItem': TypeInfo(TypeOf.Class, create:() => PurchaseOrderItem()),
    'PurchaseOrderDto': TypeInfo(TypeOf.Class, create:() => PurchaseOrderDto()),
    'List<PurchaseOrderItem>': TypeInfo(TypeOf.Class, create:() => <PurchaseOrderItem>[]),
    'GetPurchaseOrdersResponse': TypeInfo(TypeOf.Class, create:() => GetPurchaseOrdersResponse()),
    'List<PurchaseOrderDto>': TypeInfo(TypeOf.Class, create:() => <PurchaseOrderDto>[]),
    'GetPurchaseOrders': TypeInfo(TypeOf.Class, create:() => GetPurchaseOrders()),
});

Dart GetPurchaseOrders DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /api/purchaseorders HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<GetPurchaseOrdersResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Hmx.Accounts.ServiceModels">
  <Results>
    <PurchaseOrderDto>
      <BillingAddressCity>String</BillingAddressCity>
      <BillingAddressCountryCode>String</BillingAddressCountryCode>
      <BillingAddressLine1>String</BillingAddressLine1>
      <BillingAddressPostalCode>String</BillingAddressPostalCode>
      <BillingAddressState>String</BillingAddressState>
      <CouponCode>String</CouponCode>
      <CreatedDate>0001-01-01T00:00:00</CreatedDate>
      <Id>0</Id>
      <OrderItems xmlns:d4p1="http://schemas.datacontract.org/2004/07/Hmx.Accounts.Models">
        <d4p1:PurchaseOrderItem>
          <d4p1:CreatedDate>0001-01-01T00:00:00</d4p1:CreatedDate>
          <d4p1:Discount>0</d4p1:Discount>
          <d4p1:DiscountDescription>String</d4p1:DiscountDescription>
          <d4p1:DiscountSource>String</d4p1:DiscountSource>
          <d4p1:Id>0</d4p1:Id>
          <d4p1:Price>0</d4p1:Price>
          <d4p1:ProductId>String</d4p1:ProductId>
          <d4p1:ProductName>String</d4p1:ProductName>
          <d4p1:PurchaseOrderId>0</d4p1:PurchaseOrderId>
          <d4p1:Quantity>0</d4p1:Quantity>
        </d4p1:PurchaseOrderItem>
      </OrderItems>
      <Paid>false</Paid>
      <Payer>String</Payer>
      <PaymentType>String</PaymentType>
      <TransactionIdentifier>String</TransactionIdentifier>
      <UserId>String</UserId>
      <Void>false</Void>
    </PurchaseOrderDto>
  </Results>
</GetPurchaseOrdersResponse>