Hmx Accounts

<back to all web services

CreatePurchaseOrder

The following routes are available for this service:
POST/api/purchaseordersCreate a new PurchaseOrder
import java.math.*;
import java.util.*;
import net.servicestack.client.*;
import com.google.gson.annotations.*;
import com.google.gson.reflect.*;

public class dtos
{

    public static class CreatePurchaseOrder
    {
        public String userId = null;
        public String userEmail = null;
        public Date createdDate = null;
        @SerializedName("void") public Boolean Void = null;
        public String couponCode = null;
        public ArrayList<PurchaseOrderItemDto> orderItems = null;
        public String paymentType = null;
        public BillingInformationDto billingInformationDto = null;
        
        public String getUserId() { return userId; }
        public CreatePurchaseOrder setUserId(String value) { this.userId = value; return this; }
        public String getUserEmail() { return userEmail; }
        public CreatePurchaseOrder setUserEmail(String value) { this.userEmail = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public CreatePurchaseOrder setCreatedDate(Date value) { this.createdDate = value; return this; }
        public Boolean isVoid() { return Void; }
        public CreatePurchaseOrder setVoid(Boolean value) { this.Void = value; return this; }
        public String getCouponCode() { return couponCode; }
        public CreatePurchaseOrder setCouponCode(String value) { this.couponCode = value; return this; }
        public ArrayList<PurchaseOrderItemDto> getOrderItems() { return orderItems; }
        public CreatePurchaseOrder setOrderItems(ArrayList<PurchaseOrderItemDto> value) { this.orderItems = value; return this; }
        public String getPaymentType() { return paymentType; }
        public CreatePurchaseOrder setPaymentType(String value) { this.paymentType = value; return this; }
        public BillingInformationDto getBillingInformationDto() { return billingInformationDto; }
        public CreatePurchaseOrder setBillingInformationDto(BillingInformationDto value) { this.billingInformationDto = value; return this; }
    }

    public static class PurchaseOrderItemDto
    {
        public Integer id = null;
        public Integer purchaseOrderId = null;
        public String productId = null;
        public String productName = null;
        public Integer quantity = null;
        public BigDecimal price = null;
        public String discountDescription = null;
        public String discountSource = null;
        public BigDecimal discount = null;
        public Date createdDate = null;
        
        public Integer getId() { return id; }
        public PurchaseOrderItemDto setId(Integer value) { this.id = value; return this; }
        public Integer getPurchaseOrderId() { return purchaseOrderId; }
        public PurchaseOrderItemDto setPurchaseOrderId(Integer value) { this.purchaseOrderId = value; return this; }
        public String getProductId() { return productId; }
        public PurchaseOrderItemDto setProductId(String value) { this.productId = value; return this; }
        public String getProductName() { return productName; }
        public PurchaseOrderItemDto setProductName(String value) { this.productName = value; return this; }
        public Integer getQuantity() { return quantity; }
        public PurchaseOrderItemDto setQuantity(Integer value) { this.quantity = value; return this; }
        public BigDecimal getPrice() { return price; }
        public PurchaseOrderItemDto setPrice(BigDecimal value) { this.price = value; return this; }
        public String getDiscountDescription() { return discountDescription; }
        public PurchaseOrderItemDto setDiscountDescription(String value) { this.discountDescription = value; return this; }
        public String getDiscountSource() { return discountSource; }
        public PurchaseOrderItemDto setDiscountSource(String value) { this.discountSource = value; return this; }
        public BigDecimal getDiscount() { return discount; }
        public PurchaseOrderItemDto setDiscount(BigDecimal value) { this.discount = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public PurchaseOrderItemDto setCreatedDate(Date value) { this.createdDate = value; return this; }
    }

    public static class BillingInformationDto
    {
        public String cardNumber = null;
        public String cardType = null;
        public Integer expireMonth = null;
        public Integer expireYear = null;
        public String cvv2 = null;
        public String firstName = null;
        public String lastName = null;
        public String city = null;
        public String countryCode = null;
        public String line1 = null;
        public String postalCode = null;
        public String state = null;
        
        public String getCardNumber() { return cardNumber; }
        public BillingInformationDto setCardNumber(String value) { this.cardNumber = value; return this; }
        public String getCardType() { return cardType; }
        public BillingInformationDto setCardType(String value) { this.cardType = value; return this; }
        public Integer getExpireMonth() { return expireMonth; }
        public BillingInformationDto setExpireMonth(Integer value) { this.expireMonth = value; return this; }
        public Integer getExpireYear() { return expireYear; }
        public BillingInformationDto setExpireYear(Integer value) { this.expireYear = value; return this; }
        public String getCvv2() { return cvv2; }
        public BillingInformationDto setCvv2(String value) { this.cvv2 = value; return this; }
        public String getFirstName() { return firstName; }
        public BillingInformationDto setFirstName(String value) { this.firstName = value; return this; }
        public String getLastName() { return lastName; }
        public BillingInformationDto setLastName(String value) { this.lastName = value; return this; }
        public String getCity() { return city; }
        public BillingInformationDto setCity(String value) { this.city = value; return this; }
        public String getCountryCode() { return countryCode; }
        public BillingInformationDto setCountryCode(String value) { this.countryCode = value; return this; }
        public String getLine1() { return line1; }
        public BillingInformationDto setLine1(String value) { this.line1 = value; return this; }
        public String getPostalCode() { return postalCode; }
        public BillingInformationDto setPostalCode(String value) { this.postalCode = value; return this; }
        public String getState() { return state; }
        public BillingInformationDto setState(String value) { this.state = value; return this; }
    }

    public static class CreatePurchaseOrderResponse
    {
        public String message = null;
        public HttpStatusCode status = null;
        public PurchaseOrderDto purchaseOrder = null;
        public ArrayList<Details> details = null;
        
        public String getMessage() { return message; }
        public CreatePurchaseOrderResponse setMessage(String value) { this.message = value; return this; }
        public HttpStatusCode getStatus() { return status; }
        public CreatePurchaseOrderResponse setStatus(HttpStatusCode value) { this.status = value; return this; }
        public PurchaseOrderDto getPurchaseOrder() { return purchaseOrder; }
        public CreatePurchaseOrderResponse setPurchaseOrder(PurchaseOrderDto value) { this.purchaseOrder = value; return this; }
        public ArrayList<Details> getDetails() { return details; }
        public CreatePurchaseOrderResponse setDetails(ArrayList<Details> value) { this.details = value; return this; }
    }

    public static class PurchaseOrderDto
    {
        public Integer id = null;
        public String userId = null;
        public Date createdDate = null;
        public String paymentType = null;
        @SerializedName("void") public Boolean Void = null;
        public Boolean paid = null;
        public String transactionIdentifier = null;
        public String couponCode = null;
        public ArrayList<PurchaseOrderItem> orderItems = null;
        public String payer = null;
        public String billingAddressLine1 = null;
        public String billingAddressCity = null;
        public String billingAddressState = null;
        public String billingAddressPostalCode = null;
        public String billingAddressCountryCode = null;
        
        public Integer getId() { return id; }
        public PurchaseOrderDto setId(Integer value) { this.id = value; return this; }
        public String getUserId() { return userId; }
        public PurchaseOrderDto setUserId(String value) { this.userId = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public PurchaseOrderDto setCreatedDate(Date value) { this.createdDate = value; return this; }
        public String getPaymentType() { return paymentType; }
        public PurchaseOrderDto setPaymentType(String value) { this.paymentType = value; return this; }
        public Boolean isVoid() { return Void; }
        public PurchaseOrderDto setVoid(Boolean value) { this.Void = value; return this; }
        public Boolean isPaid() { return paid; }
        public PurchaseOrderDto setPaid(Boolean value) { this.paid = value; return this; }
        public String getTransactionIdentifier() { return transactionIdentifier; }
        public PurchaseOrderDto setTransactionIdentifier(String value) { this.transactionIdentifier = value; return this; }
        public String getCouponCode() { return couponCode; }
        public PurchaseOrderDto setCouponCode(String value) { this.couponCode = value; return this; }
        public ArrayList<PurchaseOrderItem> getOrderItems() { return orderItems; }
        public PurchaseOrderDto setOrderItems(ArrayList<PurchaseOrderItem> value) { this.orderItems = value; return this; }
        public String getPayer() { return payer; }
        public PurchaseOrderDto setPayer(String value) { this.payer = value; return this; }
        public String getBillingAddressLine1() { return billingAddressLine1; }
        public PurchaseOrderDto setBillingAddressLine1(String value) { this.billingAddressLine1 = value; return this; }
        public String getBillingAddressCity() { return billingAddressCity; }
        public PurchaseOrderDto setBillingAddressCity(String value) { this.billingAddressCity = value; return this; }
        public String getBillingAddressState() { return billingAddressState; }
        public PurchaseOrderDto setBillingAddressState(String value) { this.billingAddressState = value; return this; }
        public String getBillingAddressPostalCode() { return billingAddressPostalCode; }
        public PurchaseOrderDto setBillingAddressPostalCode(String value) { this.billingAddressPostalCode = value; return this; }
        public String getBillingAddressCountryCode() { return billingAddressCountryCode; }
        public PurchaseOrderDto setBillingAddressCountryCode(String value) { this.billingAddressCountryCode = value; return this; }
    }

    public static class PurchaseOrderItem
    {
        public Integer id = null;
        @References(PurchaseOrder.class)
        public Integer purchaseOrderId = null;

        @References(Product.class)
        public String productId = null;

        public String productName = null;
        public Integer quantity = null;
        public BigDecimal price = null;
        public String discountDescription = null;
        public String discountSource = null;
        public BigDecimal discount = null;
        public Date createdDate = null;
        
        public Integer getId() { return id; }
        public PurchaseOrderItem setId(Integer value) { this.id = value; return this; }
        public Integer getPurchaseOrderId() { return purchaseOrderId; }
        public PurchaseOrderItem setPurchaseOrderId(Integer value) { this.purchaseOrderId = value; return this; }
        public String getProductId() { return productId; }
        public PurchaseOrderItem setProductId(String value) { this.productId = value; return this; }
        public String getProductName() { return productName; }
        public PurchaseOrderItem setProductName(String value) { this.productName = value; return this; }
        public Integer getQuantity() { return quantity; }
        public PurchaseOrderItem setQuantity(Integer value) { this.quantity = value; return this; }
        public BigDecimal getPrice() { return price; }
        public PurchaseOrderItem setPrice(BigDecimal value) { this.price = value; return this; }
        public String getDiscountDescription() { return discountDescription; }
        public PurchaseOrderItem setDiscountDescription(String value) { this.discountDescription = value; return this; }
        public String getDiscountSource() { return discountSource; }
        public PurchaseOrderItem setDiscountSource(String value) { this.discountSource = value; return this; }
        public BigDecimal getDiscount() { return discount; }
        public PurchaseOrderItem setDiscount(BigDecimal value) { this.discount = value; return this; }
        public Date getCreatedDate() { return createdDate; }
        public PurchaseOrderItem setCreatedDate(Date value) { this.createdDate = value; return this; }
    }

    public static class Details
    {
        public String code = null;
        public String field = null;
        public String issue = null;
        
        public String getCode() { return code; }
        public Details setCode(String value) { this.code = value; return this; }
        public String getField() { return field; }
        public Details setField(String value) { this.field = value; return this; }
        public String getIssue() { return issue; }
        public Details setIssue(String value) { this.issue = value; return this; }
    }

}

Java CreatePurchaseOrder DTOs

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

HTTP + CSV

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/csv
Content-Type: text/csv
Content-Length: length

{"userId":"String","userEmail":"String","createdDate":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000"}],"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/csv
Content-Length: length

{"message":"String","status":"Continue","purchaseOrder":{"id":0,"userId":"String","createdDate":"0001-01-01T00:00:00.0000000","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-01T00:00:00.0000000"}],"payer":"String","billingAddressLine1":"String","billingAddressCity":"String","billingAddressState":"String","billingAddressPostalCode":"String","billingAddressCountryCode":"String"},"details":[{"code":"String","field":"String","issue":"String"}]}