---
title: EFT checkout example
slug: eft-checkout-example
docTags: 
createdAt: 2026-02-21T00:51:28.151Z
---

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

```mermaid
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 status
```

## Code sample

:::CodeblockTabs
```curl
# --------------------------------------------
# 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": "jane@example.com",
    "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": "jane@example.com"
  }'

# → 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.
```

```python
import requests
import time

BASE_URL = "https://extapi.demo.jetpay.baselinepayments.com"
API_TOKEN = "<YOUR_API_TOKEN>"

headers = {
    "Authorization": f"Bearer {API_TOKEN}",
    "Content-Type": "application/json"
}

# --------------------------------------------
# 1. Create Contact
# --------------------------------------------

contact_response = requests.put(
    f"{BASE_URL}/contact",
    headers=headers,
    json={
        "email": "jane@example.com",
        "name": "Jane Doe",
        "tags": [],
        "language": "en"
    }
)

contact_id = contact_response.json()["contact_id"]

# --------------------------------------------
# 2. Create Debit
# --------------------------------------------

debit_response = requests.put(
    f"{BASE_URL}/debit",
    headers=headers,
    json={
        "amount": 10000,
        "statement": "Test Statement",
        "note": "Test Note",
        "to_bank_account": "platform_bank_abc",
        "contact_id": contact_id,
        "preauthorize": False
    }
)

debit_id = debit_response.json()["debit_transaction_id"]

# --------------------------------------------
# 3. Add Bank Account
# --------------------------------------------

# IMPORTANT:
# You must build and present a secure form in your application
# to collect the customer’s bank account details.

bank_response = requests.put(
    f"{BASE_URL}/contact/bank-account",
    headers=headers,
    json={
        "institution": "Test Bank",
        "title": "Personal Account",
        "holder_name": "Jane Doe",
        "contact_id": contact_id,
        "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": "jane@example.com"
    }
)

bank_account_id = bank_response.json()["bank_account_id"]

# --------------------------------------------
# 4. Pay Debit
# --------------------------------------------

pay_response = requests.put(
    f"{BASE_URL}/pay-debit",
    headers=headers,
    json={
        "pad_signed": True,
        "signature_pad_time": int(time.time()),
        "from_bank_account": bank_account_id,
        "debit_transaction_id": debit_id
    }
)

print(pay_response.json())
```

```nodejs
const BASE_URL = "https://extapi.demo.jetpay.baselinepayments.com";
const API_TOKEN = "<YOUR_API_TOKEN>";

const headers = {
  "Authorization": `Bearer ${API_TOKEN}`,
  "Content-Type": "application/json"
};

async function runEFTFlow() {
  // --------------------------------------------
  // 1. Create Contact
  // --------------------------------------------

  const contactRes = await fetch(`${BASE_URL}/contact`, {
    method: "PUT",
    headers,
    body: JSON.stringify({
      email: "jane@example.com",
      name: "Jane Doe",
      tags: [],
      language: "en"
    })
  });

  const contactData = await contactRes.json();
  const contactId = contactData.contact_id;

  // --------------------------------------------
  // 2. Create Debit
  // --------------------------------------------

  const debitRes = await fetch(`${BASE_URL}/debit`, {
    method: "PUT",
    headers,
    body: JSON.stringify({
      amount: 10000,
      statement: "Test Statement",
      note: "Test Note",
      to_bank_account: "platform_bank_abc",
      contact_id: contactId,
      preauthorize: false
    })
  });

  const debitData = await debitRes.json();
  const debitId = debitData.debit_transaction_id;

  // --------------------------------------------
  // 3. Add Bank Account
  // --------------------------------------------

  // IMPORTANT:
  // You must build and present a secure form in your application
  // to collect the customer's bank account details.

  const bankRes = await fetch(`${BASE_URL}/contact/bank-account`, {
    method: "PUT",
    headers,
    body: JSON.stringify({
      institution: "Test Bank",
      title: "Personal Account",
      holder_name: "Jane Doe",
      contact_id: contactId,
      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: "jane@example.com"
    })
  });

  const bankData = await bankRes.json();
  const bankAccountId = bankData.bank_account_id;

  // --------------------------------------------
  // 4. Pay Debit
  // --------------------------------------------

  const payRes = await fetch(`${BASE_URL}/pay-debit`, {
    method: "PUT",
    headers,
    body: JSON.stringify({
      pad_signed: true,
      signature_pad_time: Math.floor(Date.now() / 1000),
      from_bank_account: bankAccountId,
      debit_transaction_id: debitId
    })
  });

  const payData = await payRes.json();
  console.log(payData);
}

runEFTFlow();
```
:::

