PaySecure Pinless Web Services 2023:07:03:07

<back to all web services

ClientTokenizeACHRequest

The following routes are available for this service:
POST/ClientTokenizeACH
import Foundation
import ServiceStack

// @DataContract
public class ClientTokenizeACHRequest : Codable
{
    // @DataMember
    public var version:String

    // @DataMember
    public var keyId:String

    // @DataMember
    public var firstName:String

    // @DataMember
    public var lastName:String

    // @DataMember
    public var email:String

    // @DataMember
    public var phoneType:String

    // @DataMember
    public var phoneNumber:String

    // @DataMember
    public var routingNumber:String

    // @DataMember
    public var encryptedAccountNumber:String

    // @DataMember
    public var billingDetails:BillingDescriptor

    // @DataMember
    public var verifyACH:Bool

    required public init(){}
}

public class BillingDescriptor : Codable
{
    public var address:String
    public var city:String
    public var state:String
    public var zip:String
    public var country:String

    required public init(){}
}

// @DataContract
public class ClientTokenizeACH : PaysecureResponseInternal
{
    // @DataMember
    public var sessionToken:String

    // @DataMember
    public var responseCode:String

    // @DataMember
    public var errorMessage:String

    // @DataMember
    public var errorCode:String

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

    private enum CodingKeys : String, CodingKey {
        case sessionToken
        case responseCode
        case errorMessage
        case errorCode
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        sessionToken = try container.decodeIfPresent(String.self, forKey: .sessionToken)
        responseCode = try container.decodeIfPresent(String.self, forKey: .responseCode)
        errorMessage = try container.decodeIfPresent(String.self, forKey: .errorMessage)
        errorCode = try container.decodeIfPresent(String.self, forKey: .errorCode)
    }

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

// @DataContract
public class PaysecureResponseInternal : Codable
{
    // @DataMember(EmitDefaultValue=false)
    public var timestamps:RequestTimestamps

    required public init(){}
}

// @DataContract
public class RequestTimestamps : Codable
{
    // @DataMember(EmitDefaultValue=false)
    public var appLayer:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var parentLookup:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var retryLookup:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var getCardData:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var cardTokenize:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var cardEncrypt:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var dbInsert:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var backendProcess:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var dbUpdate:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var parentUpdate:InOutTimes

    // @DataMember(EmitDefaultValue=false)
    public var network:InOutTimes

    required public init(){}
}

// @DataContract
public class InOutTimes : Codable
{
    required public init(){}
}


Swift ClientTokenizeACHRequest 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 /ClientTokenizeACH HTTP/1.1 
Host: api.paysecure.acculynk.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<ClientTokenizeACHRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <BillingDetails>
    <Address>String</Address>
    <City>String</City>
    <Country>String</Country>
    <State>String</State>
    <Zip>String</Zip>
  </BillingDetails>
  <Email>String</Email>
  <EncryptedAccountNumber>String</EncryptedAccountNumber>
  <FirstName>String</FirstName>
  <KeyId>String</KeyId>
  <LastName>String</LastName>
  <PhoneNumber>String</PhoneNumber>
  <PhoneType>String</PhoneType>
  <RoutingNumber>String</RoutingNumber>
  <VerifyACH>false</VerifyACH>
  <Version>String</Version>
</ClientTokenizeACHRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ClientTokenizeACH xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <Timestamps>
    <AppLayer>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </AppLayer>
    <BackendProcess>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </BackendProcess>
    <CardEncrypt>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </CardEncrypt>
    <CardTokenize>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </CardTokenize>
    <DBInsert>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </DBInsert>
    <DBUpdate>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </DBUpdate>
    <GetCardData>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </GetCardData>
    <Network>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </Network>
    <ParentLookup>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </ParentLookup>
    <ParentUpdate>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </ParentUpdate>
    <RetryLookup>
      <InTime>0001-01-01T00:00:00</InTime>
      <OutTime>0001-01-01T00:00:00</OutTime>
    </RetryLookup>
  </Timestamps>
  <ErrorCode>String</ErrorCode>
  <ErrorMessage>String</ErrorMessage>
  <ResponseCode>String</ResponseCode>
  <SessionToken>String</SessionToken>
</ClientTokenizeACH>