---
title: Use payment link to collect
slug: use-payment-link-to-collect
createdAt: 2026-02-26T00:15:21.110Z
---

Use this flow when you want to send a Jetpay-branded payment page to your customer. Instead of collecting payment details directly in your platform, you create a debit and generate a single-use payment link. The customer follows the link, selects their preferred payment method, and authorizes the debit. Jetpay handles the PAD and ensures the transaction is secure.

This flow is ideal for one-time payments, invoices, or situations where you don’t want to manage payment collection directly.

***

## Prerequisites

- [Jetpay API Key](docId:_zgmIm7QKrrAoX9JjaQrL)
- Your [company bank account ID](docId\:aEx0SSFndR_XgalXG2_ZF) where funds will be deposited

***

## Flow overview

```mermaid
sequenceDiagram
    actor Customer
    participant Platform Backend
    participant Jetpay

    Platform Backend->>Jetpay: PUT /debit (amount, contact_id, statement, note)
    Jetpay-->>Platform Backend: debit_transaction_id + payment_link_url

    Platform Backend->>Customer: Send payment link URL

    Customer->>Jetpay: Open payment link and select payment method
    Note right of Jetpay: Jetpay handles payment collection and PAD if EFT

    Jetpay-->>Platform Backend: Webhook: debit status update (initiated, completed, etc.)
```

***

## Implementation details

### Create a contact

If you are not yet familiar with creating contacts with Jetpay, please review the [Create a contact](docId\:BzwF0wyOoqBKGSFuGEnH0) guide.

### Create a debit and generate payment link

Use your contact ID (`contact_id`) and your merchant bank account ID (`to_bank_account`) to create a debit transaction.

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

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"
  }'
```

```python
import requests

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

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

payload = {
    "amount": 10000,
    "statement": "Test Statement",
    "note": "Test Note",
    "to_bank_account": "platform_bank_abc",
    "contact_id": "contact_123"
}

response = requests.put(f"{BASE_URL}/debit", headers=headers, json=payload)
debit = response.json()
print(debit)
```

```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"
};

const payload = {
  amount: 10000,
  statement: "Test Statement",
  note: "Test Note",
  to_bank_account: "platform_bank_abc",
  contact_id: "contact_123"
};

async function createDebit() {
  const res = await fetch(`${BASE_URL}/debit`, {
    method: "PUT",
    headers,
    body: JSON.stringify(payload)
  });

  const debit = await res.json();
  console.log(debit);
```
:::

### Handle the response

If the debit is successfully created, a response will be returned with an HTTP status code of 200 and the following response body:

```json
{
  "identifier": "debit_123",
  "link": "https://example.com",
  "amount": 10000,
  "customer_surcharge_amount": 350
}
```

The returned `link` is what you will send to your customer. This is a single-use payment URL that your customer will follow to complete the debit transaction. The flow consists of them selecting their payment method (bank or card), agreeing to a PAD agreement (if EFT), and accepting the payment request.

:::hint{type="info"}
The `customer_surcharge_amount` information is **only applicable if the debit is paid via credit card.&#x20;**&#x49;f you are simply sending the payment link to your customers to collect payment details (and not using the [collect payment method at checkout](docId\:LNP1ZGF7yBPWuvS3G5URF) flow), then you do not need to do anything with this value.
:::

### Track status updates via events/webhooks

As the transaction moves through its lifecycle, an **Event** is created for each state update. The most efficient way to track these updates in your system is to register for webhooks. If you are not yet familiar with our webhooks system, please review the [Events and webhooks](docId:79a4CGVETAChOLkpJYd5C) guide.

