Fiat to Stablecoin
Overview
Section titled “Overview”This guide walks you through how to initiate a fiat-to-stablecoin wire using FSCO. These transfers are typically used to on-ramp users from traditional banking into stable digital assets like USDC or PHPX.
This flow typically completes in minutes depending on the provider and fiat processing time.
Prerequisites
Section titled “Prerequisites”- You must have a verified FSCO wallet (walletId) or a target address to receive stablecoins.
- Your organisation must be KYC/AML-approved with supported on-ramp providers.
- Your API key must include wire:write and wallet:read permissions.
1. Fetch Deposit Instructions
Section titled “1. Fetch Deposit Instructions”Use the following endpoint to fetch deposit instructions for the source currency. Your API key’s country of registration will determine the available on-ramp provider.
curl -X GET https://api.fsco.io/v2/wires/deposit-instructions/PHP \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json"
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;const FSCO_API_SECRET = process.env.FSCO_API_SECRET;
const getDepositInstructions = async () => { const response = await axios.get( 'https://api.fsco.io/v2/wires/deposit-instructions/PHP', { headers: { 'x-api-key': FSCO_API_KEY, 'x-api-secret': FSCO_API_SECRET, 'Content-Type': 'application/json', }, } );
console.log('Deposit Instructions:', response.data);};
getDepositInstructions();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
response = requests.get( "https://api.fsco.io/v2/wires/deposit-instructions/PHP", headers=headers)
print("Deposit Instructions:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;
class WireDepositInstructions{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var response = await client.GetAsync("https://api.fsco.io/v2/wires/deposit-instructions/PHP"); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Deposit Instructions: " + responseString); }}
Response:
{ "currency": "PHP", "bankName": "UnionBank", "accountNumber": "1234567890", "accountHolderName": "FSCO On-Ramp", "reference": "fsco-abc123", "instructions": "Include this reference when making the deposit"}
2. Create a Wire
Section titled “2. Create a Wire”curl -X POST https://api.fsco.io/v2/wires \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "sourceType": "fiat", "sourceCurrency": "PHP", "sourceAmount": "10000", "sourceDetails": { "note": "Deposit for on-ramp" }, "destinationType": "stablecoin", "destinationCurrency": "PHPX", "destinationDetails": { "walletId": "123e4567-e89b-12d3-a456-426614174000" } }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;const FSCO_API_SECRET = process.env.FSCO_API_SECRET;
const createWire = async () => { const response = await axios.post( 'https://api.fsco.io/v2/wires', { sourceType: 'fiat', sourceCurrency: 'PHP', sourceAmount: '10000', sourceDetails: { note: 'Deposit for on-ramp' }, destinationType: 'stablecoin', destinationCurrency: 'PHPX', destinationDetails: { walletId: '123e4567-e89b-12d3-a456-426614174000' } }, { headers: { 'x-api-key': FSCO_API_KEY, 'x-api-secret': FSCO_API_SECRET, 'Content-Type': 'application/json', }, } );
console.log('Wire created:', response.data);};
createWire();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")FSCO_API_SECRET = os.getenv("FSCO_API_SECRET")
headers = { "x-api-key": FSCO_API_KEY, "x-api-secret": FSCO_API_SECRET, "Content-Type": "application/json",}
payload = { "sourceType": "fiat", "sourceCurrency": "PHP", "sourceAmount": "10000", "sourceDetails": {"note": "Deposit for on-ramp"}, "destinationType": "stablecoin", "destinationCurrency": "PHPX", "destinationDetails": {"walletId": "123e4567-e89b-12d3-a456-426614174000"},}
response = requests.post("https://api.fsco.io/v2/wires", json=payload, headers=headers)
print("Wire created:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Threading.Tasks;
class WireCreator{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var json = @"{ ""sourceType"": ""fiat"", ""sourceCurrency"": ""PHP"", ""sourceAmount"": ""10000"", ""sourceDetails"": { ""note"": ""Deposit for on-ramp"" }, ""destinationType"": ""stablecoin"", ""destinationCurrency"": ""PHPX"", ""destinationDetails"": { ""walletId"": ""123e4567-e89b-12d3-a456-426614174000"" } }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/wires", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Wire created: " + responseString); }}
Response:
{ "id": "123e4567-e89b-12d3-a456-123e4567e89b", "status": "pending", "type": "on-ramp", "sourceType": "fiat", "sourceCurrency": "PHP", "sourceAmount": "10000", "sourceDetails": { "note": "Deposit for on-ramp" }, "destinationType": "stablecoin", "destinationCurrency": "PHPX", "destinationAmount": null, "destinationDetails": { "walletId": "123e4567-e89b-12d3-a456-426614174000" }, "createdAt": "2025-05-05T12:34:56.000Z", "updatedAt": null, "completedAt": null, "txHashes": [], "externalReferences": { "depositReference": "FSCO123456789" }, "reference": null, "notes": null}
This creates the wire. The user should now make a deposit to the bank account specified in the deposit instructions.
Once the deposit is made, the provider will notify FSCO automatically.
3. Wait for Provider Notification
Section titled “3. Wait for Provider Notification”After the user deposits fiat using the provided reference code:
- FSCO is notified by the provider once funds are received.
- FSCO matches the deposit to the correct wire via reference.
- FSCO converts the fiat to the selected stablecoin.
- The stablecoins are transferred to the target wallet.
- The wire status is updated and a
wire.completed
webhook is emitted (if configured).
To check the wire status at any time:
curl -X GET https://api.fsco.io/v2/wires/<wireId> \ -H "Authorization: Bearer $FSCO_API_KEY"
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;const FSCO_API_SECRET = process.env.FSCO_API_SECRET;const wireId = "<wireId>"; // Replace with actual wire ID
const getWire = async () => { const response = await axios.get( `https://api.fsco.io/v2/wires/${wireId}`, { headers: { 'x-api-key': FSCO_API_KEY, 'x-api-secret': FSCO_API_SECRET } } );
console.log('Wire details:', response.data);};
getWire();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")FSCO_API_SECRET = os.getenv("FSCO_API_SECRET")wire_id = "<wireId>" # Replace with actual wire ID
headers = { "x-api-key": FSCO_API_KEY, "x-api-secret": FSCO_API_SECRET}
response = requests.get(f"https://api.fsco.io/v2/wires/{wire_id}", headers=headers)
print("Wire details:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;
class WireGetter{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY"); var wireId = "<wireId>"; // Replace with actual wire ID
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var response = await client.GetAsync($"https://api.fsco.io/v2/wires/{wireId}"); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Wire details: " + responseString); }}
Which will return a response similar to the following:
{ "id": "123e4567-e89b-12d3-a456-123e4567e89b", "status": "processing", "type": "on-ramp", "sourceType": "fiat", "sourceCurrency": "PHP", "sourceAmount": "10000", "sourceDetails": { "note": "Deposit for on-ramp" }, "destinationType": "stablecoin", "destinationCurrency": "PHPX", "destinationAmount": null, "destinationDetails": { "walletId": "123e4567-e89b-12d3-a456-426614174000" }, "createdAt": "2025-05-05T12:34:56.000Z", "updatedAt": null, "completedAt": null, "txHashes": [], "externalReferences": { "depositReference": "FSCO123456789" }, "reference": null, "notes": null}
The status
will reflect the current state (e.g. processing
, completed
, failed
).
4. Receive Stablecoins
Section titled “4. Receive Stablecoins”Once processing is complete, the stablecoins are transferred on-chain to the destination wallet.
- Funds arrive in the wallet (
walletId
or raw address). - The wire is marked as
completed
. - A
wire.completed
webhook is triggered with full details of the transaction.
Important Notes
Section titled “Important Notes”- Use the wireId returned from creation to fetch status, generate receipts, or view history.
- Deposit instructions expire after a short time — delays may result in rejection or failure.
- Funds will only be matched if the correct reference code is used during deposit.
- Destination wallets must support the selected stablecoin and be funded on supported chains.
- Use webhooks for real-time updates, or poll the status endpoint if needed.