Pinned source and boundary
The normative source is SEP-6 at commit0dc4592cb44dda1943341016f076e9326874daed. The standards baseline records its digest.
This page covers GET /withdraw, optional GET /withdraw-exchange, GET /transaction, and GET /transactions. Use the deposit guide for inbound external funding. Interactive withdrawal UI belongs to SEP-24 and is not a substitute for this non-interactive API flow.
Locked prerequisites
Before initiation, lock the target and network, SEP-1 and/info digests, exact asset and issuer, advertised funding method, authenticated customer identity, controlled payout destination, source account, maximum amount and fee budget, callback origin, refund destination, and cleanup owner.
The controlled source account must hold only capped testnet value. The external receiver must be a sandbox or organization-owned sink. Production financial details, real customer data, and pubnet signing are prohibited.
Discover the route
Read/info.withdraw[asset_code] for enabled, authentication_required, funding methods, amount limits, and fee fields. For a non-equivalent pair, require /info.withdraw-exchange, compatible SEP-38 prices, and the selected external destination asset.
Use funding_method; type is deprecated. Financial account details belong in SEP-12, not dest, dest_extra, or other query parameters. Legacy fields are tested only in an explicitly enabled compatibility case and are redacted before transport logs.
If authentication is required, send a valid SEP-10 or SEP-45 JWT on initiation and history requests. The authenticated subject identifies the customer, while the optional withdrawal account identifies the payment source and may differ only when the locked case permits it.
Same-asset initiation
CallGET /withdraw with the exact asset_code and advertised funding_method. Optional inputs include the controlled source account, amount, country, customer ID, locale, callback, location, and paired refund_memo and refund_memo_type.
A 200 response begins the withdrawal. Record the anchor transaction ID, anchor receiving account, payment memo and type, estimated time, limits, fees, and extra information. The controlled profile requires a transaction ID even though the base response makes it optional.
Do not submit a Stellar transaction from the initiation response alone. Query GET /transaction?id=<id> until the record reaches pending_user_transfer_start, then use its current:
withdraw_anchor_accountas the payment destination;withdraw_memoandwithdraw_memo_typeexactly as returned;amount_inas the amount to send, including any additive fee policy;amount_in_assetwhen the transaction is quote-linked;- action deadline and quote expiry as hard execution limits.
Cross-asset initiation
UseGET /withdraw-exchange when the Stellar source asset and external destination asset are non-equivalent. Lock the SEP-38 identifiers, amount, funding/delivery method, and quote policy.
For market-rate testing, capture the indicative price without treating it as guaranteed. For firm-rate testing, obtain a SEP-38 quote and pass its ID. The request source asset, destination asset, source amount, and funding method must match the quote or produce 400 with no payable transaction.
Submit the Stellar payment before quote expiry to require the agreed rate. A payment after expiry follows the anchor’s disclosed policy; SEP-6 does not require one universal outcome. The fixture therefore locks one expected action: reject before payment, process at a newly disclosed rate with consent, hold for review, or refund. Silence, hidden repricing, or loss of funds fails the case.
Submit exactly once
Construct the payment from the refreshed transaction record and verify network passphrase, source, destination, asset code and issuer, amount, memo type/value, sequence, time bounds, and fee before signing. Simulate when the operation type supports it, then submit once. An accepted Horizon response is not completion. Persist the transaction hash and reconcile it against the anchor record. If submission times out or returns an unknown outcome, search the selected network by hash, source sequence, destination, amount, asset, memo, and time window before any retry. Never rebuild the same intent with a new sequence until reconciliation proves the original was not accepted.Duplicate payment case
Submit a second controlled payment carrying the same matching data only in a dedicated negative fixture. The anchor must not pay the external destination twice. It must associate the extra value with an observable hold or refund path and expose unambiguous operator action. Record both Stellar hashes and the single external payout identifier.Underpayment and overpayment
Exercise exact, below, and aboveamount_in separately. The expected action is target policy, not invented by RampSpec. Each case locks whether the anchor rejects, waits, requests an adjustment, applies a disclosed tolerance, or refunds. The amount delta and fee treatment must be visible and mathematically reconcilable.
Late payment
Do not deliberately send after a deadline outside a controlled refundable fixture. A late case records the user-action deadline, quote expiry, ledger close time, anchor receipt time, policy selected before submission, terminal status, and refund or payout result.Status contract
PollGET /transaction with bounded backoff or consume a callback whose signature and body are verified. Accept only transitions allowed by the locked state graph.
pending_user requires a safe, redacted action description. user_action_required_by appears only while user action is possible. Status and completion timestamps cannot move backward, and repeated polling or callback delivery cannot duplicate an action.
Transaction lookup
GET /transaction accepts exactly one useful selector: anchor id, stellar_transaction_id, or external_transaction_id. A successful response contains one transaction object; unknown records return 404. Cross-tenant, cross-account, and wrong-memo selectors must behave as not found rather than reveal ownership.
For every record validate kind, status, amounts/assets, fee details, quote ID, redacted source/destination, Stellar instructions, timestamps, external and Stellar IDs, update requests, refunds, and messages. Fields that do not apply to the current kind or status must be absent rather than copied from another transaction.
History behavior
CallGET /transactions with asset code and account, then exercise no_older_than, limit, repeated kind, and exclusive paging_id independently. Require:
- time-descending ordering and stable page boundaries;
- no duplicate or missing record while paging a frozen fixture;
- only
withdrawalandwithdrawal-exchangewhen those kinds are selected; - an empty array, not an error, when no records match;
- the authenticated account to match the request when authentication is enabled;
- account-plus-memo isolation for every shared-account response;
- consistent transaction objects between history and single lookup.
Settlement correlation
For the Stellar input, query the locked network independently and verify the transaction succeeded, included the exact payment operation, used the expected source and anchor destination, asset and issuer, amount and memo, and closed inside the run window. For the external output, verify a controlled receipt with the expected asset, net amount, redacted destination fingerprint, provider status, and immutable external ID. One external ID maps to one anchor transaction and one logical payout. A completed anchor record without both required observations is a false-completion finding.Refund semantics
Use therefunds object; the older refunded boolean is compatibility data only. Validate:
stellar or external. The refund destination memo follows refund_memo and refund_memo_type when both were supplied; otherwise it follows the original withdrawal payment memo. Correlate Stellar refunds to successful operations and external refunds to controlled provider receipts.
A full refund returns the recorded input less only the disclosed refund fee and reaches refunded. A partial refund remains explicit in amounts and status history. Duplicate, late, underpaid, overpaid, expired-quote, failed-payout, and cancelled fixtures each assert the target’s locked refund policy.
Deprecated behavior
Do not treatnon_interactive_customer_info_needed, customer_info_status, /fee, dest, dest_extra, type, memo_type for user identification, wallet name/URL, or the refunded boolean as current implementation proof. Capture them in a compatibility section when encountered and require the current SEP-12, funding-method, fee-details, and refunds paths for release gating.
The interactive branches of SEP-6 are deprecated in favor of SEP-24. A URL or UI returned by a legacy SEP-6 implementation is evidence of compatibility only, not a passing SEP-24 journey.
Evidence and findings
Evidence includes release and discovery digests, target/network, authenticated subject class, customer/transaction fixture IDs, kind, assets, method, quote/expiry, requested and actual amounts, fee/refund math, instruction digest, Stellar hash/ledger/operation, external receipt, status timeline, callbacks, retry decisions, history pages, and cleanup.
All listed findings except advisory legacy-field observations block the controlled release gate.