Skip to content

Wire Transfers

This guide will walk you through the process of executing and managing wire transfers using the FSCO Wire Service API. You’ll learn how to handle fiat-to-stablecoin (on-ramp), stablecoin-to-fiat (off-ramp), and stablecoin-to-stablecoin transfers.

Overview

The Wire Service provides a bridge between traditional banking and blockchain technology, enabling seamless transfers between fiat currencies and stablecoins. Here’s what you can do with this API:

  • On-ramp: Convert fiat currencies (USD, EUR, etc.) to stablecoins (USDC, USDT, etc.)
  • Off-ramp: Convert stablecoins to fiat currencies for bank withdrawals
  • Transfers: Move stablecoins between wallets with currency conversion
  • Track: Monitor transaction status from initiation to completion
  • Receipt: Generate official receipts for completed transfers

Prerequisites

Before using the Wire Service API, ensure you have:

  • An active FSCO account with API access
  • API authentication credentials configured (see Authentication Guide)
  • Appropriate permissions for wire operations

Getting Exchange Rates

Before creating a wire transfer, you should check the current exchange rates to provide accurate information to users.

Terminal window
curl -X GET "https://api.fsco.io/v2/wires/rates" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response:

[
{
"sourceCurrency": "USD",
"destinationCurrency": "USDC",
"rate": "0.995",
"updatedAt": "2023-10-01T12:00:00Z"
},
{
"sourceCurrency": "EUR",
"destinationCurrency": "USDC",
"rate": "1.082",
"updatedAt": "2023-10-01T12:00:00Z"
},
{
"sourceCurrency": "USDC",
"destinationCurrency": "USDT",
"rate": "0.999",
"updatedAt": "2023-10-01T12:00:00Z"
}
]

Creating a Wire Transfer

On-ramp (Fiat to Stablecoin)

To create an on-ramp wire transfer, follow these steps:

  1. Get deposit instructions for the fiat currency
  2. Provide these instructions to the user for bank deposit
  3. Once the user has made the deposit, confirm it via API
  4. Monitor the wire transfer status until completion

Step 1: Get Deposit Instructions

Terminal window
curl -X GET "https://api.fsco.io/v2/wires/deposit-instructions/USD" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response:

{
"currency": "USD",
"bankName": "Example Bank",
"accountNumber": "123456789",
"routingNumber": "987654321",
"iban": "US12345678901234567890",
"swiftCode": "EXBKUS33",
"accountHolderName": "FSCO Treasury LLC",
"reference": "FSCO-DEP-12345",
"instructions": "Please include the reference number in the wire transfer notes."
}

Step 2: Confirm Fiat Deposit

After the user has made a bank deposit, confirm it with the API:

Terminal window
curl -X POST "https://api.fsco.io/v2/wires/deposits/confirm" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"currency": "USD",
"amount": "1000.00",
"reference": "WIRE-12345",
"bankName": "Example Bank",
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"additionalDetails": {
"senderName": "John Doe",
"senderAccount": "987654321"
}
}'

Off-ramp (Stablecoin to Fiat)

To create an off-ramp wire transfer (converting stablecoins to fiat):

Terminal window
curl -X POST "https://api.fsco.io/v2/wires" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceType": "stablecoin",
"sourceCurrency": "USDC",
"sourceAmount": "1000.00",
"sourceDetails": {
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678"
},
"destinationType": "fiat",
"destinationCurrency": "USD",
"destinationDetails": {
"bankName": "Recipient Bank",
"accountNumber": "987654321",
"routingNumber": "123456789",
"accountHolderName": "Jane Doe"
},
"reference": "Withdrawal-54321",
"notes": "Monthly withdrawal"
}'

Stablecoin-to-Stablecoin Transfer

For transferring between different stablecoins:

Terminal window
curl -X POST "https://api.fsco.io/v2/wires" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"sourceType": "stablecoin",
"sourceCurrency": "USDC",
"sourceAmount": "1000.00",
"sourceDetails": {
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678"
},
"destinationType": "stablecoin",
"destinationCurrency": "USDT",
"destinationDetails": {
"walletAddress": "0xabcdef1234567890abcdef1234567890abcdef12"
},
"reference": "Portfolio-Rebalance-123",
"notes": "Rebalancing stablecoin holdings"
}'

Tracking Wire Transfers

Get a Specific Wire Transfer

Terminal window
curl -X GET "https://api.fsco.io/v2/wires/123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response:

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"status": "processing",
"type": "on-ramp",
"sourceType": "fiat",
"sourceCurrency": "USD",
"sourceAmount": "1000.00",
"sourceDetails": {
"bankName": "Example Bank",
"accountNumber": "123456789",
"accountHolderName": "John Doe"
},
"destinationType": "stablecoin",
"destinationCurrency": "USDC",
"destinationAmount": "998.50",
"destinationDetails": {
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678"
},
"createdAt": "2023-10-01T12:00:00Z",
"updatedAt": "2023-10-01T12:15:00Z",
"completedAt": null,
"txHashes": [],
"externalReferences": {
"bankReference": "REF123456"
},
"reference": "Invoice-12345",
"notes": "Payment for services"
}

List Wire Transfers

Terminal window
curl -X GET "https://api.fsco.io/v2/wires?status=processing&fromDate=2023-09-01T00:00:00Z&page=1&pageSize=10" \
-H "Authorization: Bearer YOUR_API_TOKEN"

View Wire Transfer History

Get the detailed history/audit trail of a wire transfer:

Terminal window
curl -X GET "https://api.fsco.io/v2/wires/123e4567-e89b-12d3-a456-426614174000/history" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Example Response:

{
"wireId": "123e4567-e89b-12d3-a456-426614174000",
"events": [
{
"timestamp": "2023-10-01T12:00:00Z",
"status": "pending",
"description": "Wire transfer created"
},
{
"timestamp": "2023-10-01T12:15:00Z",
"status": "processing",
"description": "Fiat deposit confirmed"
},
{
"timestamp": "2023-10-01T12:25:00Z",
"status": "processing",
"description": "Stablecoin transfer initiated"
}
]
}

Generate a Receipt

Generate a transaction receipt for a completed wire transfer:

Terminal window
curl -X GET "https://api.fsco.io/v2/wires/123e4567-e89b-12d3-a456-426614174000/receipt" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Cancel a Wire Transfer

You can cancel a pending wire transfer:

Terminal window
curl -X POST "https://api.fsco.io/v2/wires/123e4567-e89b-12d3-a456-426614174000/cancel" \
-H "Authorization: Bearer YOUR_API_TOKEN"

Common Scenarios

Scenario 1: Corporate On-ramping

A corporation needs to convert USD to USDC for a blockchain-based payment system.

  1. Get deposit instructions for USD
  2. Provide these to the corporate finance team
  3. After wire confirmation, create an on-ramp wire transfer
  4. Track the transfer until completion
  5. Generate a receipt for accounting records

Scenario 2: Investor Off-ramping

An investor wants to withdraw profits from stablecoin investments back to fiat currency.

  1. Create an off-ramp wire transfer
  2. Track the status of the wire transfer
  3. Provide the investor with regular status updates
  4. Generate a receipt once completed

Scenario 3: Treasury Management

A treasury department needs to rebalance stablecoin holdings across different currencies.

  1. Check current exchange rates
  2. Create a stablecoin-to-stablecoin transfer
  3. Monitor the transfer status
  4. Update internal records once completed

Handling Errors

Here are common errors you might encounter when using the Wire Service API:

400 Bad Request

Indicates invalid parameters or missing required fields. Check your request body for errors.

401 Unauthorized

Your API token is invalid or expired. Refresh your token or check your authorization.

403 Forbidden

You don’t have sufficient permissions to perform the operation.

404 Not Found

The requested wire transfer or resource doesn’t exist.

409 Conflict

Can’t perform the operation due to a conflict, such as trying to cancel a completed wire.

500 Internal Server Error

A server error occurred. Contact support if the issue persists.

Best Practices

  • Reference Numbers: Always include meaningful reference numbers for easier tracking
  • Error Handling: Implement robust error handling and retries for transient failures
  • Status Monitoring: Regularly poll for status updates for long-running transfers
  • Receipt Storage: Store receipts for completed transfers for record-keeping
  • Rate Checking: Always check current exchange rates before initiating transfers
  • Webhooks: Use webhooks to receive real-time status updates (see Webhooks Guide)

Advanced Use Cases

Bulk Transfers

For processing multiple transfers at once, you can use the batch API:

  1. Prepare multiple wire transfer requests
  2. Monitor the status of each transfer
  3. Handle success and failures appropriately

Scheduled Transfers

For recurring transfers:

  1. Create a wire transfer with your application’s scheduler
  2. Monitor completion and set up the next scheduled transfer
  3. Maintain records of all completed transfers

Troubleshooting

Transfer Stuck in Processing

If a transfer is stuck in the processing state:

  1. Check the wire history to identify where the process stopped
  2. Contact support if the transfer has been in processing for more than 24 hours
  3. Provide the wire ID and history information when contacting support

Failed Transfers

For failed transfers:

  1. Check the wire history to understand the reason for failure
  2. Address the underlying issue (e.g., insufficient funds, invalid bank details)
  3. Create a new wire transfer after resolving the issue

Next Steps