Trendsic Platform Service

<back to all web services

OrderLinesRequest

The following routes are available for this service:
POST,PUT,DELETE,OPTIONS/v1/OrderLines
GET/v1/OrderLines/OrderHeaders/{OrderHeaderUID}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class OrderLine implements IConvertible
{
    int? ID;
    String? OrderHeaderID;
    int? OrderLineNumber;
    int? ProductID;
    String? StripeProductId;
    int? ProductCategory;
    int? ProductSubCategory;
    int? Quantity;
    double? TotalOrderLineCost;
    double? ProductCost;
    double? PerUnitProductCost;
    double? OrderLineTax;
    double? OrderLineShippingCost;
    double? PerUnitShippingCost;
    int? OrderLineStatusID;
    int? ShipMethodID;
    DateTime? EstimatedShipDate;
    DateTime? EstimatedDeliveryDate;
    DateTime? ActualShipDate;
    DateTime? ActualDeliveryDate;
    DateTime? OrderLineCreatedDate;
    DateTime? OrderLineModifiedDate;
    String? UID;
    String? ProductName;
    int? AgentId;
    String? Street;
    String? City;
    String? State;
    String? Zip;
    String? PhoneNumber;
    int? AddressId;
    String? ShippingAddress;
    String? FullName;

    OrderLine({this.ID,this.OrderHeaderID,this.OrderLineNumber,this.ProductID,this.StripeProductId,this.ProductCategory,this.ProductSubCategory,this.Quantity,this.TotalOrderLineCost,this.ProductCost,this.PerUnitProductCost,this.OrderLineTax,this.OrderLineShippingCost,this.PerUnitShippingCost,this.OrderLineStatusID,this.ShipMethodID,this.EstimatedShipDate,this.EstimatedDeliveryDate,this.ActualShipDate,this.ActualDeliveryDate,this.OrderLineCreatedDate,this.OrderLineModifiedDate,this.UID,this.ProductName,this.AgentId,this.Street,this.City,this.State,this.Zip,this.PhoneNumber,this.AddressId,this.ShippingAddress,this.FullName});
    OrderLine.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        OrderHeaderID = json['OrderHeaderID'];
        OrderLineNumber = json['OrderLineNumber'];
        ProductID = json['ProductID'];
        StripeProductId = json['StripeProductId'];
        ProductCategory = json['ProductCategory'];
        ProductSubCategory = json['ProductSubCategory'];
        Quantity = json['Quantity'];
        TotalOrderLineCost = JsonConverters.toDouble(json['TotalOrderLineCost']);
        ProductCost = JsonConverters.toDouble(json['ProductCost']);
        PerUnitProductCost = JsonConverters.toDouble(json['PerUnitProductCost']);
        OrderLineTax = JsonConverters.toDouble(json['OrderLineTax']);
        OrderLineShippingCost = JsonConverters.toDouble(json['OrderLineShippingCost']);
        PerUnitShippingCost = JsonConverters.toDouble(json['PerUnitShippingCost']);
        OrderLineStatusID = json['OrderLineStatusID'];
        ShipMethodID = json['ShipMethodID'];
        EstimatedShipDate = JsonConverters.fromJson(json['EstimatedShipDate'],'DateTime',context!);
        EstimatedDeliveryDate = JsonConverters.fromJson(json['EstimatedDeliveryDate'],'DateTime',context!);
        ActualShipDate = JsonConverters.fromJson(json['ActualShipDate'],'DateTime',context!);
        ActualDeliveryDate = JsonConverters.fromJson(json['ActualDeliveryDate'],'DateTime',context!);
        OrderLineCreatedDate = JsonConverters.fromJson(json['OrderLineCreatedDate'],'DateTime',context!);
        OrderLineModifiedDate = JsonConverters.fromJson(json['OrderLineModifiedDate'],'DateTime',context!);
        UID = json['UID'];
        ProductName = json['ProductName'];
        AgentId = json['AgentId'];
        Street = json['Street'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        PhoneNumber = json['PhoneNumber'];
        AddressId = json['AddressId'];
        ShippingAddress = json['ShippingAddress'];
        FullName = json['FullName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'OrderHeaderID': OrderHeaderID,
        'OrderLineNumber': OrderLineNumber,
        'ProductID': ProductID,
        'StripeProductId': StripeProductId,
        'ProductCategory': ProductCategory,
        'ProductSubCategory': ProductSubCategory,
        'Quantity': Quantity,
        'TotalOrderLineCost': TotalOrderLineCost,
        'ProductCost': ProductCost,
        'PerUnitProductCost': PerUnitProductCost,
        'OrderLineTax': OrderLineTax,
        'OrderLineShippingCost': OrderLineShippingCost,
        'PerUnitShippingCost': PerUnitShippingCost,
        'OrderLineStatusID': OrderLineStatusID,
        'ShipMethodID': ShipMethodID,
        'EstimatedShipDate': JsonConverters.toJson(EstimatedShipDate,'DateTime',context!),
        'EstimatedDeliveryDate': JsonConverters.toJson(EstimatedDeliveryDate,'DateTime',context!),
        'ActualShipDate': JsonConverters.toJson(ActualShipDate,'DateTime',context!),
        'ActualDeliveryDate': JsonConverters.toJson(ActualDeliveryDate,'DateTime',context!),
        'OrderLineCreatedDate': JsonConverters.toJson(OrderLineCreatedDate,'DateTime',context!),
        'OrderLineModifiedDate': JsonConverters.toJson(OrderLineModifiedDate,'DateTime',context!),
        'UID': UID,
        'ProductName': ProductName,
        'AgentId': AgentId,
        'Street': Street,
        'City': City,
        'State': State,
        'Zip': Zip,
        'PhoneNumber': PhoneNumber,
        'AddressId': AddressId,
        'ShippingAddress': ShippingAddress,
        'FullName': FullName
    };

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

class OrderLinesResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<OrderLine>? OrderLines = [];

    OrderLinesResponse({this.ResponseStatus,this.OrderLines});
    OrderLinesResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class OrderLinesRequest implements IConvertible
{
    String? OrderHeaderUID;
    List<OrderLine>? OrderLines = [];

    OrderLinesRequest({this.OrderHeaderUID,this.OrderLines});
    OrderLinesRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'OrderHeaderUID': OrderHeaderUID,
        'OrderLines': JsonConverters.toJson(OrderLines,'List<OrderLine>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'OrderLine': TypeInfo(TypeOf.Class, create:() => OrderLine()),
    'OrderLinesResponse': TypeInfo(TypeOf.Class, create:() => OrderLinesResponse()),
    'List<OrderLine>': TypeInfo(TypeOf.Class, create:() => <OrderLine>[]),
    'OrderLinesRequest': TypeInfo(TypeOf.Class, create:() => OrderLinesRequest()),
});

Dart OrderLinesRequest DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /v1/OrderLines HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"OrderHeaderUID":"00000000000000000000000000000000","OrderLines":[{"ID":0,"OrderHeaderID":"00000000000000000000000000000000","OrderLineNumber":0,"ProductID":0,"StripeProductId":"String","ProductCategory":0,"ProductSubCategory":0,"Quantity":0,"TotalOrderLineCost":0,"ProductCost":0,"PerUnitProductCost":0,"OrderLineTax":0,"OrderLineShippingCost":0,"PerUnitShippingCost":0,"OrderLineStatusID":0,"ShipMethodID":0,"EstimatedShipDate":"0001-01-01T00:00:00.0000000","EstimatedDeliveryDate":"0001-01-01T00:00:00.0000000","ActualShipDate":"0001-01-01T00:00:00.0000000","ActualDeliveryDate":"0001-01-01T00:00:00.0000000","OrderLineCreatedDate":"0001-01-01T00:00:00.0000000","OrderLineModifiedDate":"0001-01-01T00:00:00.0000000","UID":"00000000000000000000000000000000","ProductName":"String","AgentId":0,"Street":"String","City":"String","State":"String","Zip":"String","PhoneNumber":"String","AddressId":0,"ShippingAddress":"String","FullName":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"OrderLines":[{"ID":0,"OrderHeaderID":"00000000000000000000000000000000","OrderLineNumber":0,"ProductID":0,"StripeProductId":"String","ProductCategory":0,"ProductSubCategory":0,"Quantity":0,"TotalOrderLineCost":0,"ProductCost":0,"PerUnitProductCost":0,"OrderLineTax":0,"OrderLineShippingCost":0,"PerUnitShippingCost":0,"OrderLineStatusID":0,"ShipMethodID":0,"EstimatedShipDate":"0001-01-01T00:00:00.0000000","EstimatedDeliveryDate":"0001-01-01T00:00:00.0000000","ActualShipDate":"0001-01-01T00:00:00.0000000","ActualDeliveryDate":"0001-01-01T00:00:00.0000000","OrderLineCreatedDate":"0001-01-01T00:00:00.0000000","OrderLineModifiedDate":"0001-01-01T00:00:00.0000000","UID":"00000000000000000000000000000000","ProductName":"String","AgentId":0,"Street":"String","City":"String","State":"String","Zip":"String","PhoneNumber":"String","AddressId":0,"ShippingAddress":"String","FullName":"String"}]}