Billhighway Cloud API

<back to all web services

SalesForceCreateApplyCredit

The following routes are available for this service:
POST/api/SalesForce/CreateApplyCredit
import 'package:servicestack/servicestack.dart';

class SalesForceCreateApplyCreditReply implements IConvertible
{
    int? ErrorCode;
    String? ErrorMessage;

    SalesForceCreateApplyCreditReply({this.ErrorCode,this.ErrorMessage});
    SalesForceCreateApplyCreditReply.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class SalesForceCreditInvoiceDetails implements IConvertible
{
    int? Invoice;
    double? AmountPaid;
    String? Region;
    String? CostCenter;

    SalesForceCreditInvoiceDetails({this.Invoice,this.AmountPaid,this.Region,this.CostCenter});
    SalesForceCreditInvoiceDetails.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Invoice = json['Invoice'];
        AmountPaid = JsonConverters.toDouble(json['AmountPaid']);
        Region = json['Region'];
        CostCenter = json['CostCenter'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Invoice': Invoice,
        'AmountPaid': AmountPaid,
        'Region': Region,
        'CostCenter': CostCenter
    };

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

class SalesForceCreateApplyCredit implements IConvertible
{
    String? ClassName;
    String? UniqueId;
    DateTime? CreatedDateTime;
    int? ClientId;
    String? GroupId;
    String? UserId;
    int? BhUserId;
    int? CreditId;
    String? CurrencyType;
    String? CreditType;
    String? Notes;
    List<SalesForceCreditInvoiceDetails>? InvoiceDetails;

    SalesForceCreateApplyCredit({this.ClassName,this.UniqueId,this.CreatedDateTime,this.ClientId,this.GroupId,this.UserId,this.BhUserId,this.CreditId,this.CurrencyType,this.CreditType,this.Notes,this.InvoiceDetails});
    SalesForceCreateApplyCredit.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ClassName = json['ClassName'];
        UniqueId = json['UniqueId'];
        CreatedDateTime = JsonConverters.fromJson(json['CreatedDateTime'],'DateTime',context!);
        ClientId = json['ClientId'];
        GroupId = json['GroupId'];
        UserId = json['UserId'];
        BhUserId = json['BhUserId'];
        CreditId = json['CreditId'];
        CurrencyType = json['CurrencyType'];
        CreditType = json['CreditType'];
        Notes = json['Notes'];
        InvoiceDetails = JsonConverters.fromJson(json['InvoiceDetails'],'List<SalesForceCreditInvoiceDetails>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ClassName': ClassName,
        'UniqueId': UniqueId,
        'CreatedDateTime': JsonConverters.toJson(CreatedDateTime,'DateTime',context!),
        'ClientId': ClientId,
        'GroupId': GroupId,
        'UserId': UserId,
        'BhUserId': BhUserId,
        'CreditId': CreditId,
        'CurrencyType': CurrencyType,
        'CreditType': CreditType,
        'Notes': Notes,
        'InvoiceDetails': JsonConverters.toJson(InvoiceDetails,'List<SalesForceCreditInvoiceDetails>',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'SalesForceCreateApplyCreditReply': TypeInfo(TypeOf.Class, create:() => SalesForceCreateApplyCreditReply()),
    'SalesForceCreditInvoiceDetails': TypeInfo(TypeOf.Class, create:() => SalesForceCreditInvoiceDetails()),
    'SalesForceCreateApplyCredit': TypeInfo(TypeOf.Class, create:() => SalesForceCreateApplyCredit()),
    'List<SalesForceCreditInvoiceDetails>': TypeInfo(TypeOf.Class, create:() => <SalesForceCreditInvoiceDetails>[]),
});

Dart SalesForceCreateApplyCredit DTOs

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

HTTP + JSV

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

POST /api/SalesForce/CreateApplyCredit HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ClassName: String,
	UniqueId: String,
	CreatedDateTime: 0001-01-01,
	ClientId: 0,
	GroupId: String,
	UserId: String,
	BhUserId: 0,
	CreditId: 0,
	CurrencyType: String,
	CreditType: String,
	Notes: String,
	InvoiceDetails: 
	[
		{
			Invoice: 0,
			AmountPaid: 0,
			Region: String,
			CostCenter: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ErrorCode: 0,
	ErrorMessage: String
}