Hmx Accounts

<back to all web services

GetPurchaseOrder

The following routes are available for this service:
GET/api/purchaseorders/{id}Get a PurchaseOrder
import Foundation
import ServiceStack

public class GetPurchaseOrder : Codable
{
    public var id:Int?

    required public init(){}
}

public class PurchaseOrderDto : Codable
{
    public var id:Int?
    public var userId:String?
    public var createdDate:Date?
    public var paymentType:String?
    public var void:Bool?
    public var paid:Bool?
    public var transactionIdentifier:String?
    public var couponCode:String?
    public var orderItems:[PurchaseOrderItem] = []
    public var payer:String?
    public var billingAddressLine1:String?
    public var billingAddressCity:String?
    public var billingAddressState:String?
    public var billingAddressPostalCode:String?
    public var billingAddressCountryCode:String?

    required public init(){}
}

public class PurchaseOrderItem : Codable
{
    public var id:Int?
    // @References(typeof(PurchaseOrder))
    public var purchaseOrderId:Int?

    // @References(typeof(Product))
    public var productId:String?

    public var productName:String?
    public var quantity:Int?
    public var price:Double?
    public var discountDescription:String?
    public var discountSource:String?
    public var discount:Double?
    public var createdDate:Date?

    required public init(){}
}


Swift GetPurchaseOrder 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/{id} HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	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
}