> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.hopnow.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Flow 4: Convert currency

<div className="hop-lede">FX settles on the <span className="hop-strong">trading account</span> only, so money in a virtual account moves across first and, when the payout should be funded from a virtual account, back again.</div>FX trades can settle only through the trading account. Funds held in a virtual account must therefore be transferred to the trading account before conversion. After the FX trade settles, the converted funds must be transferred back to the relevant virtual account if that account will fund the payout.

<div className="hop-flow hop-flow-steps">
  <div className="hop-prereq">↳ <span className="hop-strong">Quotes are short-lived</span>, typically about 30 seconds. Read <code>expires\_at</code> on every quote and never hard-code a window.</div>

  <div className="hop-legend" aria-label="Flow legend">
    <span className="hop-legend-item"><span className="hop-chip hop-chip-platform">You</span>the API caller</span>
    <span className="hop-legend-item"><span className="hop-chip hop-chip-hop">Hop</span>automatic</span>
    <span className="hop-legend-item"><span className="hop-chip hop-chip-customer">Bank</span>counterparty</span>
  </div>

  <ol className="hop-steps">
    <li className="hop-step-row">
      <span className="hop-step-n">1</span>
      <span className="hop-chip hop-chip-platform">You</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/transfers/create-transfer" className="hop-step-title">Move the source currency from the virtual account to the trading account</a>
        <span className="hop-step-pills"><span className="hop-pill hop-post"><span className="hop-method">POST</span>/accounts/\{aid}/transfers</span><span className="hop-pill hop-object">trf\_</span> <span className="hop-pill hop-rail">only when the money sits in a virtual account</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">2</span>
      <span className="hop-chip hop-chip-platform">You</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/fx/create-fx-quote" className="hop-step-title">Request a quote for the pair and amount</a>
        <span className="hop-step-pills"><span className="hop-pill hop-post"><span className="hop-method">POST</span>/accounts/\{aid}/fx/quotes</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">3</span>
      <span className="hop-chip hop-chip-hop">Hop</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/fx/create-fx-quote" className="hop-step-title">Returns the quote with all\_in\_rate, target\_amount and expires\_at</a>
        <span className="hop-step-pills"><span className="hop-pill hop-object">fxq\_</span><span className="hop-pill hop-webhook">expires\_at</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">4</span>
      <span className="hop-chip hop-chip-platform">You</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/fx/execute-fx-quote" className="hop-step-title">Execute before expires\_at</a>
        <span className="hop-step-pills"><span className="hop-pill hop-post"><span className="hop-method">POST</span>/fx/quotes/\{id}/execute</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">5</span>
      <span className="hop-chip hop-chip-hop">Hop</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/fx/list-fx-trades" className="hop-step-title">Debits the source currency, credits the target, and returns the trade. Check status: completed, or failed with funds released; both arrive as 200</a>
        <span className="hop-step-pills"><span className="hop-pill hop-object">fxt\_</span><span className="hop-pill hop-webhook">status: completed · failed</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">6</span>
      <span className="hop-chip hop-chip-platform">You</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/transfers/create-transfer" className="hop-step-title">Move the proceeds to a virtual account in the target currency when the payout should be funded from one</a>
        <span className="hop-step-pills"><span className="hop-pill hop-post"><span className="hop-method">POST</span>/accounts/\{aid}/transfers</span><span className="hop-pill hop-object">trf\_</span> <span className="hop-pill hop-rail">only when the payout is funded from a virtual account</span></span>
      </div>
    </li>

    <li className="hop-step-row">
      <span className="hop-step-n">7</span>
      <span className="hop-chip hop-chip-platform">You</span>

      <div className="hop-step-body">
        <a href="/fx/api-reference/fx/list-fx-trades" className="hop-step-title">Reconcile trades, including manual and reversal trades booked by Hop</a>
        <span className="hop-step-pills"><span className="hop-pill hop-get"><span className="hop-method">GET</span>/accounts/\{aid}/fx/trades</span></span>
      </div>
    </li>
  </ol>

  <div className="hop-footnote">Known gaps: a failed execution returns <code>200</code> with <code>status: failed</code>; check the body, not the status code. There is no Get FX Trade endpoint and no trade webhooks, so a timed-out execute is recovered by reading the quote's <code>executed\_at</code> and scanning <a href="/fx/api-reference/fx/list-fx-trades">List FX Trades</a> for the <code>quote\_id</code>. Hop-booked <code>manual</code> and <code>reversal</code> trades change balances with no event.</div>
</div>

## Troubelshooting

| Signal | Meaning | Do this |
| - | - | - |
| `422 FX_PAIR_NOT_ENABLED` | The pair is not enabled in either direction. | Contact Hop support to have the pair enabled. |
| `422 FX_QUOTE_INVALID` on execute | The quote expired, was already executed, is unknown, or the account is not active. | Request a new quote. |
| `422 INSUFFICIENT_FUNDS` | The trading account's balance in the source currency is short. | Transfer more in (step 1) and re-quote. |
| `200` with `status: failed` | The trade did not complete; the source funds were released. | Request a new quote. |
| `503 CREDIT_CHECK_UNAVAILABLE` | Nothing was debited. | Retry shortly. Contact Hop if issue persists |
