List payments - WalletConnect Pay Docs
List payments
cURL
curl --request GET \
--url https://api.pay.walletconnect.com/v1/payments \
--header 'Api-Key: <api-key>'
Python
import requests
url = "https://api.pay.walletconnect.com/v1/payments"
headers = {"Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)
JavaScript (Fetch)
const options = {method: 'GET', headers: {'Api-Key': '<api-key>'}};
fetch('https://api.pay.walletconnect.com/v1/payments', 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/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Api-Key: <api-key>"
],
]);
$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"
"net/http"
"io"
)
func main() {
url := "https://api.pay.walletconnect.com/v1/payments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
Unirest (Java)
HttpResponse<String> response = Unirest.get("https://api.pay.walletconnect.com/v1/payments")
.header("Api-Key", "<api-key>")
.asString();
Ruby
require 'uri'
require 'net/http'
url = URI("https://api.pay.walletconnect.com/v1/payments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body
Example Response
{
"data": [
{
"paymentId": "pay_a1a2ecc101KGF210FP7PN3BK08PZARS1CZ",
"merchant": {
"id": "acme-store-1",
"name": "Acme Store",
"iconUrl": "https://imagedelivery.net/example/icon.png"
},
"referenceId": "a1b2cad4e5f2783012345678axcdea90",
"status": "succeeded",
"isTerminal": true,
"fiatAmount": {
"unit": "iso4217/USD",
"value": "500",
"display": {
"assetSymbol": "USD",
"assetName": "US Dollar",
"decimals": 2
}
},
"tokenAmount": {
"unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000",
"value": "5000000",
"display": {
"assetSymbol": "USDC",
"assetName": "USD Coin",
"decimals": 6,
"networkName": "Base",
"iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md",
"networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md"
}
},
"buyer": {
"accountCaip10": "eip155:8453:0x0000000000000000000000000000000000000000",
"accountProviderName": "MetaMask",
"accountProviderIcon": "https://api.walletconnect.com/assets/v1/image/wallet/metamask/md"
},
"transaction": {
"networkId": "8453",
"hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": 42
},
"settlement": {
"amount": {
"unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000",
"value": "4840000",
"display": {
"assetSymbol": "USDC",
"assetName": "USD Coin",
"decimals": 6,
"iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md",
"networkName": "Base",
"networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md"
}
},
"settled": true,
"txHash": "0x0000000000000000000000000000000000000000000000000000000000000000"
},
"fees": {
"total": {
"unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000",
"value": "160000",
"display": {
"assetSymbol": "USDC",
"assetName": "USD Coin",
"decimals": 6,
"iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md",
"networkName": "Base",
"networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md"
}
},
"fixed": {
"unit": "caip19/eip155:8453/erc20:0x0000000000000000000000000000000000000000",
"value": "140000",
"display": {
"assetSymbol": "USDC",
"assetName": "USD Coin",
"decimals": 6,
"iconUrl": "https://api.walletconnect.com/assets/v1/image/token/USDC/md",
"networkName": "Base",
"networkIconUrl": "https://api.walletconnect.com/assets/v1/image/network/eip155%3A8453/md"
}
},
"percentage": "0.4"
},
"createdAt": "2024-01-01T12:00:00.000Z",
"lastUpdatedAt": "2024-01-01T12:00:00.000Z",
"settledAt": "2024-01-01T12:00:00.000Z"
}
],
"nextCursor": null,
"stats": {
"totalRevenue": [
{
"amount": 1000,
"currency": "USD"
}
],
"totalTransactions": 100,
"totalCustomers": 25
}
}