EFT checkout example
2 min
This example walks through a full end-to-end EFT payment flow. It demonstrates how to create a contact, create a debit, securely collect and attach a bank account, and then pay the debit.
Use this as a reference implementation to understand how the pieces fit together in a real checkout experience.
Flow diagram
sequenceDiagram
participant Backend as Platform Backend
participant Frontend as Platform Frontend
actor Customer
participant Jetpay as Jetpay API
Backend->>Jetpay: Create contact
Jetpay-->>Backend: contact_id
Backend->>Jetpay: Create debit
Jetpay-->>Backend: debit_transaction_id
Frontend->>Customer: Collect bank account details
Customer->>Frontend: Submit bank details
Frontend->>Backend: Bank account data
Backend->>Jetpay: Create bank account
Jetpay-->>Backend: bank_account_id
Backend->>Jetpay: Pay debit
Jetpay-->>Backend: Debit statusCode sample
# --------------------------------------------
# Configuration
# --------------------------------------------
BASE_URL="https://extapi.demo.jetpay.baselinepayments.com"
API_TOKEN="<YOUR_API_TOKEN>"
# --------------------------------------------
# 1. Create Contact
# --------------------------------------------
curl -X PUT "$BASE_URL/contact" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "Jane Doe",
"tags": [],
"language": "en"
}'
# → Save the returned contact_id (e.g., contact_123)
# --------------------------------------------
# 2. Create Debit
# --------------------------------------------
curl -X PUT "$BASE_URL/debit" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"statement": "Test Statement",
"note": "Test Note",
"to_bank_account": "platform_bank_abc",
"contact_id": "contact_123",
"preauthorize": false
}'
# → Save the returned debit_transaction_id (e.g., debit_456)
# --------------------------------------------
# 3. Collect Bank Details and Add Bank Account
# --------------------------------------------
# IMPORTANT:
# You must create and present a secure form in your application
# to collect the customer's bank account details.
# Jetpay does not host an EFT collection form.
curl -X PUT "$BASE_URL/contact/bank-account" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"institution": "Test Bank",
"title": "Personal Account",
"holder_name": "Jane Doe",
"contact_id": "contact_123",
"account_type": "checking",
"transit_number": "12345",
"institution_number": "001",
"account_number": "1234567",
"holder_address": "123 Main St",
"holder_address_postal_code": "A1A1A1",
"holder_address_city": "Toronto",
"holder_address_country": "CA",
"holder_email": "[email protected]"
}'
# → Save the returned bank_account_id (e.g., bank_account_789)
# --------------------------------------------
# 4. Pay Debit
# --------------------------------------------
curl -X PUT "$BASE_URL/pay-debit" \
-H "Authorization: Bearer $API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pad_signed": true,
"signature_pad_time": 1700000000,
"from_bank_account": "bank_account_789",
"debit_transaction_id": "debit_456"
}'
# → The API returns the updated debit object.
# → Implement webhooks to track final status updates.