Trendsic Platform Service

<back to all web services

AdjustmentRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/Adjustment/{ID}
GET,POST,PUT,DELETE,OPTIONS/v1/Adjustment
GET,POST,PUT,DELETE,OPTIONS/v1/Adjustment/DateRange/{ParamStartDate}/{ParamEndDate}/{AgentID}
GET,POST,PUT,DELETE,OPTIONS/v1/Adjustment/DateRange/{ParamStartDate}/{ParamEndDate}
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class Adjustment implements IConvertible
{
    int? ID;
    DateTime? AdjustmentDate;
    String? Agent;
    String? Reason;
    double? Amount;
    String? Approved;
    String? AdjType;
    String? Income;
    String? Paid;
    String? BalanceForward;
    String? BalanceDate;

    Adjustment({this.ID,this.AdjustmentDate,this.Agent,this.Reason,this.Amount,this.Approved,this.AdjType,this.Income,this.Paid,this.BalanceForward,this.BalanceDate});
    Adjustment.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ID = json['ID'];
        AdjustmentDate = JsonConverters.fromJson(json['AdjustmentDate'],'DateTime',context!);
        Agent = json['Agent'];
        Reason = json['Reason'];
        Amount = JsonConverters.toDouble(json['Amount']);
        Approved = json['Approved'];
        AdjType = json['AdjType'];
        Income = json['Income'];
        Paid = json['Paid'];
        BalanceForward = json['BalanceForward'];
        BalanceDate = json['BalanceDate'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ID': ID,
        'AdjustmentDate': JsonConverters.toJson(AdjustmentDate,'DateTime',context!),
        'Agent': Agent,
        'Reason': Reason,
        'Amount': Amount,
        'Approved': Approved,
        'AdjType': AdjType,
        'Income': Income,
        'Paid': Paid,
        'BalanceForward': BalanceForward,
        'BalanceDate': BalanceDate
    };

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

class AdjustmentResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    List<Adjustment>? Adjustment = [];

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

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

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

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

class AdjustmentRequest implements IConvertible
{
    List<Adjustment>? Adjustment = [];
    int? AgentID;
    DateTime? ParamStartDate;
    DateTime? ParamEndDate;

    AdjustmentRequest({this.Adjustment,this.AgentID,this.ParamStartDate,this.ParamEndDate});
    AdjustmentRequest.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Adjustment = JsonConverters.fromJson(json['Adjustment'],'List<Adjustment>',context!);
        AgentID = json['AgentID'];
        ParamStartDate = JsonConverters.fromJson(json['ParamStartDate'],'DateTime',context!);
        ParamEndDate = JsonConverters.fromJson(json['ParamEndDate'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Adjustment': JsonConverters.toJson(Adjustment,'List<Adjustment>',context!),
        'AgentID': AgentID,
        'ParamStartDate': JsonConverters.toJson(ParamStartDate,'DateTime',context!),
        'ParamEndDate': JsonConverters.toJson(ParamEndDate,'DateTime',context!)
    };

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

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

Dart AdjustmentRequest 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/Adjustment/{ID} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"Adjustment":[{"ID":0,"AdjustmentDate":"0001-01-01T00:00:00.0000000","Agent":"String","Reason":"String","Amount":0,"Approved":"String","AdjType":"String","Income":"String","Paid":"String","BalanceForward":"String","BalanceDate":"String"}],"AgentID":0,"ParamStartDate":"0001-01-01T00:00:00.0000000","ParamEndDate":"0001-01-01T00:00:00.0000000"}
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"}},"Adjustment":[{"ID":0,"AdjustmentDate":"0001-01-01T00:00:00.0000000","Agent":"String","Reason":"String","Amount":0,"Approved":"String","AdjType":"String","Income":"String","Paid":"String","BalanceForward":"String","BalanceDate":"String"}]}