---
title: Use payment link to pay
slug: use-payment-link-to-pay
docTags: 
createdAt: 2026-02-27T00:02:42.849Z
---

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 credit and generate a single-use payment link. The customer follows the link and enters their bank details where they wish funds to be deposited to.

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

***

## Prerequisites

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

***

## Flow overview

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

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

    Platform Backend->>Customer: Send payment link URL

    Customer->>Jetpay: Open payment link and enter bank details

    Jetpay-->>Platform Backend: Webhook: credit 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 credit and generate payment link

Endpoint: [`PUT /credit`](https://extapi.jetpay.baselinepayments.com/docs#tag/Transactions-\(v0\)/operation/create_credit_credit_put)

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

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

curl -X PUT "$BASE_URL/credit" \
  -H "Authorization: Bearer $API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000,
    "statement": "Test Statement",
    "note": "Test Note",
    "from_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",
    "from_bank_account": "platform_bank_abc",
    "contact_id": "contact_123"
}

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

```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",
  from_bank_account: "platform_bank_abc",
  contact_id: "contact_123"
};

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

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

### Handle the response

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

```json
{
  "identifier": "credit_123",
  "link": "http://example.com",
  "amount": 10000
}
```

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 credit transaction. The flow consists of them answering the security question, entering their payment details (bank account information), and accepting the payment.

:::hint{type="warning"}
The security question and answer is created when you onboard your company with Jetpay. It can be updated in the Jetpay dashboard, under **Settings > Security**.
:::

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

