Preauthorize and capture
To enable card-on-file features such as this one, you must contact Jetpay support directly.
This flow allows you to authorize a saved card without immediately capturing funds.
It is designed for platforms that need to reserve funds and capture them later. For example, rentals, deposits, usage-based billing, or marketplaces confirming fulfillment.
If you want to immediately charge a saved card, see Directly charge a credit cardDirect charge instead.
Jetpay currently only supports capturing the full amount of the preauthorized transaction. Partial capture is coming soon!
Prerequisites
- Your company bank account ID where funds will be deposited
- Tokenized contact credit cardContact credit card
Before you charge a saved card, the customer must exist as a Contact in Jetpay and have at least one tokenized payment method attached.
If you have not yet created a contact or collected card details, complete the Create a contact and Tokenize a contact credit card guides first. Once a payment method is stored, you can preauthorize it directly.
Flow overview
sequenceDiagram
autonumber
participant Platform
participant Jetpay
participant CardNetwork as Card Network
Platform->>Jetpay: POST /contact/{contact_id}/creditCards/{credit_card_id}/preauthorize
Jetpay->>CardNetwork: Authorize only
CardNetwork-->>Jetpay: Authorization result
Jetpay-->>Platform: Debit created (status: preauthorized)
Platform->>Jetpay: POST /debit/{debit_id}/capture
Jetpay->>CardNetwork: Capture request
CardNetwork-->>Jetpay: Capture result
Jetpay-->>Platform: Debit updated (status: paid)
Jetpay-->>Platform: Webhook (paid / failed)Implementation details
Create a preauthorization
curl https://extapi.demo.jetpay.baselinepayments.com/contact/contact_123/creditCards/cc_456/preauthorize \
-X POST \
-H "Authorization: Bearer <YOUR_API_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"amount": 100.50,
"to_bank_account_id": "<your_bank_account_id>",
"statement": "Test Statement"
}'Handle the response
If the card is successfully preauthorized, a response will be returned with an HTTP status code of 200 and the following response body:
{
"debit_id": "debit_123",
"amount": 100.50,
"statement": "Test Statement",
"to_bank_account_id": "your_bank_account_id",
"contact_id": "contact_123",
"from_credit_card_id": "cc_456",
"transaction_state": "preauthorized"
}You must store the returned debit_id so that it can be cross used to for the Capture endpoint next.
Capture the transaction
Endpoint: POST /debit/{debit_id}/capture
curl https://extapi.demo.jetpay.baselinepayments.com/debit/debit_123/capture \
-X POST \
-H "Authorization: Bearer <YOUR_API_TOKEN>"Handle the response
If the transaction is successfully captured, a response will be returned with an HTTP status code of 200. The new state of the transaction will be paid.
{
"identifier": "debit_123",
"state": "paid"
}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 guide.