NAV

<back to all web services

CustomerRefundCreate

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

class CustomerRefundCreateResponse implements IConvertible
{
    double? cstMaintenanceTransactionGuid;
    double? cstMaintenanceTransactionGuidTaxRefund;
    ResponseStatus? responseStatus;

    CustomerRefundCreateResponse({this.cstMaintenanceTransactionGuid,this.cstMaintenanceTransactionGuidTaxRefund,this.responseStatus});
    CustomerRefundCreateResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

class CustomerRefundCreate implements IPost, IConvertible
{
    double? beeNumberCustomer;
    String? companyNumber;
    DateTime? refundDate;
    double? refundAmount;
    bool? isAttached;
    double? taxAmount;

    CustomerRefundCreate({this.beeNumberCustomer,this.companyNumber,this.refundDate,this.refundAmount,this.isAttached,this.taxAmount});
    CustomerRefundCreate.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        beeNumberCustomer = JsonConverters.toDouble(json['beeNumberCustomer']);
        companyNumber = json['companyNumber'];
        refundDate = JsonConverters.fromJson(json['refundDate'],'DateTime',context!);
        refundAmount = JsonConverters.toDouble(json['refundAmount']);
        isAttached = json['isAttached'];
        taxAmount = JsonConverters.toDouble(json['taxAmount']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'beeNumberCustomer': beeNumberCustomer,
        'companyNumber': companyNumber,
        'refundDate': JsonConverters.toJson(refundDate,'DateTime',context!),
        'refundAmount': refundAmount,
        'isAttached': isAttached,
        'taxAmount': taxAmount
    };

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

TypeContext _ctx = TypeContext(library: 'extensions.avon.ca', types: <String, TypeInfo> {
    'CustomerRefundCreateResponse': TypeInfo(TypeOf.Class, create:() => CustomerRefundCreateResponse()),
    'CustomerRefundCreate': TypeInfo(TypeOf.Class, create:() => CustomerRefundCreate()),
});

Dart CustomerRefundCreate 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 /refund HTTP/1.1 
Host: extensions.avon.ca 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	beeNumberCustomer: 0,
	companyNumber: String,
	refundDate: 0001-01-01T00:00:00,
	refundAmount: 0,
	isAttached: False,
	taxAmount: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	cstMaintenanceTransactionGuid: 0,
	cstMaintenanceTransactionGuidTaxRefund: 0,
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}