repeatPayouts with Saved Payment Methods

Hyperswitch allows you to store payment method details in a secure, PCI-compliant card vault for subsequent payout processing. By utilizing stored credentials, you can programmatically list a customer’s saved methods and retrieve a payment_token to initiate payouts without re-collecting sensitive information.

Tokenizing Payment Methods

Payment methods are persisted in the Hyperswitch Vaultarrow-up-right through two primary entry points:

  • Pre-transaction storage: Create a payment method for a specific customer using the /payment_methods APIarrow-up-right. This action stores details directly in the secure locker.

  • Post-transaction storage: Details are automatically vaulted following a successful transaction if specific flags are set:

    • For payments: Set "setup_future_usage": "off_session".

    • For payouts: Set "recurring": true.

Retrieving Saved Methods

To process a payout, fetch the identifiers for a customer’s saved methods via the List Payment Methods APIarrow-up-right. The response includes a payment_token required for transaction processing.

Executing the Payout

The payment_token is passed in the Payouts Createarrow-up-right request to trigger the fund transfer using the customer's vaulted credentials.

Setup and Integration

Utilize the Hyperswitch Dashboard and the specialized Postman collection to test vaulted payout flows.

Prerequisites

Before implementing saved payment method workflows, ensure the following:

Step-by-Step Implementation

Import Testing Collection

Download and import the Saved Payment Methods Postman Collectionarrow-up-right.

Import Postman collection

Configure Environment

In the Variables tab of the collection, define the following global parameters:

  • baseUrl: https://sandbox.hyperswitch.io

  • merchant_id: Your unique identifier.

  • api_key: Your secret API key.

Updating env variables in Postman collection

Direct Vaulting: Follow the sequence to create a payment method and immediately utilize the resulting token for a payout.

Recurring/Subsequent Payouts: Follow the sequence to list existing customer payment methods and process a payout using a previously stored token.

swapSmart Router for Payoutschevron-right

Last updated

Was this helpful?