Billhighway Cloud API

<back to all web services

ChargeTokenV2Rq

The following routes are available for this service:
POST/integrations/api/v2/{tokenType}/charge/token
import java.math.*;
import java.util.*;
import net.servicestack.client.*;

public class dtos
{

    public static class ChargeTokenV2Rq extends ChargeTokenRqBase
    {
        
    }

    public static class ChargeTokenRqBase implements IChapterAuthorizationRequest, IApiResultErrorService
    {
        public String tokenType = null;
        public Integer Amount = null;
        public String Description = null;
        public ChargeTokenOptions Options = null;
        public CreditCardChargeItem CardInfo = null;
        public AchChargeItem AchInfo = null;
        public ArrayList<ReferenceIdTypedAssociationItem> ReferenceIds = null;
        
        public String getTokenType() { return tokenType; }
        public ChargeTokenRqBase setTokenType(String value) { this.tokenType = value; return this; }
        public Integer getAmount() { return Amount; }
        public ChargeTokenRqBase setAmount(Integer value) { this.Amount = value; return this; }
        public String getDescription() { return Description; }
        public ChargeTokenRqBase setDescription(String value) { this.Description = value; return this; }
        public ChargeTokenOptions getOptions() { return Options; }
        public ChargeTokenRqBase setOptions(ChargeTokenOptions value) { this.Options = value; return this; }
        public CreditCardChargeItem getCardInfo() { return CardInfo; }
        public ChargeTokenRqBase setCardInfo(CreditCardChargeItem value) { this.CardInfo = value; return this; }
        public AchChargeItem getAchInfo() { return AchInfo; }
        public ChargeTokenRqBase setAchInfo(AchChargeItem value) { this.AchInfo = value; return this; }
        public ArrayList<ReferenceIdTypedAssociationItem> getReferenceIds() { return ReferenceIds; }
        public ChargeTokenRqBase setReferenceIds(ArrayList<ReferenceIdTypedAssociationItem> value) { this.ReferenceIds = value; return this; }
    }

    public static class ChargeTokenOptions
    {
        public Integer Usages = null;
        public Integer Duration = null;
        
        public Integer getUsages() { return Usages; }
        public ChargeTokenOptions setUsages(Integer value) { this.Usages = value; return this; }
        public Integer getDuration() { return Duration; }
        public ChargeTokenOptions setDuration(Integer value) { this.Duration = value; return this; }
    }

    public static class CreditCardChargeItem
    {
        public String NameOnCard = null;
        public Integer ExpMonth = null;
        public Integer ExpYear = null;
        public String CardNumber = null;
        public String Cvv = null;
        public CreditCardBillingAddressItem Address = null;
        
        public String getNameOnCard() { return NameOnCard; }
        public CreditCardChargeItem setNameOnCard(String value) { this.NameOnCard = value; return this; }
        public Integer getExpMonth() { return ExpMonth; }
        public CreditCardChargeItem setExpMonth(Integer value) { this.ExpMonth = value; return this; }
        public Integer getExpYear() { return ExpYear; }
        public CreditCardChargeItem setExpYear(Integer value) { this.ExpYear = value; return this; }
        public String getCardNumber() { return CardNumber; }
        public CreditCardChargeItem setCardNumber(String value) { this.CardNumber = value; return this; }
        public String getCvv() { return Cvv; }
        public CreditCardChargeItem setCvv(String value) { this.Cvv = value; return this; }
        public CreditCardBillingAddressItem getAddress() { return Address; }
        public CreditCardChargeItem setAddress(CreditCardBillingAddressItem value) { this.Address = value; return this; }
    }

    public static class CreditCardBillingAddressItem
    {
        public String Address1 = null;
        public String Address2 = null;
        public String City = null;
        public String PostalCode = null;
        public String Region = null;
        public String Country = null;
        public ArrayList<AttributeItem> Attributes = null;
        
        public String getAddress1() { return Address1; }
        public CreditCardBillingAddressItem setAddress1(String value) { this.Address1 = value; return this; }
        public String getAddress2() { return Address2; }
        public CreditCardBillingAddressItem setAddress2(String value) { this.Address2 = value; return this; }
        public String getCity() { return City; }
        public CreditCardBillingAddressItem setCity(String value) { this.City = value; return this; }
        public String getPostalCode() { return PostalCode; }
        public CreditCardBillingAddressItem setPostalCode(String value) { this.PostalCode = value; return this; }
        public String getRegion() { return Region; }
        public CreditCardBillingAddressItem setRegion(String value) { this.Region = value; return this; }
        public String getCountry() { return Country; }
        public CreditCardBillingAddressItem setCountry(String value) { this.Country = value; return this; }
        public ArrayList<AttributeItem> getAttributes() { return Attributes; }
        public CreditCardBillingAddressItem setAttributes(ArrayList<AttributeItem> value) { this.Attributes = value; return this; }
    }

    public static class AttributeItem
    {
        public String Name = null;
        public String Value = null;
        
        public String getName() { return Name; }
        public AttributeItem setName(String value) { this.Name = value; return this; }
        public String getValue() { return Value; }
        public AttributeItem setValue(String value) { this.Value = value; return this; }
    }

    public static class AchChargeItem
    {
        public String AccountNumber = null;
        public String RoutingNumber = null;
        public String AccountType = null;
        public String AccountHolderName = null;
        
        public String getAccountNumber() { return AccountNumber; }
        public AchChargeItem setAccountNumber(String value) { this.AccountNumber = value; return this; }
        public String getRoutingNumber() { return RoutingNumber; }
        public AchChargeItem setRoutingNumber(String value) { this.RoutingNumber = value; return this; }
        public String getAccountType() { return AccountType; }
        public AchChargeItem setAccountType(String value) { this.AccountType = value; return this; }
        public String getAccountHolderName() { return AccountHolderName; }
        public AchChargeItem setAccountHolderName(String value) { this.AccountHolderName = value; return this; }
    }

    public static class ReferenceIdTypedAssociationItem
    {
        public String Value = null;
        public String Type = null;
        
        public String getValue() { return Value; }
        public ReferenceIdTypedAssociationItem setValue(String value) { this.Value = value; return this; }
        public String getType() { return Type; }
        public ReferenceIdTypedAssociationItem setType(String value) { this.Type = value; return this; }
    }

    public static class ChargeTokenV2Rs
    {
        public String Token = null;
        public Integer Amount = null;
        public String TokenType = null;
        public String Description = null;
        public Date ExpiresOn = null;
        public String Currency = null;
        public Integer Usages = null;
        public CreditCardChargeDetailsV2 CardDetails = null;
        public AchChargeDetailsV2 AchDetails = null;
        
        public String getToken() { return Token; }
        public ChargeTokenV2Rs setToken(String value) { this.Token = value; return this; }
        public Integer getAmount() { return Amount; }
        public ChargeTokenV2Rs setAmount(Integer value) { this.Amount = value; return this; }
        public String getTokenType() { return TokenType; }
        public ChargeTokenV2Rs setTokenType(String value) { this.TokenType = value; return this; }
        public String getDescription() { return Description; }
        public ChargeTokenV2Rs setDescription(String value) { this.Description = value; return this; }
        public Date getExpiresOn() { return ExpiresOn; }
        public ChargeTokenV2Rs setExpiresOn(Date value) { this.ExpiresOn = value; return this; }
        public String getCurrency() { return Currency; }
        public ChargeTokenV2Rs setCurrency(String value) { this.Currency = value; return this; }
        public Integer getUsages() { return Usages; }
        public ChargeTokenV2Rs setUsages(Integer value) { this.Usages = value; return this; }
        public CreditCardChargeDetailsV2 getCardDetails() { return CardDetails; }
        public ChargeTokenV2Rs setCardDetails(CreditCardChargeDetailsV2 value) { this.CardDetails = value; return this; }
        public AchChargeDetailsV2 getAchDetails() { return AchDetails; }
        public ChargeTokenV2Rs setAchDetails(AchChargeDetailsV2 value) { this.AchDetails = value; return this; }
    }

    public static class CreditCardChargeDetailsV2
    {
        public String CardType = null;
        public Integer ExpMonth = null;
        public Integer ExpYear = null;
        public String Last4 = null;
        public CreditCardBillingAddressItem Address = null;
        
        public String getCardType() { return CardType; }
        public CreditCardChargeDetailsV2 setCardType(String value) { this.CardType = value; return this; }
        public Integer getExpMonth() { return ExpMonth; }
        public CreditCardChargeDetailsV2 setExpMonth(Integer value) { this.ExpMonth = value; return this; }
        public Integer getExpYear() { return ExpYear; }
        public CreditCardChargeDetailsV2 setExpYear(Integer value) { this.ExpYear = value; return this; }
        public String getLast4() { return Last4; }
        public CreditCardChargeDetailsV2 setLast4(String value) { this.Last4 = value; return this; }
        public CreditCardBillingAddressItem getAddress() { return Address; }
        public CreditCardChargeDetailsV2 setAddress(CreditCardBillingAddressItem value) { this.Address = value; return this; }
    }

    public static class AchChargeDetailsV2
    {
        public String AccountType = null;
        public String RoutingNumber = null;
        public String AccountNumberLast4 = null;
        public String BankName = null;
        
        public String getAccountType() { return AccountType; }
        public AchChargeDetailsV2 setAccountType(String value) { this.AccountType = value; return this; }
        public String getRoutingNumber() { return RoutingNumber; }
        public AchChargeDetailsV2 setRoutingNumber(String value) { this.RoutingNumber = value; return this; }
        public String getAccountNumberLast4() { return AccountNumberLast4; }
        public AchChargeDetailsV2 setAccountNumberLast4(String value) { this.AccountNumberLast4 = value; return this; }
        public String getBankName() { return BankName; }
        public AchChargeDetailsV2 setBankName(String value) { this.BankName = value; return this; }
    }

}

Java ChargeTokenV2Rq 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 /integrations/api/v2/{tokenType}/charge/token HTTP/1.1 
Host: devapi.billhighway.com 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ChargeTokenV2Rq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api.Request">
  <AchInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
    <d2p1:_x003C_AccountHolderName_x003E_k__BackingField>String</d2p1:_x003C_AccountHolderName_x003E_k__BackingField>
    <d2p1:_x003C_AccountNumber_x003E_k__BackingField>String</d2p1:_x003C_AccountNumber_x003E_k__BackingField>
    <d2p1:_x003C_AccountType_x003E_k__BackingField>String</d2p1:_x003C_AccountType_x003E_k__BackingField>
    <d2p1:_x003C_RoutingNumber_x003E_k__BackingField>String</d2p1:_x003C_RoutingNumber_x003E_k__BackingField>
  </AchInfo>
  <Amount>0</Amount>
  <CardInfo xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
    <d2p1:_x003C_Address_x003E_k__BackingField>
      <d2p1:Address1>String</d2p1:Address1>
      <d2p1:Address2>String</d2p1:Address2>
      <d2p1:Attributes xmlns:d4p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
        <d4p1:AttributeItem>
          <d4p1:Name>String</d4p1:Name>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:AttributeItem>
      </d2p1:Attributes>
      <d2p1:City>String</d2p1:City>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:PostalCode>String</d2p1:PostalCode>
      <d2p1:Region>String</d2p1:Region>
    </d2p1:_x003C_Address_x003E_k__BackingField>
    <d2p1:_x003C_CardNumber_x003E_k__BackingField>String</d2p1:_x003C_CardNumber_x003E_k__BackingField>
    <d2p1:_x003C_Cvv_x003E_k__BackingField>String</d2p1:_x003C_Cvv_x003E_k__BackingField>
    <d2p1:_x003C_ExpMonth_x003E_k__BackingField>0</d2p1:_x003C_ExpMonth_x003E_k__BackingField>
    <d2p1:_x003C_ExpYear_x003E_k__BackingField>0</d2p1:_x003C_ExpYear_x003E_k__BackingField>
    <d2p1:_x003C_NameOnCard_x003E_k__BackingField>String</d2p1:_x003C_NameOnCard_x003E_k__BackingField>
  </CardInfo>
  <Description>String</Description>
  <Options xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges">
    <d2p1:Duration>0</d2p1:Duration>
    <d2p1:Usages>0</d2p1:Usages>
  </Options>
  <ReferenceIds xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
    <d2p1:ReferenceIdTypedAssociationItem>
      <d2p1:_x003C_Type_x003E_k__BackingField>String</d2p1:_x003C_Type_x003E_k__BackingField>
      <d2p1:_x003C_Value_x003E_k__BackingField>String</d2p1:_x003C_Value_x003E_k__BackingField>
    </d2p1:ReferenceIdTypedAssociationItem>
  </ReferenceIds>
  <tokenType>String</tokenType>
</ChargeTokenV2Rq>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ChargeTokenV2Rs xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api.Response">
  <AchDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
    <d2p1:_x003C_AccountNumberLast4_x003E_k__BackingField>String</d2p1:_x003C_AccountNumberLast4_x003E_k__BackingField>
    <d2p1:_x003C_AccountType_x003E_k__BackingField>String</d2p1:_x003C_AccountType_x003E_k__BackingField>
    <d2p1:_x003C_BankName_x003E_k__BackingField>String</d2p1:_x003C_BankName_x003E_k__BackingField>
    <d2p1:_x003C_RoutingNumber_x003E_k__BackingField>String</d2p1:_x003C_RoutingNumber_x003E_k__BackingField>
  </AchDetails>
  <Amount>0</Amount>
  <CardDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO.Charges.Api">
    <d2p1:_x003C_Address_x003E_k__BackingField>
      <d2p1:Address1>String</d2p1:Address1>
      <d2p1:Address2>String</d2p1:Address2>
      <d2p1:Attributes xmlns:d4p1="http://schemas.datacontract.org/2004/07/BH.CloudAPI.DTO">
        <d4p1:AttributeItem>
          <d4p1:Name>String</d4p1:Name>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:AttributeItem>
      </d2p1:Attributes>
      <d2p1:City>String</d2p1:City>
      <d2p1:Country>String</d2p1:Country>
      <d2p1:PostalCode>String</d2p1:PostalCode>
      <d2p1:Region>String</d2p1:Region>
    </d2p1:_x003C_Address_x003E_k__BackingField>
    <d2p1:_x003C_CardType_x003E_k__BackingField>String</d2p1:_x003C_CardType_x003E_k__BackingField>
    <d2p1:_x003C_ExpMonth_x003E_k__BackingField>0</d2p1:_x003C_ExpMonth_x003E_k__BackingField>
    <d2p1:_x003C_ExpYear_x003E_k__BackingField>0</d2p1:_x003C_ExpYear_x003E_k__BackingField>
    <d2p1:_x003C_Last4_x003E_k__BackingField>String</d2p1:_x003C_Last4_x003E_k__BackingField>
  </CardDetails>
  <Currency>String</Currency>
  <Description>String</Description>
  <ExpiresOn>0001-01-01T00:00:00</ExpiresOn>
  <Token>String</Token>
  <TokenType>String</TokenType>
  <Usages>0</Usages>
</ChargeTokenV2Rs>