Billhighway Cloud API

<back to all web services

ChargeTokenRq

The following routes are available for this service:
POST/integrations/api/{tokenType}/charge/token
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports BH.CloudAPI.DTO.Charges.Api.Request
Imports BH.CloudAPI.DTO.Charges
Imports BH.CloudAPI.DTO.Charges.Api
Imports BH.CloudAPI.Common4.DTO
Imports BH.CloudAPI.DTO
Imports BH.CloudAPI.DTO.Charges.Api.Response

Namespace Global

    Namespace BH.CloudAPI.Common4.DTO

        Public Partial Class AttributeItem
            Public Overridable Property Name As String
            Public Overridable Property Value As String
        End Class
    End Namespace

    Namespace BH.CloudAPI.DTO

        Public Partial Class ReferenceIdTypedAssociationItem
            Public Overridable Property Value As String
            Public Overridable Property Type As String
        End Class
    End Namespace

    Namespace BH.CloudAPI.DTO.Charges

        Public Partial Class ChargeTokenOptions
            Public Overridable Property Usages As Integer
            Public Overridable Property Duration As Integer
        End Class
    End Namespace

    Namespace BH.CloudAPI.DTO.Charges.Api

        Public Partial Class AchChargeDetails
            Public Overridable Property AccountType As String
            Public Overridable Property RoutingNumber As String
            Public Overridable Property AccountNumberLast4 As String
            Public Overridable Property BankName As String
            Public Overridable Property VerificationResult As AchChargeVerificationResult
        End Class

        Public Partial Class AchChargeItem
            Public Overridable Property AccountNumber As String
            Public Overridable Property RoutingNumber As String
            Public Overridable Property AccountType As String
            Public Overridable Property AccountHolderName As String
        End Class

        Public Partial Class AchChargeVerificationResult
            Public Overridable Property NetworkVerificationAttempted As Boolean
            Public Overridable Property Result As String
        End Class

        Public Partial Class CreditCardBillingAddressItem
            Public Sub New()
                Attributes = New List(Of AttributeItem)
            End Sub

            Public Overridable Property Address1 As String
            Public Overridable Property Address2 As String
            Public Overridable Property City As String
            Public Overridable Property PostalCode As String
            Public Overridable Property Region As String
            Public Overridable Property Country As String
            Public Overridable Property Attributes As List(Of AttributeItem)
        End Class

        Public Partial Class CreditCardChargeDetails
            Public Overridable Property CardType As String
            Public Overridable Property ExpMonth As Integer
            Public Overridable Property ExpYear As Integer
            Public Overridable Property Last4 As String
            Public Overridable Property Address As CreditCardBillingAddressItem
            Public Overridable Property VerificationResult As CreditCardChargeVerificationResult
        End Class

        Public Partial Class CreditCardChargeItem
            Public Overridable Property NameOnCard As String
            Public Overridable Property ExpMonth As Integer
            Public Overridable Property ExpYear As Integer
            Public Overridable Property CardNumber As String
            Public Overridable Property Cvv As String
            Public Overridable Property Address As CreditCardBillingAddressItem
        End Class

        Public Partial Class CreditCardChargeVerificationResult
            Public Overridable Property NetworkVerificationAttempted As Boolean
            Public Overridable Property CvvVerificationResult As String
            Public Overridable Property AddressVerificationResult As String
            Public Overridable Property PostalCodeVerificationResult As String
        End Class
    End Namespace

    Namespace BH.CloudAPI.DTO.Charges.Api.Request

        Public Partial Class ChargeTokenRq
            Inherits ChargeTokenRqBase
        End Class

        Public Partial Class ChargeTokenRqBase
            Implements IChapterAuthorizationRequest
            Implements IApiResultErrorService
            Public Sub New()
                ReferenceIds = New List(Of ReferenceIdTypedAssociationItem)
            End Sub

            Public Overridable Property tokenType As String
            Public Overridable Property Amount As Integer
            Public Overridable Property Description As String
            Public Overridable Property Options As ChargeTokenOptions
            Public Overridable Property CardInfo As CreditCardChargeItem
            Public Overridable Property AchInfo As AchChargeItem
            Public Overridable Property ReferenceIds As List(Of ReferenceIdTypedAssociationItem)
        End Class
    End Namespace

    Namespace BH.CloudAPI.DTO.Charges.Api.Response

        Public Partial Class ChargeTokenRs
            Public Overridable Property Token As String
            Public Overridable Property OrganizationId As Integer
            Public Overridable Property ChapterId As Integer
            Public Overridable Property Amount As Integer
            Public Overridable Property TokenType As String
            Public Overridable Property Description As String
            Public Overridable Property ExpiresOn As Date
            Public Overridable Property Currency As String
            Public Overridable Property Usages As Integer
            Public Overridable Property CardDetails As CreditCardChargeDetails
            Public Overridable Property AchDetails As AchChargeDetails
        End Class
    End Namespace
End Namespace

VB.NET ChargeTokenRq 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 /integrations/api/{tokenType}/charge/token HTTP/1.1 
Host: devapi.billhighway.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	tokenType: String,
	Amount: 0,
	Description: String,
	Options: 
	{
		Usages: 0,
		Duration: 0
	},
	CardInfo: 
	{
		NameOnCard: String,
		ExpMonth: 0,
		ExpYear: 0,
		CardNumber: String,
		Cvv: String,
		Address: 
		{
			Address1: String,
			Address2: String,
			City: String,
			PostalCode: String,
			Region: String,
			Country: String,
			Attributes: 
			[
				{
					Name: String,
					Value: String
				}
			]
		}
	},
	AchInfo: 
	{
		AccountNumber: String,
		RoutingNumber: String,
		AccountType: String,
		AccountHolderName: String
	},
	ReferenceIds: 
	[
		{
			Value: String,
			Type: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Token: String,
	OrganizationId: 0,
	ChapterId: 0,
	Amount: 0,
	TokenType: String,
	Description: String,
	ExpiresOn: 0001-01-01,
	Currency: String,
	Usages: 0,
	CardDetails: 
	{
		CardType: String,
		ExpMonth: 0,
		ExpYear: 0,
		Last4: String,
		Address: 
		{
			Address1: String,
			Address2: String,
			City: String,
			PostalCode: String,
			Region: String,
			Country: String,
			Attributes: 
			[
				{
					Name: String,
					Value: String
				}
			]
		},
		VerificationResult: 
		{
			NetworkVerificationAttempted: False,
			CvvVerificationResult: String,
			AddressVerificationResult: String,
			PostalCodeVerificationResult: String
		}
	},
	AchDetails: 
	{
		AccountType: String,
		RoutingNumber: String,
		AccountNumberLast4: String,
		BankName: String,
		VerificationResult: 
		{
			NetworkVerificationAttempted: False,
			Result: String
		}
	}
}