NAV

<back to all web services

NAVOrderShipmentCreate

The following routes are available for this service:
POST/orders/{OrderNumber}/shipments
import 'package:servicestack/servicestack.dart';

class NAVOrderShipmentCreateResponse implements IConvertible
{
    ResponseStatus? responseStatus;

    NAVOrderShipmentCreateResponse({this.responseStatus});
    NAVOrderShipmentCreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        responseStatus = JsonConverters.fromJson(json['responseStatus'],'ResponseStatus',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'responseStatus': JsonConverters.toJson(responseStatus,'ResponseStatus',context!)
    };

    getTypeName() => "NAVOrderShipmentCreateResponse";
    TypeContext? context = _ctx;
}

class NAVOrderShipmentSku implements IConvertible
{
    int? orderLineNumber;
    int? quantityShipped;
    String? substituteSkuCode;

    NAVOrderShipmentSku({this.orderLineNumber,this.quantityShipped,this.substituteSkuCode});
    NAVOrderShipmentSku.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        orderLineNumber = json['orderLineNumber'];
        quantityShipped = json['quantityShipped'];
        substituteSkuCode = json['substituteSkuCode'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'orderLineNumber': orderLineNumber,
        'quantityShipped': quantityShipped,
        'substituteSkuCode': substituteSkuCode
    };

    getTypeName() => "NAVOrderShipmentSku";
    TypeContext? context = _ctx;
}

class NAVOrderShipment implements IConvertible
{
    String? shippingMethod;
    String? shippingSpeed;
    String? trackingNumber;
    String? shipmentStatus;
    String? shipmentDetails;
    double? shippingCost;
    double? charge;
    double? tax;
    double? actualShippingCost;
    double? cartonWeight;
    List<NAVOrderShipmentSku>? orderShipmentSku;

    NAVOrderShipment({this.shippingMethod,this.shippingSpeed,this.trackingNumber,this.shipmentStatus,this.shipmentDetails,this.shippingCost,this.charge,this.tax,this.actualShippingCost,this.cartonWeight,this.orderShipmentSku});
    NAVOrderShipment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        shippingMethod = json['shippingMethod'];
        shippingSpeed = json['shippingSpeed'];
        trackingNumber = json['trackingNumber'];
        shipmentStatus = json['shipmentStatus'];
        shipmentDetails = json['shipmentDetails'];
        shippingCost = JsonConverters.toDouble(json['shippingCost']);
        charge = JsonConverters.toDouble(json['charge']);
        tax = JsonConverters.toDouble(json['tax']);
        actualShippingCost = JsonConverters.toDouble(json['actualShippingCost']);
        cartonWeight = JsonConverters.toDouble(json['cartonWeight']);
        orderShipmentSku = JsonConverters.fromJson(json['orderShipmentSku'],'List<NAVOrderShipmentSku>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'shippingMethod': shippingMethod,
        'shippingSpeed': shippingSpeed,
        'trackingNumber': trackingNumber,
        'shipmentStatus': shipmentStatus,
        'shipmentDetails': shipmentDetails,
        'shippingCost': shippingCost,
        'charge': charge,
        'tax': tax,
        'actualShippingCost': actualShippingCost,
        'cartonWeight': cartonWeight,
        'orderShipmentSku': JsonConverters.toJson(orderShipmentSku,'List<NAVOrderShipmentSku>',context!)
    };

    getTypeName() => "NAVOrderShipment";
    TypeContext? context = _ctx;
}

class NAVOrderShipmentCreate implements IPost, IConvertible
{
    String? orderNumber;
    DateTime? shipmentDateUTC;
    List<NAVOrderShipment>? shipment;

    NAVOrderShipmentCreate({this.orderNumber,this.shipmentDateUTC,this.shipment});
    NAVOrderShipmentCreate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        orderNumber = json['orderNumber'];
        shipmentDateUTC = JsonConverters.fromJson(json['shipmentDateUTC'],'DateTime',context!);
        shipment = JsonConverters.fromJson(json['shipment'],'List<NAVOrderShipment>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'orderNumber': orderNumber,
        'shipmentDateUTC': JsonConverters.toJson(shipmentDateUTC,'DateTime',context!),
        'shipment': JsonConverters.toJson(shipment,'List<NAVOrderShipment>',context!)
    };

    getTypeName() => "NAVOrderShipmentCreate";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'extensions.avon.ca', types: <String, TypeInfo> {
    'NAVOrderShipmentCreateResponse': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentCreateResponse()),
    'NAVOrderShipmentSku': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentSku()),
    'NAVOrderShipment': TypeInfo(TypeOf.Class, create:() => NAVOrderShipment()),
    'List<NAVOrderShipmentSku>': TypeInfo(TypeOf.Class, create:() => <NAVOrderShipmentSku>[]),
    'NAVOrderShipmentCreate': TypeInfo(TypeOf.Class, create:() => NAVOrderShipmentCreate()),
    'List<NAVOrderShipment>': TypeInfo(TypeOf.Class, create:() => <NAVOrderShipment>[]),
});

Dart NAVOrderShipmentCreate DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<NAVOrderShipmentCreate xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NAV.ServiceModel">
  <OrderNumber>String</OrderNumber>
  <Shipment>
    <NAVOrderShipment>
      <ActualShippingCost>0</ActualShippingCost>
      <CartonWeight>0</CartonWeight>
      <Charge>0</Charge>
      <OrderShipmentSku>
        <NAVOrderShipmentSku>
          <OrderLineNumber>0</OrderLineNumber>
          <QuantityShipped>0</QuantityShipped>
          <SubstituteSkuCode>String</SubstituteSkuCode>
        </NAVOrderShipmentSku>
      </OrderShipmentSku>
      <ShipmentDetails>String</ShipmentDetails>
      <ShipmentStatus>String</ShipmentStatus>
      <ShippingCost>0</ShippingCost>
      <ShippingMethod>String</ShippingMethod>
      <ShippingSpeed>String</ShippingSpeed>
      <Tax>0</Tax>
      <TrackingNumber>String</TrackingNumber>
    </NAVOrderShipment>
  </Shipment>
  <ShipmentDateUTC>0001-01-01T00:00:00</ShipmentDateUTC>
</NAVOrderShipmentCreate>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<NAVOrderShipmentCreateResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NAV.ServiceModel">
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
</NAVOrderShipmentCreateResponse>