import requests


def get_test_quote(backend, headers, amount, buy_sell="buy", pair="XUS_USD") -> str:
    """Creates a test quote and returns its id"""
    quote_payload = {"action": buy_sell, "amount": amount, "currency_pair": pair}
    quote_res = requests.post(
        f"{backend}/api/account/quotes", headers=headers, json=quote_payload
    )
    quote_res.raise_for_status()
    quote_id = quote_res.json().get("quote_id")
    return quote_id