Skip to main content
POST
/
v4
/
swap
/
execute_quote
Execute Swap quote
curl --request POST \
  --url 'https://api.moonpay.com/v4/swap/execute_quote?apiKey=' \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "signature": "***",
  "walletAddresses": {
    "destinationWalletAddress": 7.55070758245981e+47,
    "refundWalletAddress": 7.55070758245981e+47,
    "destinationWalletAddressTag": "tag",
    "refundWalletAddressTag": "tag"
  },
  "externalTransactionId": "6ec52bc3-236a-4570-a9e0-743e14818619"
}
'
{
  "baseCurrency": {
    "id": "aaefa32f-161b-42c8-8115-debcbf3d6a2d",
    "createdAt": "2019-05-17T18:24:45.206Z",
    "updatedAt": "2019-05-17T18:24:45.206Z",
    "type": "crypto",
    "name": "USD Coin (ERC-20)",
    "code": "usdc",
    "precision": 2,
    "minBuyAmount": 30,
    "maxBuyAmount": 1000,
    "minSellAmount": 15,
    "maxSellAmount": 100000,
    "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
    "testnetAddressRegex": "^(0x)[0-9A-Fa-f]{40}$",
    "supportsAddressTag": false,
    "addressTagRegex": null,
    "supportsTestMode": true,
    "isSuspended": false,
    "isSupportedInUs": true,
    "isSellSupported": true,
    "notAllowedUSStates": [
      "LA",
      "VI"
    ],
    "notAllowedCountries": [
      "CA"
    ],
    "metadata": {
      "contractAddress": 0,
      "chainId": "1",
      "networkCode": "ethereum"
    }
  },
  "quoteCurrency": "<string>",
  "baseCurrencyAmount": "1.123",
  "quoteCurrencyAmount": "0.0056",
  "extraFeeAmount": "0.0000005",
  "networkFeeAmount": "0.00039",
  "feeAmount": "0.0002",
  "transactionId": "3ea41bef-cfd7-445c-91cc-853f417d4f1e",
  "status": "completed"
}

Documentation Index

Fetch the complete documentation index at: https://dev.moonpay.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

apiKey
string
query
required

Headers

authorization
string
required

A valid customer authentication token in the format 'Bearer [auth token]'.

Body

application/json
signature
string
required

Signature from the GET quote response.

Example:

"***"

walletAddresses
object
required
externalTransactionId
string

A valid Swap transaction ID from your backend. You can use this to associate your transaction with our transaction.

Example:

"6ec52bc3-236a-4570-a9e0-743e14818619"

Response

Successful response — Swap Transaction

baseCurrency
object

Details about the cryptocurrency the customer wants to swap.

quoteCurrency
string

Details about the cryptocurrency the customer will receive.

baseCurrencyAmount
string

A positive string number representing how much crypto the user wants to swap.

Example:

"1.123"

quoteCurrencyAmount
string

A positive string number representing the amount of cryptocurrency the customer will receive. Set when the swap is executed.

Example:

"0.0056"

extraFeeAmount
string

A positive number string representing your extra fee for the transaction. It is added to baseCurrencyAmount, feeAmount and networkFeeAmount when the swap is executed.

Example:

"0.0000005"

networkFeeAmount
string

A positive number string representing the network fee for the transaction. It is added to baseCurrencyAmount, feeAmount and extraFeeAmount when the swap is executed.

Example:

"0.00039"

feeAmount
string

A positive number representing the fee for the transaction.

Example:

"0.0002"

transactionId
string

A valid Swap transaction ID.

Example:

"3ea41bef-cfd7-445c-91cc-853f417d4f1e"

status
enum<string>

The transaction's status. Possible values are completed, failed, waitingForDepositAddressGeneration, waitingForDeposit, executingSwap, reQuoteRequired, screeningWalletAddress, frozen.

Available options:
completed,
failed,
waitingForDepositAddressGeneration,
waitingForDeposit,
executingSwap,
reQuoteRequired,
screeningWalletAddress,
frozen
Example:

"completed"