Withdrawals (alpha)
Get a withdrawal
GET
/
v1
/
external
/
secretkey-auth
/
withdrawals
/
{withdrawalId}
Get a withdrawal
curl --request GET \
--url https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId} \
--header 'x-spacepay-secret-key: <api-key>'import requests
url = "https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}"
headers = {"x-spacepay-secret-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-spacepay-secret-key': '<api-key>'}};
fetch('https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}', 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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-spacepay-secret-key: <api-key>"
],
]);
$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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-spacepay-secret-key", "<api-key>")
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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}")
.header("x-spacepay-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-spacepay-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountInCents": 123,
"chainId": "eip155:8453",
"recipientAddress": "<string>",
"status": "pending",
"currency": "USD",
"orderId": "<string>",
"customMetadata": "<string>",
"errorMessage": "<string>",
"receipt": {
"withdrawalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settledToken": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"coingeckoApiId": "ethereum",
"chain": {
"chainId": "eip155:1",
"name": "Ethereum",
"nativeSymbol": "ETH",
"nativeDecimals": 18,
"isEnabled": true,
"isTestnet": false
},
"symbol": "USDC",
"contractAddress": "0xa0b86a33e6441b8c4c8c0c0c0c0c0c0c0c0c0c0",
"decimals": 6,
"type": "stablecoin",
"assetType": "native",
"status": "active",
"tokenPriceUsd": 1
},
"settledChain": {
"chainId": "eip155:1",
"name": "Ethereum",
"nativeSymbol": "ETH",
"nativeDecimals": 18,
"isEnabled": true,
"isTestnet": false
},
"settledAmountAsset": "100",
"settledAmountUsd": "100.00",
"txBlockNumber": 123456,
"txTimestamp": "2021-01-01T00:00:00.000Z",
"txSenderAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"txGasUsed": 100000,
"txTotalCost": "1000000000000000000",
"txTotalCostUsdFractions": 1000000,
"txIsSponsored": true,
"processedBy": "webhook",
"createdAt": "2023-11-07T05:31:56Z",
"txHash": "0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Authorizations
Secret key for authentication of external API.
Path Parameters
Response
Withdrawal retrieved successfully
Withdrawal ID
Merchant ID
Withdrawal amount in USD cents
CAIP-2 chain id
Example:
"eip155:8453"
Beneficiary address
Withdrawal status
Available options:
pending, processing, completed, failed, cancelled Currency of the withdrawal
Available options:
USD Optional order ID
Optional custom metadata
Error message (if failed)
Withdrawal receipt
Show child attributes
Show child attributes
Created at
Updated at
⌘I
Get a withdrawal
curl --request GET \
--url https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId} \
--header 'x-spacepay-secret-key: <api-key>'import requests
url = "https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}"
headers = {"x-spacepay-secret-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-spacepay-secret-key': '<api-key>'}};
fetch('https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}', 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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-spacepay-secret-key: <api-key>"
],
]);
$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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-spacepay-secret-key", "<api-key>")
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.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}")
.header("x-spacepay-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spacepay.solutions/v1/external/secretkey-auth/withdrawals/{withdrawalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-spacepay-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"merchantId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amountInCents": 123,
"chainId": "eip155:8453",
"recipientAddress": "<string>",
"status": "pending",
"currency": "USD",
"orderId": "<string>",
"customMetadata": "<string>",
"errorMessage": "<string>",
"receipt": {
"withdrawalId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"settledToken": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"coingeckoApiId": "ethereum",
"chain": {
"chainId": "eip155:1",
"name": "Ethereum",
"nativeSymbol": "ETH",
"nativeDecimals": 18,
"isEnabled": true,
"isTestnet": false
},
"symbol": "USDC",
"contractAddress": "0xa0b86a33e6441b8c4c8c0c0c0c0c0c0c0c0c0c0",
"decimals": 6,
"type": "stablecoin",
"assetType": "native",
"status": "active",
"tokenPriceUsd": 1
},
"settledChain": {
"chainId": "eip155:1",
"name": "Ethereum",
"nativeSymbol": "ETH",
"nativeDecimals": 18,
"isEnabled": true,
"isTestnet": false
},
"settledAmountAsset": "100",
"settledAmountUsd": "100.00",
"txBlockNumber": 123456,
"txTimestamp": "2021-01-01T00:00:00.000Z",
"txSenderAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
"txGasUsed": 100000,
"txTotalCost": "1000000000000000000",
"txTotalCostUsdFractions": 1000000,
"txIsSponsored": true,
"processedBy": "webhook",
"createdAt": "2023-11-07T05:31:56Z",
"txHash": "0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}