Direct Debit

You can integrate your e-commerce application directly to our platform-agnostic Direct Debit API and process purchases and credits through a variety of bank schemes.

Click the links below to view our code samples.

Verify That the Service Is Accessible

response_object = self.client.direct_debit_service_handler().monitor()

Direct Debit Purchases

Process a Purchase

Process an ACH purchase
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
purchase_obj.customerIp("192.0.126.111")
achbank_obj = ACHBankAccount (None)
achbank_obj.accountHolderName("XYZ Company")
achbank_obj.accountType("CHECKING")
achbank_obj.accountNumber("988948193")
achbank_obj.routingNumber("211589828")
achbank_obj.payMethod("WEB")
profile_obj = Profile(None)
profile_obj.firstName("Joe")
profile_obj.lastName("Smith")
profile_obj.email("Joe.Smith@hotmail.com")
billingdetails_obj = BillingDetails(None)
billingdetails_obj.street("100 Queen Street West")
billingdetails_obj.city("Los Angeles")
billingdetails_obj.state("CA")
billingdetails_obj.country("US")
billingdetails_obj.zip("90210")
billingdetails_obj.phone("3102649010")
purchase_obj.profile(profile_obj)
purchase_obj.billingDetails(billingdetails_obj)
purchase_obj.ach(achbank_obj)
response_object = self.client_ACH.direct_debit_service_handler().submit_purchase(purchase_obj)
Process an ACH purchase using a payment token
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
achbank_obj = ACHBankAccount(None)
achbank_obj.payMethod("WEB")
achbank_obj.paymentToken("DeZpXwrWtKIt8pN")
purchase_obj.ach(achbank_obj)
response_object = self.client_ACH.direct_debit_service_handler().submit_purchase(purchase_obj)
Process an EFT purchase
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
purchase_obj.customerIp("192.0.126.111")
eftbank_obj = EFTBankAccount(None)
eftbank_obj.accountHolderName("XYZ Company")
eftbank_obj.accountNumber("336657")
eftbank_obj.transitNumber("22446")
eftbank_obj.institutionId("001")
profile_obj = Profile(None)
profile_obj.firstName("Joe")
profile_obj.lastName("Smith")
profile_obj.email("Joe.Smith@hotmail.com")
billingdetails_obj = BillingDetails(None)
billingdetails_obj.street("100 Queen Street West")
billingdetails_obj.city("Ottawa")
billingdetails_obj.state("ON")
billingdetails_obj.country("CA")
billingdetails_obj.zip("M1M1M1")
billingdetails_obj.phone("6139991100")
purchase_obj.profile(profile_obj)
purchase_obj.billingDetails(billingdetails_obj)
purchase_obj.eft(eftbank_obj)
response_object = self.client_EFT.direct_debit_service_handler().submit_purchase(purchase_obj)
Process an EFT purchase using a payment token
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
eftbank_obj = EFTBankAccount(None)
eftbank_obj.paymentToken("Dw6TqO65OiBamTA")
purchase_obj.eft(eftbank_obj)
response_object = self.client_EFT.direct_debit_service_handler().submit_purchase(purchase_obj)
Process a BACS purchase using a payment token
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
bacsbank_obj = BACSBankAccount(None)
bacsbank_obj.paymentToken("MPYuiNEUsKG5Y3A")
purchase_obj.bacs(bacsbank_obj)

response_object = self.client_BACS.direct_debit_service_handler().submit_purchase(purchase_obj)
Process a SEPA purchase using a payment token
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum(RandomTokenGenerator().generateToken())
purchase_obj.amount("10098")
sepabank_obj = SEPABankAccount(None)
sepabank_obj.paymentToken("MDY403mrZlgYgcL")
purchase_obj.sepa(sepabank_obj)
response_object = self.client_SEPA.direct_debit_service_handler().submit_purchase(purchase_obj)

Cancel a Purchase

Cancel a purchase
purchase_obj = Purchase(None)
purchase_obj.id("a02e52c7-c991-4418-966a-b62989cb0eae")
purchase_obj.status("CANCELLED")

response_object = self.client_ACH.direct_debit_service_handler().cancel_purchase(purchase_obj)

Look Up a Purchase

Look up a purchase using an ID
purchase_object = Purchase(None)
purchase_object.id("a02e52c7-c991-4418-966a-b62989cb0eae")

response_object = self.client_ACH.direct_debit_service_handler().lookup_purchase(purchase_object)
Look up a purchase using a merchant reference number
purchase_obj = Purchase(None)
purchase_obj.merchantRefNum("ORDER_ID:1231")
pagination_obj = Pagination(None)
pagination_obj.limit = "2"
response_object = self.client_ACH.direct_debit_service_handler().lookup_purchase_with_merchant_no(purchase_obj, pagination_obj)

Direct Debit Standalone Credits

Process a Standalone Credit

Process an ACH standalone credit
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_obj.amount("10098")
standalone_obj.customerIp("192.0.126.111")
achbank_obj = ACHBankAccount(None)
achbank_obj.accountHolderName("XYZ Company")
achbank_obj.accountType("CHECKING")
achbank_obj.accountNumber("988758392")
achbank_obj.routingNumber("211589828")
achbank_obj.payMethod("PPD")
profile_obj = Profile(None)
profile_obj.firstName("Joe")
profile_obj.lastName("Smith")
profile_obj.email("Joe.Smith@hotmail.com")
billingdetails_obj = BillingDetails(None)
billingdetails_obj.street("100 Queen Street West")
billingdetails_obj.city("Los Angeles")
billingdetails_obj.state("CA")
billingdetails_obj.country("US")
billingdetails_obj.zip("90210")
billingdetails_obj.phone("3102649010")
standalone_obj.profile(profile_obj)
standalone_obj.billingDetails(billingdetails_obj)
standalone_obj.ach(achbank_obj)
response_object = self.optimalApiCli_ACH.direct_debit_service_handler().submit_standalone(standalone_obj)
Process an ACH standalone credit using a payment token
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_obj.amount("10098")
achbank_obj = ACHBankAccount(None)
achbank_obj.paymentToken("DmeucrpwVXlrLkw")
achbank_obj.payMethod("PPD")
standalone_obj.ach(achbank_obj)
response_object = self.optimalApiCli_ACH.direct_debit_service_handler().submit_standalone(standalone_obj)
Process an EFT standalone credit
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_obj.amount("10098")
standalone_obj.customerIp("192.0.126.111")
eftbank_obj = EFTBankAccount(None)
eftbank_obj.accountHolderName("XYZ Company")
eftbank_obj.accountNumber("335892")
eftbank_obj.transitNumber("22446")
eftbank_obj.institutionId("001")
profile_Obj = Profile(None)
profile_Obj.firstName("Joe")
profile_Obj.lastName("Smith")
profile_Obj.email("Joe.Smith@hotmail.com")
billingdetails_Obj = BillingDetails(None)
billingdetails_Obj.street("100 Queen Street West")
billingdetails_Obj.city("Ottawa")
billingdetails_Obj.state("ON")
billingdetails_Obj.country("CA")
billingdetails_Obj.zip("90210")
billingdetails_Obj.phone("6139991100")
standalone_obj.profile(profile_Obj)
standalone_obj.billingDetails(billingdetails_Obj)
standalone_obj.eft(eftbank_obj)
response_object = self.client_EFT.direct_debit_service_handler().submit_standalone(standalone_obj)
Process an EFT standalone credit using a payment token
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_obj.amount("10098")
eftbank_obj = EFTBankAccount(None)
eftbank_obj.paymentToken("Dw6TqO65OiBamTA")
standalone_obj.eft(eftbank_obj)
response_object = self.client_EFT.direct_debit_service_handler().submit_standalone(standalone_obj)
Process a BACS standalone credit using a payment token
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum(RandomTokenGenerator().generateToken())
standalone_obj.amount("10098")
bacsbank_obj = BACSBankAccount(None)
bacsbank_obj.paymentToken("Dw6TqO65OiBamTA")
standalone_obj.bacs(bacsbank_obj)
response_object = self.client_BACS.direct_debit_service_handler().submit_standalone(standalone_obj)

Cancel a Standalone Credit

Cancel a standalone credit
standalone_obj = StandaloneCredits(None)
standalone_obj.id("a02e52c7-c991-4418-966a-b62989cb0eae")
standalone_obj.status("CANCELLED")

response_object = self.optimalApiCli_ACH.direct_debit_service_handler().cancel_standalone(standalone_obj)

Look Up a Standalone Credit

Look up a standalone credit using an ID
standalone_obj = StandaloneCredits(None)
standalone_obj.id("a02e52c7-c991-4418-966a-b62989cb0eae")

response_object = self.optimalApiCli_ACH.direct_debit_service_handler().lookup_standalone(standalone_obj)
Look up a standalone credit using a merchant reference number
standalone_obj = StandaloneCredits(None)
standalone_obj.merchantRefNum("ORDER_ID:1231")
pagination_obj = Pagination(None)
pagination_obj.limit = "2"
response_object = self.client_ACH.direct_debit_service_handler().lookup_standalone_with_merchant_no(standalone_obj, pagination_obj)
Did you find this page useful?