Update a crypto settlement destination - WalletConnect Pay Docs
Update a crypto settlement destination
cURL
curl --request PUT \
--url https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id} \
--header 'Api-Key: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"destination": "<string>"
}
'
Python
import requests
url = "https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}"
payload = { "destination": "<string>" }
headers = {
"Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)
JavaScript
const options = {
method: 'PUT',
headers: {'Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({destination: '<string>'})
};
fetch('https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'destination' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Go
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}"
payload := strings.NewReader("{\n \"destination\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Api-Key", "<api-key>")
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))
}
Unirest
HttpResponse<String> response = Unirest.put("https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}")
.header("Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"<string>\"\n}")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.pay.walletconnect.com/v1/merchants/{merchantId}/settlements/crypto/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body
Successful Response (200)
Example Response:
{
"id": "crypto_Xk7nWp8XmQj2YrTv6",
"asset": "eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"destination": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678"
}
Authorizations
- Api-Key: required
Path Parameters
- id: Crypto settlement ID (string)
- Required length:
1 - 256 - Example: "crypto_Xk7nWp8XmQj2YrTv6"
- Required length:
- merchantId: required
Body
- destination (string): Required CAIP-10 account identifier for the wallet that should receive the settled funds. Length:
1 - 256.- Pattern:
^[-a-zA-Z0-9]{3,8}:[-a-zA-Z0-9]{1,32}:[-a-zA-Z0-9]{1,128}$. - Example: "eip155:8453:0x1234567890abcdef1234567890abcdef12345678"
- Pattern:
Response
- 200: Settlement updated