Skip to main content
GET
/
v4
/
swap
/
transaction
/
{transactionId}
/
requote
Get Swap requote
curl --request GET \
  --url 'https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey=' \
  --header 'authorization: <authorization>'
import requests

url = "https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey="

headers = {"authorization": "<authorization>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {authorization: '<authorization>'}};

fetch('https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey="

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("authorization", "<authorization>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey=")
.header("authorization", "<authorization>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.moonpay.com/v4/swap/transaction/{transactionId}/requote?apiKey=")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["authorization"] = '<authorization>'

response = http.request(request)
puts response.read_body
{
  "id": "9b9d4036-bb99-4cb8-a61e-87d0750722d2",
  "expiresAt": "2024-02-23T00:58:26.577Z",
  "extraFeeAmount": "0.0000005",
  "networkFeeAmount": "0.00039",
  "extraFeeAmountInUSD": "0",
  "networkFeeAmountInUSD": "20.049237585",
  "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": {
    "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"
    }
  },
  "pairName": "eth-btc",
  "baseCurrencyAmount": "1.123",
  "quoteCurrencyAmount": "0.0564",
  "feeCurrency": {
    "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"
    }
  },
  "baseCurrencyPriceInUsd": "2946.441235",
  "quoteCurrencyPriceInUsd": "51408.3015",
  "liveMode": true,
  "exchangeRate": "0.05731450269758475",
  "signature": "really-long-string"
}
{
"message": "<string>",
"type": "<string>"
}

Authorizations

apiKey
string
query
required

Headers

authorization
string
required

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

Path Parameters

transactionId
string
required

A valid Swap transaction ID.

Response

Successful response

id
string

Unique identifier for the object.

Example:

"9b9d4036-bb99-4cb8-a61e-87d0750722d2"

expiresAt
string

Time at which the quote expires. Returned as an ISO 8601 string.

Example:

"2024-02-23T00:58:26.577Z"

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"

extraFeeAmountInUSD
string

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

Example:

"0"

networkFeeAmountInUSD
string

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

Example:

"20.049237585"

baseCurrency
object

Details about the cryptocurrency the customer wants to swap.

quoteCurrency
object

Details about the cryptocurrency the customer will receive.

pairName
string

The name of the cryptocurrency pair.

Example:

"eth-btc"

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 purchase of cryptocurrency has been executed.

Example:

"0.0564"

feeCurrency
object

Fee currency for this quote

baseCurrencyPriceInUsd
string

The price of the crypto the customer wants to swap, in USD.

Example:

"2946.441235"

quoteCurrencyPriceInUsd
string

The price of the crypto the customer will receive, in USD.

Example:

"51408.3015"

liveMode
boolean

Whether live mode is enabled for this quote.

Example:

true

exchangeRate
string

The rate provided by the underlying exchange.

Example:

"0.05731450269758475"

signature
string

The signature for executing the quote

Example:

"really-long-string"