Hmx Accounts

<back to all web services

CreatePurchaseOrder

The following routes are available for this service:
POST/api/purchaseordersCreate a new PurchaseOrder

export class PurchaseOrderItem
{
    public id?: number;
    // @References("typeof(Hmx.Accounts.Models.PurchaseOrder)")
    public purchaseOrderId?: number;

    // @References("typeof(Hmx.Accounts.Models.Product)")
    public productId?: string;

    public productName?: string;
    public quantity?: number;
    public price?: number;
    public discountDescription?: string;
    public discountSource?: string;
    public discount?: number;
    public createdDate?: string;

    public constructor(init?: Partial<PurchaseOrderItem>) { (Object as any).assign(this, init); }
}

export class PurchaseOrderDto
{
    public id?: number;
    public userId?: string;
    public createdDate?: string;
    public paymentType?: string;
    public void?: boolean;
    public paid?: boolean;
    public transactionIdentifier?: string;
    public couponCode?: string;
    public orderItems?: PurchaseOrderItem[];
    public payer?: string;
    public billingAddressLine1?: string;
    public billingAddressCity?: string;
    public billingAddressState?: string;
    public billingAddressPostalCode?: string;
    public billingAddressCountryCode?: string;

    public constructor(init?: Partial<PurchaseOrderDto>) { (Object as any).assign(this, init); }
}

export class Details
{
    public code?: string;
    public field?: string;
    public issue?: string;

    public constructor(init?: Partial<Details>) { (Object as any).assign(this, init); }
}

export class CreatePurchaseOrderResponse
{
    public message?: string;
    public status?: HttpStatusCode;
    public purchaseOrder?: PurchaseOrderDto;
    public details?: Details[];

    public constructor(init?: Partial<CreatePurchaseOrderResponse>) { (Object as any).assign(this, init); }
}

export class PurchaseOrderItemDto
{
    public id?: number;
    public purchaseOrderId?: number;
    public productId?: string;
    public productName?: string;
    public quantity?: number;
    public price?: number;
    public discountDescription?: string;
    public discountSource?: string;
    public discount?: number;
    public createdDate?: string;

    public constructor(init?: Partial<PurchaseOrderItemDto>) { (Object as any).assign(this, init); }
}

export class BillingInformationDto
{
    public cardNumber?: string;
    public cardType?: string;
    public expireMonth?: number;
    public expireYear?: number;
    public cvv2?: string;
    public firstName?: string;
    public lastName?: string;
    public city?: string;
    public countryCode?: string;
    public line1?: string;
    public postalCode?: string;
    public state?: string;

    public constructor(init?: Partial<BillingInformationDto>) { (Object as any).assign(this, init); }
}

export class CreatePurchaseOrder
{
    public userId?: string;
    public userEmail?: string;
    public createdDate?: string;
    public void?: boolean;
    public couponCode?: string;
    public orderItems?: PurchaseOrderItemDto[];
    public paymentType?: string;
    public billingInformationDto?: BillingInformationDto;

    public constructor(init?: Partial<CreatePurchaseOrder>) { (Object as any).assign(this, init); }
}

TypeScript CreatePurchaseOrder 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.

POST /api/purchaseorders HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	userId: String,
	userEmail: String,
	createdDate: 0001-01-01,
	void: False,
	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
		}
	],
	paymentType: String,
	billingInformationDto: 
	{
		cardNumber: String,
		cardType: String,
		expireMonth: 0,
		expireYear: 0,
		cvv2: String,
		firstName: String,
		lastName: String,
		city: String,
		countryCode: String,
		line1: String,
		postalCode: String,
		state: String
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	message: String,
	status: Continue,
	purchaseOrder: 
	{
		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
	},
	details: 
	[
		{
			code: String,
			field: String,
			issue: String
		}
	]
}