Hmx Accounts

<back to all web services

GetPurchaseOrders

The following routes are available for this service:
GET/api/purchaseordersSearch for PurchaseOrders
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Hmx.Accounts.ServiceModels;
using Hmx.Accounts.Models;

namespace Hmx.Accounts.Models
{
    public partial class PurchaseOrderItem
    {
        public virtual int Id { get; set; }
        [References(typeof(Hmx.Accounts.Models.PurchaseOrder))]
        public virtual int PurchaseOrderId { get; set; }

        [References(typeof(Hmx.Accounts.Models.Product))]
        public virtual string ProductId { get; set; }

        public virtual string ProductName { get; set; }
        public virtual int Quantity { get; set; }
        public virtual decimal Price { get; set; }
        public virtual string DiscountDescription { get; set; }
        public virtual string DiscountSource { get; set; }
        public virtual decimal Discount { get; set; }
        public virtual DateTime CreatedDate { get; set; }
    }

}

namespace Hmx.Accounts.ServiceModels
{
    public partial class GetPurchaseOrders
    {
        public virtual string UserId { get; set; }
        public virtual DateTime? FromDate { get; set; }
        public virtual DateTime? ToDate { get; set; }
        public virtual bool? Void { get; set; }
        public virtual bool? Paid { get; set; }
        public virtual string TransactionIdentifier { get; set; }
        public virtual string CouponCode { get; set; }
    }

    public partial class GetPurchaseOrdersResponse
    {
        public GetPurchaseOrdersResponse()
        {
            Results = new List<PurchaseOrderDto>{};
        }

        public virtual List<PurchaseOrderDto> Results { get; set; }
    }

    public partial class PurchaseOrderDto
    {
        public PurchaseOrderDto()
        {
            OrderItems = new List<PurchaseOrderItem>{};
        }

        public virtual int Id { get; set; }
        public virtual string UserId { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual string PaymentType { get; set; }
        public virtual bool Void { get; set; }
        public virtual bool Paid { get; set; }
        public virtual string TransactionIdentifier { get; set; }
        public virtual string CouponCode { get; set; }
        public virtual List<PurchaseOrderItem> OrderItems { get; set; }
        public virtual string Payer { get; set; }
        public virtual string BillingAddressLine1 { get; set; }
        public virtual string BillingAddressCity { get; set; }
        public virtual string BillingAddressState { get; set; }
        public virtual string BillingAddressPostalCode { get; set; }
        public virtual string BillingAddressCountryCode { get; set; }
    }

}

C# GetPurchaseOrders DTOs

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

HTTP + JSV

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: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	results: 
	[
		{
			id: 0,
			userId: String,
			createdDate: 0001-01-01,
			paymentType: String,
			void: False,
			paid: False,
			transactionIdentifier: String,
			couponCode: String,
			orderItems: 
			[
				{
					id: 0,
					purchaseOrderId: 0,
					productId: String,
					productName: String,
					quantity: 0,
					price: 0,
					discountDescription: String,
					discountSource: String,
					discount: 0,
					createdDate: 0001-01-01
				}
			],
			payer: String,
			billingAddressLine1: String,
			billingAddressCity: String,
			billingAddressState: String,
			billingAddressPostalCode: String,
			billingAddressCountryCode: String
		}
	]
}