USD to Stablecoin

Seamlessly enable your users to convert fiat into stablecoins.

Our on-ramp offering makes it easy for customers in any country, using a wide range of payment methods, to on-ramp into stablecoins.

To facilitate a USD to stablecoin conversion, you will need to:

Examples

ACH Push

The following example shows how to on-ramp a customer into USDC via ACH Push (this example assumes you've already created a customer and added an external account). Note that the source payment_rail field should be set to "ach_push".

This is what the API request looks like:

curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Content-Type: application/json' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <generate a idempotency-key>' \
--data-raw '{
  "amount": "25.00",
  "developer_fee": "0.5",
  "on_behalf_of": "customer_123",
  "source": {
    "payment_rail": "ach_push",
    "currency": "usd",
  },
  "destination": {
    "payment_rail": "ethereum",
    "currency": "usdc",
    "to_address": "0xdeadbeef",
  }
}'

This will respond with:

{
  "amount": "25.00",
  "developer_fee": "0.5",
  "on_behalf_of": "customer_123",
  "source": {
    "payment_rail": "ach_push",
    "currency": "usd"
  },
  "destination": {
    "payment_rail": "ethereum",
    "currency": "usdc",
    "to_address": "0xdeadbeef"
  },
  "source_deposit_instructions": {
    "bank_name": "Bank of America",
    "bank_address": "123 Bank St, California, CA 99999",
    "bank_routing_number": 123123123,
    "bank_beneficiary_name": "Bridge Ventures Inc",
    "bank_beneficiary_address": "123 Fake Street, California, CA 99999",
    "deposit_message": "BVI7depositmessage"
  },
  "receipt": {
    "initial_amount": "25.0",
    "developer_fee": "0.5",
    "exchange_fee": "0.0",
    "gas_fee": "0.0",
    "subtotal_amount": "24.5",
    "final_amount": "24.5"
  }
}

Wire

The following example shows how to on-ramp a customer into USDC via Wire. Note that the source payment_rail field should be set to "wire".

This is what the API request looks like:

curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Content-Type: application/json' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <generate a idempotency-key>' \
--data-raw '{
  "amount": "25.00",
  "developer_fee": "0.5",
  "on_behalf_of": "customer_123",
  "source": {
    "payment_rail": "wire",
    "currency": "usd",
  },
  "destination": {
    "payment_rail": "ethereum",
    "currency": "usdc",
    "to_address": "0xdeadbeef",
  }
}'

This will respond with:

{
  "amount": "25.00",
  "developer_fee": "0.5",
  "on_behalf_of": "customer_123",
  "source": {
    "payment_rail": "wire",
    "currency": "usd"
  },
  "destination": {
    "payment_rail": "ethereum",
    "currency": "usdc",
    "to_address": "0xdeadbeef"
  },
  "source_deposit_instructions": {
    "bank_name": "Bank of America",
    "bank_address": "123 Bank St, California, CA 99999",
    "bank_routing_number": 123123123,
    "bank_beneficiary_name": "Bridge Ventures Inc",
    "bank_beneficiary_address": "123 Fake Street, California, CA 99999",
    "deposit_message": "BVI7depositmessage"
  },
  "receipt": {
    "initial_amount": "25.0",
    "developer_fee": "0.5",
    "exchange_fee": "0.0",
    "gas_fee": "0.0",
    "subtotal_amount": "24.5",
    "final_amount": "24.5"
  }
}

General Notes

Note that for both wires and ACH pushes, Bridge will render deposit instructions in the response. The deposit_message is particularly important.

  • For a wire, the deposit_message must be the wire memo on the wire being sent to Bridge
  • For ACH push, the deposit_message must be in the description of the transaction that is sent to Bridge
    • Certain banks don't have enough characters to input the entire deposit message. Tell your customer to put in as much as they can.

🚧

Please ensure your customer sets the deposit message properly on the transaction

Failure to do so will prevent Bridge's auto-matching system from properly crediting your customer and completing the transfer. Bridge will reach out to you about unmatched deposits to figure out how to resolve these situations and handle it together

Once the funds are sent with the correct amount and deposit_message, Bridge will take care of the rest and send crypto to the destination address.

Fetching Transfers

Transfers that have been created can be queried via the following GET request:

curl --request GET \
     --url 'https://api.bridge.xyz/v0/transfers/<transfer_id>' \
     --header 'Api-Key: <API Key>' \
     --header 'accept: application/json'

This will respond with

{
  "id": "transfer_id",
  "state": "awaiting_funds",
  "on_behalf_of": "customer_id",
  "amount": "5.0",
  "developer_fee": "0.0",
  "source_deposit_instructions": {
    "payment_rail": "wire",
    "amount": "5.0",
    "currency": "usd",
    "deposit_message": "BVI7depositmessage",
    "bank_name": "name",
    "bank_address": "address",
    "bank_routing_number": "routing",
    "bank_account_number": "account",
    "bank_beneficiary_name": "beneficiary"
  },
  "source": {
    "payment_rail": "wire",
    "currency": "usd",
    "external_account_id": null
  },
  "destination": {
    "payment_rail": "polygon",
    "currency": "usdc",
    "to_address": "0xdeadbeef"
  },
  "receipt": {
    "initial_amount": "5.0",
    "developer_fee": "0.0",
    "exchange_fee": "0.0",
    "gas_fee": "0.0",
    "subtotal_amount": "5.0",
    "final_amount": "5.0",
  },
  "created_at": "2023-06-23T00:12:01.384Z",
  "updated_at": "2023-06-23T00:12:01.467Z"
}

Sender Information

The source key will contain additional information about the sender once money has been deposited into Bridge and matched to the transfer.

For wires, the following additional information is available:

{
  "source": {
    "payment_rail": "wire",
    "currency": "usd",
    "external_account_id": null,
    "bank_beneficiary_name": "name of person sending money",
    "bank_routing_number": "routing number of the sending bank",
    "bank_name": "name of the sending bank",
    "imad": "imad of incoming wire",
    "omad": "omad of incoming wire"
  }
}

For ACH push:

{
  "source": {
    "payment_rail": "wire",
    "currency": "usd",
    "external_account_id": null,
    "description": "ach description"
  }
}