Retrieve Swap
Changed onRetrieves a swap and its status. Poll it after creating a crypto swap, which finishes in the background.
Request
- Base URLhttps://api.whop.com/api/v1
- Auth
- HTTP bearer
- or HTTP bearer
- or HTTP bearer
- or HTTP bearer
Path parameters
Swap ID returned from POST /swaps.
Headers
Pins the request to a dated API version.
Response
swap status retrieved
Account that owns the swap: a business ID prefixed biz_, or the user ID for a personal account.
The from_token amount the swap was created to spend, as a decimal string. A swap created with all reports the wallet balance it read. Null for a fiat pair.
Latest error returned for a failed swap.
Swap ID.
Current swap status. complete and failed are terminal.
On-chain transaction hashes produced by the swap.
User whose personal account owns the swap, prefixed user_. Null for a business account.
Example response
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount": "0.052341",
"error": "Swap reverted: quoted price moved beyond the slippage tolerance",
"id": "vault-swap-cwal_xxxxxxxxxxxxxx",
"object": "swap",
"status": "failed",
"tx_hashes": [
"0xabc"
]
}Changes
- info
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuth - info
the security scope
payout:withdraw_fundswas removed from the endpoint's security schemebearerAuth
- info
- info
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuth
1 more change in this revision
- info