ServiceStack Home (Live)

<back to all web services

ViewOrder

Requires Authentication
The following routes are available for this service:
All Verbs/account/orders/{Id}
GET/ViewOrder
GET/ViewOrder/{Id}
import 'package:servicestack/servicestack.dart';

class ViewOrder implements IConvertible
{
    int? id;

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

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

    Map<String, dynamic> toJson() => {
        'id': id
    };

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

enum SkuType
{
    Product,
    PerDev,
    PerCore,
    Site,
    Support,
    Training,
    Register,
    Payment,
}

class OrderDetail implements IConvertible
{
    int? id;
    int? orderId;
    int? skuId;
    SkuType? skuType;
    int? price;
    String? description;
    int? quantity;
    int? total;

    OrderDetail({this.id,this.orderId,this.skuId,this.skuType,this.price,this.description,this.quantity,this.total});
    OrderDetail.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        orderId = json['orderId'];
        skuId = json['skuId'];
        skuType = JsonConverters.fromJson(json['skuType'],'SkuType',context!);
        price = json['price'];
        description = json['description'];
        quantity = json['quantity'];
        total = json['total'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'orderId': orderId,
        'skuId': skuId,
        'skuType': JsonConverters.toJson(skuType,'SkuType',context!),
        'price': price,
        'description': description,
        'quantity': quantity,
        'total': total
    };

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

class Order implements IAddress, IConvertible
{
    int? id;
    int? customerId;
    String? productName;
    String? firstName;
    String? lastName;
    String? email;
    String? company;
    String? phoneNumber;
    String? addressLine1;
    String? addressLine2;
    String? addressCity;
    String? addressZip;
    String? addressState;
    String? addressCountry;
    bool? agreeTerms;
    String? notes;
    String? last4;
    int? subTotal;
    String? couponId;
    int? discount;
    int? tax;
    int? total;
    int? itemQuantity;
    int? authorizedQuantity;
    int? subscriptionId;
    String? licenseRef;
    int? paymentId;
    int? emailId;
    bool? paid;
    DateTime? createdDate;
    DateTime? modifiedDate;
    String? modifiedBy;
    DateTime? cancelledDate;
    String? cancelledReason;
    String? ipAddress;
    List<OrderDetail>? orderDetails;

    Order({this.id,this.customerId,this.productName,this.firstName,this.lastName,this.email,this.company,this.phoneNumber,this.addressLine1,this.addressLine2,this.addressCity,this.addressZip,this.addressState,this.addressCountry,this.agreeTerms,this.notes,this.last4,this.subTotal,this.couponId,this.discount,this.tax,this.total,this.itemQuantity,this.authorizedQuantity,this.subscriptionId,this.licenseRef,this.paymentId,this.emailId,this.paid,this.createdDate,this.modifiedDate,this.modifiedBy,this.cancelledDate,this.cancelledReason,this.ipAddress,this.orderDetails});
    Order.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        id = json['id'];
        customerId = json['customerId'];
        productName = json['productName'];
        firstName = json['firstName'];
        lastName = json['lastName'];
        email = json['email'];
        company = json['company'];
        phoneNumber = json['phoneNumber'];
        addressLine1 = json['addressLine1'];
        addressLine2 = json['addressLine2'];
        addressCity = json['addressCity'];
        addressZip = json['addressZip'];
        addressState = json['addressState'];
        addressCountry = json['addressCountry'];
        agreeTerms = json['agreeTerms'];
        notes = json['notes'];
        last4 = json['last4'];
        subTotal = json['subTotal'];
        couponId = json['couponId'];
        discount = json['discount'];
        tax = json['tax'];
        total = json['total'];
        itemQuantity = json['itemQuantity'];
        authorizedQuantity = json['authorizedQuantity'];
        subscriptionId = json['subscriptionId'];
        licenseRef = json['licenseRef'];
        paymentId = json['paymentId'];
        emailId = json['emailId'];
        paid = json['paid'];
        createdDate = JsonConverters.fromJson(json['createdDate'],'DateTime',context!);
        modifiedDate = JsonConverters.fromJson(json['modifiedDate'],'DateTime',context!);
        modifiedBy = json['modifiedBy'];
        cancelledDate = JsonConverters.fromJson(json['cancelledDate'],'DateTime',context!);
        cancelledReason = json['cancelledReason'];
        ipAddress = json['ipAddress'];
        orderDetails = JsonConverters.fromJson(json['orderDetails'],'List<OrderDetail>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'id': id,
        'customerId': customerId,
        'productName': productName,
        'firstName': firstName,
        'lastName': lastName,
        'email': email,
        'company': company,
        'phoneNumber': phoneNumber,
        'addressLine1': addressLine1,
        'addressLine2': addressLine2,
        'addressCity': addressCity,
        'addressZip': addressZip,
        'addressState': addressState,
        'addressCountry': addressCountry,
        'agreeTerms': agreeTerms,
        'notes': notes,
        'last4': last4,
        'subTotal': subTotal,
        'couponId': couponId,
        'discount': discount,
        'tax': tax,
        'total': total,
        'itemQuantity': itemQuantity,
        'authorizedQuantity': authorizedQuantity,
        'subscriptionId': subscriptionId,
        'licenseRef': licenseRef,
        'paymentId': paymentId,
        'emailId': emailId,
        'paid': paid,
        'createdDate': JsonConverters.toJson(createdDate,'DateTime',context!),
        'modifiedDate': JsonConverters.toJson(modifiedDate,'DateTime',context!),
        'modifiedBy': modifiedBy,
        'cancelledDate': JsonConverters.toJson(cancelledDate,'DateTime',context!),
        'cancelledReason': cancelledReason,
        'ipAddress': ipAddress,
        'orderDetails': JsonConverters.toJson(orderDetails,'List<OrderDetail>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'account.servicestack.net', types: <String, TypeInfo> {
    'ViewOrder': TypeInfo(TypeOf.Class, create:() => ViewOrder()),
    'SkuType': TypeInfo(TypeOf.Enum, enumValues:SkuType.values),
    'OrderDetail': TypeInfo(TypeOf.Class, create:() => OrderDetail()),
    'Order': TypeInfo(TypeOf.Class, create:() => Order()),
    'List<OrderDetail>': TypeInfo(TypeOf.Class, create:() => <OrderDetail>[]),
});

Dart ViewOrder DTOs

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

HTTP + OTHER

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

POST /account/orders/{Id} HTTP/1.1 
Host: account.servicestack.net 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"id":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"id":0,"customerId":0,"productName":"String","firstName":"String","lastName":"String","email":"String","company":"String","phoneNumber":"String","addressLine1":"String","addressLine2":"String","addressCity":"String","addressZip":"String","addressState":"String","addressCountry":"String","agreeTerms":false,"notes":"String","last4":"String","subTotal":0,"couponId":"String","discount":0,"tax":0,"total":0,"itemQuantity":0,"authorizedQuantity":0,"subscriptionId":0,"licenseRef":"String","paymentId":0,"emailId":0,"paid":false,"createdDate":"\/Date(-62135596800000-0000)\/","modifiedDate":"\/Date(-62135596800000-0000)\/","modifiedBy":"String","cancelledDate":"\/Date(-62135596800000-0000)\/","cancelledReason":"String","ipAddress":"String","orderDetails":[{"id":0,"orderId":0,"skuId":0,"skuType":"Product","price":0,"description":"String","quantity":0,"total":0}]}