Billhighway Cloud API

<back to all web services

Receipt

The following routes are available for this service:
POST/v1.1/receipts/send
POST/v1.2/receipts/send
import 'package:servicestack/servicestack.dart';

class ReceiptSentStatus implements IConvertible
{
    bool? IsSent;

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

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

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

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

class ReceiptResponse implements IConvertible
{
    ReceiptSentStatus? Email;
    ReceiptSentStatus? Sms;

    ReceiptResponse({this.Email,this.Sms});
    ReceiptResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

    Map<String, dynamic> toJson() => {
        'Email': JsonConverters.toJson(Email,'ReceiptSentStatus',context!),
        'Sms': JsonConverters.toJson(Sms,'ReceiptSentStatus',context!)
    };

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

class Receipt extends Receipt implements IReturnLegacyException, IConvertible
{
    Receipt();
    Receipt.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() => "Receipt";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'devapi.billhighway.com', types: <String, TypeInfo> {
    'ReceiptSentStatus': TypeInfo(TypeOf.Class, create:() => ReceiptSentStatus()),
    'ReceiptResponse': TypeInfo(TypeOf.Class, create:() => ReceiptResponse()),
    'Receipt': TypeInfo(TypeOf.Class, create:() => Receipt()),
});

Dart Receipt DTOs

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

HTTP + XML

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

POST /v1.1/receipts/send HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<Receipt xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.billhighway.com/api">
  <EmailReceiptRequest xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
    <From>String</From>
    <Message>String</Message>
    <Subject>String</Subject>
    <To>String</To>
  </EmailReceiptRequest>
  <SmsReceiptRequest xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
    <Message>String</Message>
    <To>String</To>
  </SmsReceiptRequest>
</Receipt>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ReceiptResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
  <Email>
    <IsSent>false</IsSent>
  </Email>
  <Sms>
    <IsSent>false</IsSent>
  </Sms>
</ReceiptResponse>