Swipelux
Transfers/Create a transfer

Fiat to Stablecoin (On-Ramp)

Fiat to Stablecoin (On-Ramp) transfers are transfers that convert fiat currencies into stablecoins.

Prepare the transfer request

Make sure you have the customer ID ready. This is the unique identifier for the customer who wants to convert fiat to stablecoin.

For this guide, we'll use the customer ID cus_cK69MttD5nAUAbud1B.

Make the API request

Call the POST /v1/transfers endpoint with the following request:

curl https://wallet.swipelux.com/v1/transfers \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: YOUR_SECRET_API_KEY' \
  --data '{
    "onBehalfOf": "cus_cK69MttD5nAUAbud1B",
    "amount": "50.0",
    "source": {
      "paymentRail": "card",
      "currency": "USD"
    },
    "destination": {
      "currency": "USDC"
    }
  }'

The amount parameter denotes the fiat amount to exchange from.

In this example, your customer will pay 50 USD to get approximately 48 USDC (based on the exchange rate + additional fees).

Handle the response

The API will return a JSON response containing the transfer details:

Response body
{
  "id": "tr_nEZHWur1pBSAKY7NlV",
  "onBehalfOf": "cus_cK69MttD5nAUAbud1B",
  "state": "awaiting_funds",
  "amount": "50",
  "source": {
    "currency": "USD",
    "paymentRail": "card"
  },
  "destination": {
    "currency": "USDC"
  },
  "sourceInstructions": {
    "signedUrl": "https://track.swipelux.com?specificSettings={...}"
  },
  "createdAt": "2025-04-29T10:54:08.724Z",
  "updatedAt": "2025-04-29T10:54:08.724Z"
}

Redirect the customer

Once you receive the response, redirect your customer to the signedUrl provided in the sourceInstructions object. This URL will take them to a secure payment page where they can complete the transfer.

On this page