POST | /allchecks/submit/json |
---|
import Foundation
import ServiceStack
public class AllChecksApplicationDataRequest : Codable
{
public var application:Application?
public var correlationId:String?
public var napPartyId:String?
public var leid:String?
public var orderId:String?
public var partyIndividuals:[String] = []
required public init(){}
}
public class Application : Codable
{
public var applicationDetails:ApplicationDetails?
public var merchantDetails:MerchantDetails?
public var acquiring:Acquiring?
public var products:Products?
required public init(){}
}
public class ApplicationDetails : Codable
{
public var sourceSystem:SourceSystemType?
public var sourceSystemIdentifier:String?
public var customerType:CustomerType?
public var csr:String?
public var partner:Partner?
public var sellerCode:String?
public var pricingPackage:PricingPackageType?
public var contactPerson:AuthorisedSigner?
public var specialInstructions:String?
public var offerDetails:String?
public var dateContractAccepted:Date?
public var worldpayBusinessFinanceInterest:Bool?
public var sar:Bool?
public var sellerEmail:String?
public var anticipatedGoLiveDate:Date?
public var accessibilityOptions:AccessibilityOptions?
public var ultimateParentId:String?
required public init(){}
}
public enum SourceSystemType : String, Codable
{
case MARS
case ASA
case OLS
case INASA
}
public enum CustomerType : Int, Codable
{
case New = 0
case Existing = 1
case None = -1
}
public class Partner : Codable
{
public var partnerId:String?
public var partnerName:String?
required public init(){}
}
public enum PricingPackageType : Int, Codable
{
case CustomUk = 0
case MonthlyUk = 1
case SimplicityUk = 2
case PaygUk = 3
case CustomRoi = 4
case PaygeComUK = 5
case None = -1
}
public class AuthorisedSigner : ContactPerson
{
public var dateOfBirth:Date?
public var countryCode:String?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case dateOfBirth
case countryCode
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
dateOfBirth = try container.decodeIfPresent(Date.self, forKey: .dateOfBirth)
countryCode = try container.decodeIfPresent(String.self, forKey: .countryCode)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if dateOfBirth != nil { try container.encode(dateOfBirth, forKey: .dateOfBirth) }
if countryCode != nil { try container.encode(countryCode, forKey: .countryCode) }
}
}
public class ContactPerson : Codable
{
public var title:String?
public var firstName:String?
public var middleName:String?
public var lastName:String?
public var telephoneNumber:String?
public var altTelephoneNumber:String?
public var email:String?
public var position:String?
public var preferredContactMethod:PreferredContactMethodType?
public var preferredContactBestTime:String?
required public init(){}
}
public enum PreferredContactMethodType : String, Codable
{
case Email
case Telephone
case Any
}
public class AccessibilityOptions : Codable
{
public var audiotapeRequired:Bool?
public var largePrintRequired:Bool?
public var uncontractedBrailleGrade1Required:Bool?
public var uncontractedBrailleGrade2Required:Bool?
public var nextGenerationTextRequired:Bool?
required public init(){}
}
public class MerchantDetails : Codable
{
public var business:Business?
public var principals:[Principal] = []
public var outlets:[Outlet] = []
public var goodsAndServices:GoodsAndServices?
required public init(){}
}
public class Business : Codable
{
public var legalName:String?
public var legalAddress:BusinessAddress?
public var websiteAddress:String?
public var companyType:CompanyType?
public var companyTypeOther:String?
public var companyRegistrationNumber:String?
public var charityNumber:String?
public var merchantCategoryCode:String?
public var merchantCategoryDescription:String?
public var descriptionOfGoodsAndServices:String?
public var vatNumber:String?
public var dateStartedTrading:Date?
public var countryOfIncorporation:String?
public var regionOfIncorporation:String?
public var financials:Financials?
public var newToCards:Bool?
public var tradeAssociation:TradeAssociation?
required public init(){}
}
public class BusinessAddress : Address
{
public var isCommercial:Bool?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case isCommercial
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
isCommercial = try container.decodeIfPresent(Bool.self, forKey: .isCommercial)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if isCommercial != nil { try container.encode(isCommercial, forKey: .isCommercial) }
}
}
public class Address : Codable
{
public var address1:String?
public var address2:String?
public var address3:String?
public var postcode:String?
public var city:String?
public var state:String?
public var countrycode:String?
required public init(){}
}
public enum CompanyType : String, Codable
{
case SoleTrader
case Partnership
case LimitedCompany
case Trust
case RegisteredCharity
case PublicLimitedCompany
case LimitedByGuarantee
case ClubSocietyAssociation
case CommunityInterestCompanyOrIndustrialProvident
case LimitedLiabilityPartnership
case Other
}
public class Financials : Codable
{
public var annual:Double?
public var cardPercentage:Double?
public var creditCardPercentage:Double?
public var averageTransactionValue:Double?
required public init(){}
}
public class TradeAssociation : Codable
{
public var groupName:String?
public var memberNumber:String?
required public init(){}
}
public class Principal : Codable
{
public var title:String?
public var firstName:String?
public var middleName:String?
public var lastName:String?
public var dateOfBirth:Date?
public var nationality:String?
public var homeAddresses:[PrincipalAddress] = []
public var ownershipPercentage:Double?
public var position:PositionType?
public var isFinancialController:Bool?
required public init(){}
}
public class PrincipalAddress : Address
{
public var startDate:Date?
public var endDate:Date?
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case startDate
case endDate
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
startDate = try container.decodeIfPresent(Date.self, forKey: .startDate)
endDate = try container.decodeIfPresent(Date.self, forKey: .endDate)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if startDate != nil { try container.encode(startDate, forKey: .startDate) }
if endDate != nil { try container.encode(endDate, forKey: .endDate) }
}
}
public enum PositionType : Int, Codable
{
case SoleTrader = 0
case Partner = 1
case Director = 2
case CompanySecretary = 3
case ChiefFinancialOfficer = 4
case Chairman = 5
case DesignatedBoardMember = 7
case Settlor = 8
case Treasurer = 9
case Trustee = 10
case ChiefExecutive = 11
case AuthorisedPersonWithConsent = 12
case NonExecutiveDirector = 13
case ContactPerson = 14
case Shareholder = 15
}
public class Outlet : Codable
{
public var tradingName:String?
public var tradingAddress:BusinessAddress?
public var contactPerson:ContactPerson?
public var terminalDeliveryAddress:BusinessAddress?
public var correspondenceAddress:BusinessAddress?
public var settlementBankAccount:BankAccount?
public var chargesBankAccount:BankAccount?
public var directDebitCorrespondenceEmail:String?
public var clearingDetails:ClearingDetails?
public var productAllocation:[OutletAllocatedProduct] = []
required public init(){}
}
public class BankAccount : Codable
{
public var sortCode:String?
public var accountNumber:String?
public var bankName:String?
public var bankAccountName:String?
required public init(){}
}
public class ClearingDetails : Codable
{
public var merchantUrl:String?
public var telephone:String?
public var email:String?
required public init(){}
}
public class OutletAllocatedProduct : Codable
{
public var id:Int?
public var quantity:Int?
required public init(){}
}
public class GoodsAndServices : Codable
{
public var goodsProvidedByThirdParty:Bool?
public var deposits:Deposits?
public var warrantiesAndGuarantees:WarrantiesAndGuarantees?
public var prepayments:Prepayments?
public var membershipsSubscriptionAndInsurancePremiums:MembershipsSubscriptionAndInsurancePremiums?
public var stockHeldAtAnotherAddressLocation:Address?
required public init(){}
}
public class Deposits : Codable
{
public var accepted:Bool?
public var perOfSalesWhereInitialDepositTaken:Int?
public var sizePercOfTotalValue:Int?
public var avgTimeBeforeDeliveryTaken:Int?
public var avgTimeBeforeDeliveryBalanceTaken:Int?
required public init(){}
}
public class WarrantiesAndGuarantees : Codable
{
public var levyCharge:Bool?
public var percCardTurnover:Int?
public var avgLengthInMonths:Int?
public var percGoodsReturned:Int?
public var thirdPartyProviders:String?
required public init(){}
}
public class Prepayments : Codable
{
public var fullPaymentAcceptedPriorToSupply:Bool?
public var percGoodsWherePaymentTakenPriorToDelivery:Int?
public var avgDaysPaymentTakenInAdvance:Int?
required public init(){}
}
public class MembershipsSubscriptionAndInsurancePremiums : Codable
{
public var levyCharge:Bool?
public var percCardTurnover:Int?
public var avgLengthInMonths:Int?
public var membershipCost:Double?
required public init(){}
}
public class Acquiring : Codable
{
public var settlementPeriodTPlus:Int?
public var rates:Rates?
public var services:Services?
public var tradingCurrencies:[TradingCurrency] = []
required public init(){}
}
public class Rates : Codable
{
public var cardCharges:[CardCharge] = []
public var premiumTransactionCharges:[PremiumTransactionCharge] = []
public var additionalTarrifs:[AdditionalTarrif] = []
required public init(){}
}
public class CardCharge : Codable
{
public var cardType:CardType?
public var purchase:RateChargePair?
public var refund:RateChargePair?
required public init(){}
}
public enum CardType : String, Codable
{
case VisaDebit
case VisaCredit
case VisaCommercial
case MastercardDebit
case MastercardCredit
case MastercardCommercial
case MastercardWorldSignia
case JcbCredit
case JcbDebit
case JcbCommercial
case DinersDiscoverCredit
case DinersDiscoverDebit
case DinersDiscoverCommercial
case Amex
case ChinaUnionPayCredit
case ChinaUnionPayDebit
case ChinaUnionPayCommercial
case VisaBusinessDebit
case MastercardBusiness
}
public class RateChargePair : Codable
{
public var percent:Double?
public var cost:Double?
required public init(){}
}
public class PremiumTransactionCharge : Codable
{
public var type:PremiumTransactionChargeType?
public var creditCard:RateChargePair?
public var debitCard:RateChargePair?
required public init(){}
}
public enum PremiumTransactionChargeType : String, Codable
{
case Magstripe
case CnpMoto
case Paper
case PanKeyEntry
case SecureEcom
case NonSecureEcom
case InterRegional
case IntraRegional
case NonAuth
}
public class AdditionalTarrif : Codable
{
public var type:AdditionalTarrifType?
public var cost:Double?
required public init(){}
}
public enum AdditionalTarrifType : String, Codable
{
case NameAndAddressCheck
case Auth
case chargeback
case Mmsc
case PaperStatement
case PciVerbalAssessment
case PciIpScan
case PciNonCompliance
case PciSaferPaymentsPlus
case JoiningFee
case PayMonthlyAcquiringFee
case PciSaferPayments
}
public class Services : Codable
{
public var cnp:Cnp?
public var amex:Amex?
public var cashbackRequired:Bool?
public var worldpayDashboardRequired:Bool?
public var paperInvoicingRequired:Bool?
required public init(){}
}
public class Cnp : Codable
{
public var required:Bool?
public var percentage:Double?
required public init(){}
}
public class Amex : Codable
{
public var required:Bool?
public var existingAmexNumber:String?
required public init(){}
}
public class TradingCurrency : Codable
{
public var transactionCurrencies:[CurrencyCodeType] = []
public var settlementCurrency:CurrencyCodeType?
public var settlementBankSwift:String?
public var settlementBankIban:String?
required public init(){}
}
public enum CurrencyCodeType : String, Codable
{
case GBP
case EUR
case USD
case AED
case AFN
case ALL
case AMD
case ANG
case AOA
case ARS
case AUD
case AWG
case AZN
case BAM
case BBD
case BDT
case BGN
case BHD
case BIF
case BMD
case BND
case BOB
case BRL
case BSD
case BTN
case BWP
case BYR
case BZD
case CAD
case CDF
case CHF
case CLP
case CNY
case COP
case COU
case CRC
case CUC
case CUP
case CVE
case CZK
case DJF
case DKK
case DOP
case DZD
case EEK
case EGP
case ERN
case ETB
case FJD
case FKP
case GEL
case GHS
case GIP
case GMD
case GNF
case GTQ
case GYD
case HKD
case HNL
case HRK
case HTG
case HUF
case IDR
case ILS
case INR
case IQD
case IRR
case ISK
case JMD
case JOD
case JPY
case KES
case KGS
case KHR
case KMF
case KPW
case KRW
case KWD
case KYD
case KZT
case LAK
case LBP
case LKR
case LRD
case LSL
case LTL
case LVL
case LYD
case MAD
case MDL
case MGA
case MKD
case MMK
case MNT
case MOP
case MRO
case MUR
case MVR
case MWK
case MXN
case MYR
case MZN
case NAD
case NGN
case NIO
case NOK
case NPR
case NZD
case OMR
case PAB
case PEN
case PGK
case PHP
case PKR
case PLN
case PYG
case QAR
case RON
case RSD
case RUB
case RWF
case SAR
case SBD
case SCR
case SDG
case SEK
case SGD
case SHP
case SLL
case SOS
case SRD
case STD
case SYP
case SZL
case THB
case TJS
case TMT
case TND
case TOP
case TRY
case TTD
case TWD
case TZS
case UAH
case UGX
case UYU
case UZS
case VEF
case VND
case VUV
case WST
case YER
case ZAR
case ZMK
case ZWL
}
public class Products : Codable
{
public var posProducts:PosProducts?
public var ecomProducts:EcomProducts?
public var wptProducts:WptProducts?
public var ipProducts:IpProducts?
required public init(){}
}
public class PosProducts : Codable
{
public var term:Int?
public var renewalLength:Int?
public var products:[PosProduct] = []
required public init(){}
}
public class PosProduct : Codable
{
public var id:Int?
public var type:PosProductType?
public var quantity:Int?
public var relatedFees:[ProductFee] = []
public var options:[PosProductOption] = []
required public init(){}
}
public enum PosProductType : String, Codable
{
case Mobile
case Wifi
case Bluetooth
case Fixed
case PosMidOnly
}
public class ProductFee : Codable
{
public var type:ProductFeeType?
public var cost:Double?
required public init(){}
}
public enum ProductFeeType : String, Codable
{
case HireCost
case TransactionCost
case ServiceFee
case ManagedServiceSetup
case ManagedServiceMonthly
}
public class PosProductOption : Codable
{
public var type:PosProductOptionType?
public var value:String?
required public init(){}
}
public enum PosProductOptionType : String, Codable
{
case PSP
}
public class EcomProducts : Codable
{
public var term:Int?
public var renewalLength:Int?
public var products:[EcomProduct] = []
public var options:[EcomOption] = []
required public init(){}
}
public class EcomProduct : Codable
{
public var id:Int?
public var type:EcomProductType?
public var quantity:Int?
public var relatedFees:[ProductFee] = []
public var options:[EcomProductOption] = []
required public init(){}
}
public enum EcomProductType : String, Codable
{
case Gateway
case VirtualTerminal
case PayByLink
case EcomMidOnly
}
public class EcomProductOption : Codable
{
public var type:EcomProductOptionType?
public var value:String?
required public init(){}
}
public enum EcomProductOptionType : String, Codable
{
case PSP
case FreeTransactions
}
public class EcomOption : Codable
{
public var type:EcomOptionType?
public var relatedFees:[ProductFee] = []
required public init(){}
}
public enum EcomOptionType : String, Codable
{
case Paypal
case FuturePay
case RMM
}
public class WptProducts : Codable
{
public var term:Int?
public var renewalLength:Int?
public var posInstallationDate:Date?
public var integratedSolutionProvider:IntegratedSolutionProvider?
public var products:[WptProduct] = []
required public init(){}
}
public class IntegratedSolutionProvider : Codable
{
public var name:String?
public var address:Address?
public var telephone:String?
public var primaryContact:IspContact?
public var technicalContact:IspContact?
public var providerType:String?
public var providerSoftware:String?
required public init(){}
}
public class IspContact : Codable
{
public var title:String?
public var firstName:String?
public var lastName:String?
public var position:String?
public var emailAddress:String?
required public init(){}
}
public class WptProduct : Codable
{
public var type:WptProductType?
public var id:Int?
public var variant:WptVariantType?
public var quantity:Int?
public var relatedFees:[ProductFee] = []
required public init(){}
}
public enum WptProductType : String, Codable
{
case VerifoneP400
case IngenicoWL258
case VerifoneV240
}
public enum WptVariantType : String, Codable
{
case Serial
case Usb
case Ethernet
case None
}
public class IpProducts : Codable
{
public var term:Int?
public var renewalLength:Int?
public var integratedSolutionProvider:IntegratedSolutionProvider?
public var products:[IpProduct] = []
required public init(){}
}
public class IpProduct : Codable
{
public var id:Int?
public var type:IpProductType?
public var quantity:Int?
public var relatedFees:[ProductFee] = []
public var variant:IpVariantType?
required public init(){}
}
public enum IpProductType : String, Codable
{
case PaxA920
case MiuraM020
}
public enum IpVariantType : String, Codable
{
case Sdk
case Cloud
case None
}
public class StandardResponse : Codable
{
public var status:Int?
public var correlationId:String?
public var message:String?
required public init(){}
}
Swift AllChecksApplicationDataRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /allchecks/submit/json HTTP/1.1
Host: wpcdd-featuretest-ws.worldpay.com
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"Application":{"ApplicationDetails":{"SourceSystem":"MARS","SourceSystemIdentifier":"String","CustomerType":"New","Csr":"String","Partner":{"PartnerId":"String","PartnerName":"String"},"SellerCode":"String","PricingPackage":"CustomUk","ContactPerson":{"DateOfBirth":"\/Date(-62135596800000-0000)\/","CountryCode":"String","Title":"String","FirstName":"String","MiddleName":"String","LastName":"String","TelephoneNumber":"String","AltTelephoneNumber":"String","Email":"String","Position":"String","PreferredContactMethod":"Email","PreferredContactBestTime":"String"},"SpecialInstructions":"String","OfferDetails":"String","DateContractAccepted":"\/Date(-62135596800000-0000)\/","WorldpayBusinessFinanceInterest":false,"Sar":false,"SellerEmail":"String","AnticipatedGoLiveDate":"\/Date(-62135596800000-0000)\/","AccessibilityOptions":{"AudiotapeRequired":false,"LargePrintRequired":false,"UncontractedBrailleGrade1Required":false,"UncontractedBrailleGrade2Required":false,"NextGenerationTextRequired":false},"UltimateParentId":"String"},"MerchantDetails":{"Business":{"LegalName":"String","LegalAddress":{"IsCommercial":false,"Address1":"String","Address2":"String","Address3":"String","Postcode":"String","City":"String","State":"String","Countrycode":"String"},"WebsiteAddress":"String","CompanyType":"SoleTrader","CompanyTypeOther":"String","CompanyRegistrationNumber":"String","CharityNumber":"String","MerchantCategoryCode":"String","MerchantCategoryDescription":"String","DescriptionOfGoodsAndServices":"String","VatNumber":"String","DateStartedTrading":"\/Date(-62135596800000-0000)\/","CountryOfIncorporation":"String","RegionOfIncorporation":"String","Financials":{"Annual":0,"CardPercentage":0,"CreditCardPercentage":0,"AverageTransactionValue":0},"NewToCards":false,"TradeAssociation":{"GroupName":"String","MemberNumber":"String"}},"GoodsAndServices":{"GoodsProvidedByThirdParty":false,"Deposits":{"Accepted":false,"PerOfSalesWhereInitialDepositTaken":0,"SizePercOfTotalValue":0,"AvgTimeBeforeDeliveryTaken":0,"AvgTimeBeforeDeliveryBalanceTaken":0},"WarrantiesAndGuarantees":{"LevyCharge":false,"PercCardTurnover":0,"AvgLengthInMonths":0,"PercGoodsReturned":0,"ThirdPartyProviders":"String"},"Prepayments":{"FullPaymentAcceptedPriorToSupply":false,"PercGoodsWherePaymentTakenPriorToDelivery":0,"AvgDaysPaymentTakenInAdvance":0},"MembershipsSubscriptionAndInsurancePremiums":{"LevyCharge":false,"PercCardTurnover":0,"AvgLengthInMonths":0,"MembershipCost":0},"StockHeldAtAnotherAddressLocation":{"Address1":"String","Address2":"String","Address3":"String","Postcode":"String","City":"String","State":"String","Countrycode":"String"}}},"Acquiring":{"SettlementPeriodTPlus":0,"Rates":{},"Services":{"Cnp":{"Required":false,"Percentage":0},"Amex":{"Required":false,"ExistingAmexNumber":"String"},"CashbackRequired":false,"WorldpayDashboardRequired":false,"PaperInvoicingRequired":false}},"Products":{"PosProducts":{"Term":0,"RenewalLength":0},"EcomProducts":{"Term":0,"RenewalLength":0},"WptProducts":{"Term":0,"RenewalLength":0,"PosInstallationDate":"\/Date(-62135596800000-0000)\/","IntegratedSolutionProvider":{"Name":"String","Address":{"Address1":"String","Address2":"String","Address3":"String","Postcode":"String","City":"String","State":"String","Countrycode":"String"},"Telephone":"String","PrimaryContact":{"Title":"String","FirstName":"String","LastName":"String","Position":"String","EmailAddress":"String"},"TechnicalContact":{"Title":"String","FirstName":"String","LastName":"String","Position":"String","EmailAddress":"String"},"ProviderType":"String","ProviderSoftware":"String"}},"IpProducts":{"Term":0,"RenewalLength":0,"IntegratedSolutionProvider":{"Name":"String","Address":{"Address1":"String","Address2":"String","Address3":"String","Postcode":"String","City":"String","State":"String","Countrycode":"String"},"Telephone":"String","PrimaryContact":{"Title":"String","FirstName":"String","LastName":"String","Position":"String","EmailAddress":"String"},"TechnicalContact":{"Title":"String","FirstName":"String","LastName":"String","Position":"String","EmailAddress":"String"},"ProviderType":"String","ProviderSoftware":"String"}}}},"CorrelationId":"String","NapPartyId":"String","LEID":"String","OrderId":"String","PartyIndividuals":["String"]}
HTTP/1.1 200 OK Content-Type: text/csv Content-Length: length {"Status":0,"CorrelationId":"String","Message":"String"}