Skip to main content
POST
/
v4
/
swap
/
reject_requote
Reject Swap requote
curl --request POST \
  --url 'https://api.moonpay.com/v4/swap/reject_requote?apiKey=' \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "signature": "***",
  "walletAddresses": {
    "refundWalletAddress": 7.55070758245981e+47,
    "refundWalletAddressTag": "tag"
  },
  "externalTransactionId": "dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9"
}
'
import requests

url = "https://api.moonpay.com/v4/swap/reject_requote?apiKey="

payload = {
"signature": "***",
"walletAddresses": {
"refundWalletAddress": 7.55070758245981e+47,
"refundWalletAddressTag": "tag"
},
"externalTransactionId": "dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9"
}
headers = {
"authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
signature: '***',
walletAddresses: {refundWalletAddress: 7.55070758245981e+47, refundWalletAddressTag: 'tag'},
externalTransactionId: 'dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9'
})
};

fetch('https://api.moonpay.com/v4/swap/reject_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/reject_requote?apiKey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'signature' => '***',
'walletAddresses' => [
'refundWalletAddress' => 7.55070758245981e+47,
'refundWalletAddressTag' => 'tag'
],
'externalTransactionId' => 'dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.moonpay.com/v4/swap/reject_requote?apiKey="

payload := strings.NewReader("{\n \"signature\": \"***\",\n \"walletAddresses\": {\n \"refundWalletAddress\": 7.55070758245981e+47,\n \"refundWalletAddressTag\": \"tag\"\n },\n \"externalTransactionId\": \"dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.moonpay.com/v4/swap/reject_requote?apiKey=")
.header("authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"signature\": \"***\",\n \"walletAddresses\": {\n \"refundWalletAddress\": 7.55070758245981e+47,\n \"refundWalletAddressTag\": \"tag\"\n },\n \"externalTransactionId\": \"dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.moonpay.com/v4/swap/reject_requote?apiKey=")

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

request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"signature\": \"***\",\n \"walletAddresses\": {\n \"refundWalletAddress\": 7.55070758245981e+47,\n \"refundWalletAddressTag\": \"tag\"\n },\n \"externalTransactionId\": \"dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true
}
{
"message": "<string>",
"type": "<string>"
}

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 requote 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:

"dc2ddba2-9e81-45e9-a201-e8b6d69b5ad9"

Response

Successful response

success
boolean

True if the swap requote was successfully rejected.

Example:

true