GET | /api/purchaseorders | Search for PurchaseOrders |
---|
import java.math.*
import java.util.*
import net.servicestack.client.*
import com.google.gson.annotations.*
import com.google.gson.reflect.*
open class GetPurchaseOrders
{
var userId:String? = null
var fromDate:Date? = null
var toDate:Date? = null
@SerializedName("void") var Void:Boolean? = null
var paid:Boolean? = null
var transactionIdentifier:String? = null
var couponCode:String? = null
}
open class GetPurchaseOrdersResponse
{
var results:ArrayList<PurchaseOrderDto> = ArrayList<PurchaseOrderDto>()
}
open class PurchaseOrderDto
{
var id:Int? = null
var userId:String? = null
var createdDate:Date? = null
var paymentType:String? = null
@SerializedName("void") var Void:Boolean? = null
var paid:Boolean? = null
var transactionIdentifier:String? = null
var couponCode:String? = null
var orderItems:ArrayList<PurchaseOrderItem> = ArrayList<PurchaseOrderItem>()
var payer:String? = null
var billingAddressLine1:String? = null
var billingAddressCity:String? = null
var billingAddressState:String? = null
var billingAddressPostalCode:String? = null
var billingAddressCountryCode:String? = null
}
open class PurchaseOrderItem
{
var id:Int? = null
@References(PurchaseOrder.class)
var purchaseOrderId:Int? = null
@References(Product.class)
var productId:String? = null
var productName:String? = null
var quantity:Int? = null
var price:BigDecimal? = null
var discountDescription:String? = null
var discountSource:String? = null
var discount:BigDecimal? = null
var createdDate:Date? = null
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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/csv
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"results":[{"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"}]}