Create Swap
Swaps one token for another from the account's wallet, or converts between fiat currencies in the account's ledger at the mid-market rate. Crypto swaps finish in the background — check the swap for its status.
Headers
A unique key that makes this request safe to retry. See Idempotent requests.
Request body
Example request
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount": "100",
"from_chain": "plasma",
"from_token": "usd",
"slippage_bps": 50,
"to_amount": "180.00",
"to_chain": "plasma",
"to_token": "cad"
}Response
swap created
Example response
{
"account_id": "biz_xxxxxxxxxxxxxx",
"amount_in": 131.4,
"amount_out": 180,
"amount_out_expected": "98.9",
"amount_out_min": "98.4",
"from_token": {
"symbol": "usd"
},
"id": "vault-swap-cwal_xxxxxxxxxxxxxx",
"object": "swap",
"rate": "0.989",
"status": "queued",
"to_chain": "ethereum",
"to_token": {
"symbol": "cad"
}
}Changes
Changed in 65 of the 74 revisions of this API.14141
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
added the new optional
headerrequest parameterApi-Version-Dateto all path's operationsnew-optional-request-default-parameter-to-existing-path
- ○
added the new optional request property
new-optional-request-property
- ○
the request property
became optionalrequest-property-became-optional
- ○
added the required property
to the response with the statusresponse-required-property-added
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
This revision also has 2 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
- ○
the security scope
crypto_wallet:swapwas added to the endpoint's security schemebearerAuthapi-security-scope-added
- ○
the security scope
payout:transfer_fundswas removed from the endpoint's security schemebearerAuthapi-security-scope-removed
- ○
Of the 74 revisions, 1 has no diff computed.