Billhighway Cloud API

<back to all web services

BillMeLaterSubscription

import Foundation
import ServiceStack

public class BillMeLaterSubscription : Codable
{
    public var header:ApiClientHeader?
    public var subscriptionInfo:SubscriptionParameters?
    public var campaignInfo:[CampaignInformation] = []

    required public init(){}
}

public class ApiClientHeader : Codable
{
    public var clientId:Int?
    public var referrer:String?
    public var ipAddress:String?
    public var loggedInUserId:Int?
    public var groupId:Int?
    public var task:String?
    public var machine:String?
    public var location:String?
    public var createdBy:Int?
    public var campaignId:Int?
    public var reCaptchaScore:Double?

    required public init(){}
}

public class SubscriptionParameters : Codable
{
    public var formTemplateID:Int?
    public var subscriptionInvoiceID:Int?
    public var clientSubscriberId:String?
    public var signupTypeID:Int?
    public var frequencyID:Int?
    public var autoRenew:Bool?
    public var companyID:Int?
    public var userID:Int?
    public var chapMemPayID:Int?
    public var memberSubscriptionInvID:Int?
    public var fields:[SubscriberFormField] = []
    public var createdBy:Int?
    public var updatedBy:Int?
    public var aptifyUpdateType:Int?
    public var renewedMemberSubscriptionInvID:Int?
    public var chapId:Int?

    required public init(){}
}

public class SubscriberFormField : Codable
{
    public var name:String?
    public var value:String?

    required public init(){}
}

public class CampaignInformation : Codable
{
    public var campaignId:Int?
    public var campaignName:String?
    public var amount:Double?
    public var chapPayID:String?

    required public init(){}
}

public class BillMePaymentResult : BillMeCloudServiceResponse
{
    public var transactionRecordID:Int?

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case transactionRecordID
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        transactionRecordID = try container.decodeIfPresent(Int.self, forKey: .transactionRecordID)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if transactionRecordID != nil { try container.encode(transactionRecordID, forKey: .transactionRecordID) }
    }
}

public class BillMeCloudServiceResponse : Codable
{
    public var isDuplicate:Bool?
    public var isSuccessful:Bool?
    public var errorCode:String?
    public var message:String?
    public var isError:Bool?

    required public init(){}
}


Swift BillMeLaterSubscription 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 /xml/reply/BillMeLaterSubscription HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<BillMeLaterSubscription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.billhighway.com/api">
  <CampaignInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.Subscriptions">
    <d2p1:CampaignInformation>
      <d2p1:Amount>0</d2p1:Amount>
      <d2p1:CampaignId>0</d2p1:CampaignId>
      <d2p1:CampaignName>String</d2p1:CampaignName>
      <d2p1:ChapPayID>String</d2p1:ChapPayID>
    </d2p1:CampaignInformation>
  </CampaignInfo>
  <Header xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
    <d2p1:CampaignId>0</d2p1:CampaignId>
    <d2p1:ClientId>0</d2p1:ClientId>
    <d2p1:CreatedBy>0</d2p1:CreatedBy>
    <d2p1:GroupId>0</d2p1:GroupId>
    <d2p1:IpAddress>String</d2p1:IpAddress>
    <d2p1:Location>String</d2p1:Location>
    <d2p1:LoggedInUserId>0</d2p1:LoggedInUserId>
    <d2p1:Machine>String</d2p1:Machine>
    <d2p1:ReCaptchaScore>0</d2p1:ReCaptchaScore>
    <d2p1:Referrer>String</d2p1:Referrer>
    <d2p1:Task>String</d2p1:Task>
  </Header>
  <SubscriptionInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common4.DTO.SalesForce">
    <d2p1:AptifyUpdateType>0</d2p1:AptifyUpdateType>
    <d2p1:AutoRenew>false</d2p1:AutoRenew>
    <d2p1:ChapId>0</d2p1:ChapId>
    <d2p1:ChapMemPayID>0</d2p1:ChapMemPayID>
    <d2p1:ClientSubscriberId>String</d2p1:ClientSubscriberId>
    <d2p1:CompanyID>0</d2p1:CompanyID>
    <d2p1:CreatedBy>0</d2p1:CreatedBy>
    <d2p1:Fields>
      <d2p1:SubscriberFormField>
        <d2p1:_x003C_Name_x003E_k__BackingField>String</d2p1:_x003C_Name_x003E_k__BackingField>
        <d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
      </d2p1:SubscriberFormField>
    </d2p1:Fields>
    <d2p1:FormTemplateID>0</d2p1:FormTemplateID>
    <d2p1:FrequencyID>0</d2p1:FrequencyID>
    <d2p1:MemberSubscriptionInvID>0</d2p1:MemberSubscriptionInvID>
    <d2p1:RenewedMemberSubscriptionInvID>0</d2p1:RenewedMemberSubscriptionInvID>
    <d2p1:SignupTypeID>0</d2p1:SignupTypeID>
    <d2p1:SubscriptionInvoiceID>0</d2p1:SubscriptionInvoiceID>
    <d2p1:UpdatedBy>0</d2p1:UpdatedBy>
    <d2p1:UserID>0</d2p1:UserID>
  </SubscriptionInfo>
</BillMeLaterSubscription>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<BillMePaymentResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.Common.DTO">
  <ErrorCode>String</ErrorCode>
  <IsDuplicate>false</IsDuplicate>
  <IsError>false</IsError>
  <IsSuccessful>false</IsSuccessful>
  <Message>String</Message>
  <TransactionRecordID>0</TransactionRecordID>
</BillMePaymentResult>