Skip to main content
POST
/
api
/
private
/
swaps
/
Create Swap
curl --request POST \
  --url https://app.digitalsurge.com.au/api/private/swaps/ \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "src_asset": "<string>",
  "dst_asset": "<string>"
}
'
{
  "id": 123,
  "src_asset": "<string>",
  "dst_asset": "<string>",
  "bought_amount": "<string>",
  "sold_amount": "<string>",
  "src_fee": "<string>",
  "dst_fee": "<string>",
  "req_get_amount": "<string>",
  "req_spend_amount": "<string>",
  "expected_price": "<string>"
}

Authorizations

Authorization
string
header
required

Personal API key, created in the Digital Surge app under Account Settings → API Keys. Send it with every request as Authorization: Bearer <your-api-key>.

Body

A swap: a market-price trade of one asset directly for another (AUD → crypto is a buy, crypto → AUD a sell).

src_asset
string
required
Minimum string length: 1
dst_asset
string
required
Minimum string length: 1
req_get_amount
string<decimal> | null

Net amount, after subtracting the fee

req_spend_amount
string<decimal> | null

Total amount, incl. the fee

expected_price
string<decimal> | null

Response

A swap: a market-price trade of one asset directly for another (AUD → crypto is a buy, crypto → AUD a sell).

id
integer
required
read-only
status
enum<integer>
required
  • 5 - quote
  • 10 - pending
  • 12 - estimated
  • 15 - processing
  • 20 - error
  • 40 - rejected
  • 60 - processed
Available options:
5,
10,
12,
15,
20,
40,
60
src_asset
string
required
dst_asset
string
required
bought_amount
string<decimal> | null
required
read-only

Final amount bought by the customer

sold_amount
string<decimal> | null
required
read-only

Final amount sold by the customer

src_fee
string<decimal> | null
required
read-only
dst_fee
string<decimal> | null
required
read-only
req_get_amount
string<decimal> | null

Net amount, after subtracting the fee

req_spend_amount
string<decimal> | null

Total amount, incl. the fee

expected_price
string<decimal> | null