Stablecoin to Fiat (Crypto Off-Ramp)
Request
curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--data-raw '{
"amount": "10.0",
"developer_fee": "0.5",
"on_behalf_of": "cust_alice",
"source": {
"currency": "usdc",
"payment_rail": "ethereum",
"from_address": "0xdeadbeef"
},
"destination": {
"currency": "usd",
"payment_rail": "ach",
"external_account_id": "external_account_123",
}
}'
In this instance, we need to request your customer to deposit funds to Bridge from their wallet. The source_deposit_instructions
object in the response will contain Bridge's deposit address. You can guide your user to use Metamask or an equivalent wallet to create a blockchain transfer to move funds from their wallet to our deposit address.
Response
{
"id": "transfer_123",
"state": "awaiting_funds",
"on_behalf_of": "cust_alice",
"source_deposit_instructions": {
"payment_rail": "ethereum",
"amount": "10.0",
"currency": "usdc",
"from_address": "0xdeadbeef",
"to_address": "0xc0ffee"
},
"amount": "10.0",
"developer_fee": "0.5",
"source": {
"payment_rail": "ethereum",
"currency": "usdc",
"from_address": "0xdeadbeef"
},
"destination": {
"payment_rail": "ach",
"currency": "usd",
"external_account_id": "external_account_123",
},
"receipt": {
"initial_amount": "10.0",
"developer_fee": "0.5",
"exchange_fee": "0.0",
"final_amount": "9.5",
"source_tx_hash": "0xcafeboba", // A source tx hash will appear after the deposit is complete
},
"created_at": "2023-05-05T19:53:08.320Z",
"updated_at": "2023-05-05T19:53:08.350Z"
}
For memo-based blockchains, such as Stellar, a blockchain_memo
will be provided as part of the source_deposit_instructions
in the response. This must be included in the crypto deposit memo. When you forget to include the memo, your off-ramp will experience delays.
{
// ...
"source_deposit_instructions": {
"payment_rail": "stellar",
"amount": "10.0",
"currency": "usdc",
"from_address": "GDUY7JALICESTELLARADDRESS",
"to_address": "GDUY7JSBRIDGESTELLARDEPOSITADDRESS",
"blockchain_memo": "123456",
},
// ...
}
Note, if you'd like to attach a wire message/memo to an outgoing wire, please update the destination
json object to include wire_message
, for example:
{
// ...
"destination": {
"payment_rail": "wire",
"currency": "usd",
"external_account_id": "external_account_123",
"wire_message": "This is your wire message"
},
// ...
}
This wire_message
has very strict rules around its format. You can have at most 3 lines (separated by "\n"
), each line with a max length of 35 chars. If this standard is not met, the request will be rejected
SEPA destination payment rail
If you'd like to attach a reference to an outgoing SEPA, please update the destination
json object to include sepa_reference
, for example:
{
// ...
"destination": {
"payment_rail": "sepa",
"currency": "eur",
"external_account_id": "external_account_123",
"sepa_reference": "This is your sepa reference message"
},
// ...
}
This sepa_reference
has very strict rules around its format. If specified, it must be between 6 and 140 characters. The allowed characters are a-z
, A-Z
, 0-9
, spaces, ampersand (&
), hyphen (-
), full stop (.
), and solidus (/
). If this standard is not met, the request will be rejected
Updated 6 months ago