POST | /orders/{OrderNumber}/shipments |
---|
import Foundation
import ServiceStack
public class NAVOrderShipmentCreate : IPost, Codable
{
public var orderNumber:String?
public var shipmentDateUTC:Date?
public var shipment:[NAVOrderShipment] = []
required public init(){}
}
public class NAVOrderShipment : Codable
{
public var shippingMethod:String?
public var shippingSpeed:String?
public var trackingNumber:String?
public var shipmentStatus:String?
public var shipmentDetails:String?
public var shippingCost:Double?
public var charge:Double?
public var tax:Double?
public var actualShippingCost:Double?
public var cartonWeight:Double?
public var orderShipmentSku:[NAVOrderShipmentSku] = []
required public init(){}
}
public class NAVOrderShipmentSku : Codable
{
public var orderLineNumber:Int?
public var quantityShipped:Int?
public var substituteSkuCode:String?
required public init(){}
}
public class NAVOrderShipmentCreateResponse : Codable
{
public var responseStatus:ResponseStatus?
required public init(){}
}
Swift NAVOrderShipmentCreate DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /orders/{OrderNumber}/shipments HTTP/1.1
Host: extensions.avon.ca
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
orderNumber: String,
shipmentDateUTC: 0001-01-01T00:00:00,
shipment:
[
{
shippingMethod: String,
shippingSpeed: String,
trackingNumber: String,
shipmentStatus: String,
shipmentDetails: String,
shippingCost: 0,
charge: 0,
tax: 0,
actualShippingCost: 0,
cartonWeight: 0,
orderShipmentSku:
[
{
orderLineNumber: 0,
quantityShipped: 0,
substituteSkuCode: String
}
]
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }