1Fetch Client API

<back to all web services

CheckAccount

The following routes are available for this service:
GET/checkaccountCheck account limit and remaining account amount
import 'package:servicestack/servicestack.dart';

class ApiServiceRequest implements IServiceRequest, IHasApiKey, IConvertible
{
    /**
    * The API Key required for authentication
    */
    // @ApiMember(DataType="string", Description="The API Key required for authentication", IsRequired=true)
    String? ApiKey;

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

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

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

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

class ApiServiceResponse implements IServiceResponse, IConvertible
{
    /**
    * Information about the response.
    */
    // @ApiMember(Description="Information about the response.", IsRequired=true)
    String? Description;

    /**
    * Heading or summary of the response.
    */
    // @ApiMember(Description="Heading or summary of the response.", IsRequired=true)
    String? Heading;

    /**
    * Did the intended operation for this response complete successfully?
    */
    // @ApiMember(DataType="boolean", Description="Did the intended operation for this response complete successfully?", IsRequired=true)
    bool? WasSuccessful;

    ApiServiceResponse({this.Description,this.Heading,this.WasSuccessful});
    ApiServiceResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Description': Description,
        'Heading': Heading,
        'WasSuccessful': WasSuccessful
    };

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

class CheckAccountResponse extends ApiServiceResponse implements IConvertible
{
    /**
    * The total monthly limit for account payments, will be negative if there is no limit
    */
    // @ApiMember(Description="The total monthly limit for account payments, will be negative if there is no limit")
    double? AccountLimit;

    /**
    * The amount that can still be used this month, will be negative if there is no account limit
    */
    // @ApiMember(Description="The amount that can still be used this month, will be negative if there is no account limit")
    double? AccountRemaining;

    /**
    * Shows if this account is allowed to place real orders or quotes
    */
    // @ApiMember(Description="Shows if this account is allowed to place real orders or quotes")
    bool? AllowDataProcessing;

    CheckAccountResponse({this.AccountLimit,this.AccountRemaining,this.AllowDataProcessing});
    CheckAccountResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        AccountLimit = JsonConverters.toDouble(json['AccountLimit']);
        AccountRemaining = JsonConverters.toDouble(json['AccountRemaining']);
        AllowDataProcessing = json['AllowDataProcessing'];
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson()..addAll({
        'AccountLimit': AccountLimit,
        'AccountRemaining': AccountRemaining,
        'AllowDataProcessing': AllowDataProcessing
    });

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

class CheckAccount extends ApiServiceRequest implements ILogRequest, IConvertible
{
    CheckAccount();
    CheckAccount.fromJson(Map<String, dynamic> json) : super.fromJson(json);
    fromMap(Map<String, dynamic> json) {
        super.fromMap(json);
        return this;
    }

    Map<String, dynamic> toJson() => super.toJson();
    getTypeName() => "CheckAccount";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: '1fetch.api.client.prod.86degrees.com', types: <String, TypeInfo> {
    'ApiServiceRequest': TypeInfo(TypeOf.Class, create:() => ApiServiceRequest()),
    'ApiServiceResponse': TypeInfo(TypeOf.Class, create:() => ApiServiceResponse()),
    'CheckAccountResponse': TypeInfo(TypeOf.Class, create:() => CheckAccountResponse()),
    'CheckAccount': TypeInfo(TypeOf.Class, create:() => CheckAccount()),
});

Dart CheckAccount DTOs

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

HTTP + CSV

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

GET /checkaccount HTTP/1.1 
Host: 1fetch.api.client.prod.86degrees.com 
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"AccountLimit":0,"AccountRemaining":0,"AllowDataProcessing":false,"Description":"String","Heading":"String","WasSuccessful":false}