Hmx Accounts

<back to all web services

GetDiscountedPurchaseOrderItems

The following routes are available for this service:
POST/api/purchaseorder/discounteditemsGets the discounted items in Order for checkout
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ShoppingCartItemDto:
    id: Optional[str] = None
    name: Optional[str] = None
    quantity: Optional[int] = None
    price: Optional[Decimal] = None
    discount_description: Optional[str] = None
    discount_source: Optional[str] = None
    discount: Optional[Decimal] = None
    total: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ShoppingCartDto:
    coupon_code: Optional[str] = None
    items: Optional[List[ShoppingCartItemDto]] = None
    total: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDiscountedPurchaseOrderItemsResponse:
    shopping_cart: Optional[ShoppingCartDto] = None
    message: Optional[str] = None
    status: Optional[HttpStatusCode] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetDiscountedPurchaseOrderItems:
    shopping_cart: Optional[ShoppingCartDto] = None

Python GetDiscountedPurchaseOrderItems 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/purchaseorder/discounteditems HTTP/1.1 
Host: accounts.dev.healthmonix.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	shoppingCart: 
	{
		couponCode: String,
		items: 
		[
			{
				id: String,
				name: String,
				quantity: 0,
				price: 0,
				discountDescription: String,
				discountSource: String,
				discount: 0,
				total: 0
			}
		],
		total: 0
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	shoppingCart: 
	{
		couponCode: String,
		items: 
		[
			{
				id: String,
				name: String,
				quantity: 0,
				price: 0,
				discountDescription: String,
				discountSource: String,
				discount: 0,
				total: 0
			}
		],
		total: 0
	},
	message: String,
	status: Continue,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}