curl --request GET \
--url https://app.digitalsurge.com.au/api/private/swaps/{id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.digitalsurge.com.au/api/private/swaps/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.digitalsurge.com.au/api/private/swaps/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"status": 5,
"src_asset": "<string>",
"dst_asset": "<string>",
"bought_amount": "<string>",
"sold_amount": "<string>",
"src_fee": "<string>",
"dst_fee": "<string>",
"aud_value": "<string>",
"req_get_amount": "<string>",
"req_spend_amount": "<string>",
"expected_price": "<string>"
}Get Swap
Swap one asset directly for another at the current market price — this is the instant / one-shot trade flow. For recurring or scheduled buys (DCA), use the broker schedules endpoints instead.
Direction is implied by which asset is AUD:
- BUY a crypto:
src_asset="AUD",dst_asset=<crypto code> - SELL a crypto:
src_asset=<crypto code>,dst_asset="AUD"
Listing returns swap history, most recent first. Retrieving by
id returns the current state of a single swap — used after
create to check whether status has moved from
processing to processed, error, or canceled.
Placing a new swap is a two-step flow: estimate first to
preview price, fees, and amounts, ask the user to confirm, then
create to execute.
See the per-operation documentation for details.
curl --request GET \
--url https://app.digitalsurge.com.au/api/private/swaps/{id}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.digitalsurge.com.au/api/private/swaps/{id}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.digitalsurge.com.au/api/private/swaps/{id}/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": 123,
"status": 5,
"src_asset": "<string>",
"dst_asset": "<string>",
"bought_amount": "<string>",
"sold_amount": "<string>",
"src_fee": "<string>",
"dst_fee": "<string>",
"aud_value": "<string>",
"req_get_amount": "<string>",
"req_spend_amount": "<string>",
"expected_price": "<string>"
}Authorizations
Response
Read-only view of a swap, extending the create serializer with aud_value.
aud_value is null while the swap is processing and populated once it reaches a terminal state (processed/rejected). For AUD-involved trades the value is exact; for crypto-to-crypto it is the ticker-estimated AUD value at the time of finalization.