Create the order for a quote and return deposit instructions
Quote-bound: the body can be just { quoteId } (plus to when the quote had none); direction, chain, amount and to come from the stored quote, and any that are sent must match it (409 quote_mismatch). Each quote opens at most one order: the same quoteId under another idempotency-key returns 409 quote_already_used. The idempotency-key header is required. Returns state "waiting_for_funding" for a new order, data.order.orderId, data.origin (agent_quote), data.destination (the payout address recorded with the order), data.payable and data.payableReason, data.deposit {address, amount (exact human units), amountAtomic, tokenSymbol, chainId, expiresAt, expiresInSec, confirmations, payment, attestation}, data.evidence, data.attention, data.trackUrl, data.next {action, statusPath, statusUrl (absolute), pollIntervalSec}, data.sessionId and data.reconfirmRequired (true when the provider's expected output differs materially from the quote: below the quoted minimum, or, with no published minimum, more than RECONFIRM_MAX_SHORTFALL_BPS (default 2%) below the quoted estimate, or unknown; data.reconfirmReason says which). Nothing clears it: payable stays false and data.next.action is requote_and_create_new_order (data.next.requote.body {requoteOf}). data.deposit.payment is a wallet-ready transfer of exactly this deposit (Monero URI, or EIP-681 URI plus an unsigned ERC-20 transaction {to, value, data, chainId}), non-null only while payable is true; a wallet (the user's, or an agent's acting for the user) sends it once, only if data.destination is the user's own address and POST /agent/swap/payment-check returned data.paymentCheck.safeToSend true for the unsigned payment. The same idempotency-key and body replay the same order (header idempotent-replayed: true, top-level replayed: true) with the live state: a replay offers payment only if the order still waits for funding. Never pay from a replayed or recovered create without a status read showing payable: true. While the provider's order limits are reached the create answers 202 state queued (QueuedCreateResponse, Retry-After): send the same create again; the first 200 after waiting carries data.fromQueue true. Creating an order moves no funds; whether to confirm with the user first follows the user's and the client's policy. Funds move only when the user's wallet signs. Swapper never signs.
Request
- Base URL: https://xmrtousdc.xyz/api/v1
- URL: https://xmrtousdc.xyz/api/v1/agent/swap/create
- Auth: none declared. Required headers: idempotency-key
Headers
Required on agent create and execute (400 idempotency_key_required without it). Use a new random value per order, such as a UUID from crypto.randomUUID(); never a guessable one, because anyone who knows the key can look the order up. Reuse it only to retry this same create: the same key and body return the same order (header idempotent-replayed: true) with its live state. Retry with it after network errors, timeouts and 503 order_outcome_unknown.
Request body
Example request
{
"to": "0x1111111111111111111111111111111111111111"
}Response
Create response (a new order, or a replay / recovery reporting the live order; data.fromQueue true on the first answer after waiting in the order line)
Example response
{
"operation": "swap.create",
"data": {
"deposit": {
"payment": {
"uri": "monero:<deposit address>?tx_amount=0.5",
"gas": {
"symbol": "ETH",
"chain": "Arbitrum One"
}
}
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.