Creates a USDC withdrawal transaction for a merchant using the Coinflow wallet
POST https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw Content-Type: application/json
Creates a usdc withdrawal transaction for merchants using Coinflow wallet- so they can withdraw usdc from their wallet.
Reference: /api-reference/api-reference/marketplace/seller-usdc-withdraw
Authentication
Authorizationheader (required) — The API key of the merchant - see /api-reference/api-reference/authentication/get-session-key
Request
Body (application/json)
destination(string, required)amount(object, required)cents(integer, required)
Response
200
Ok
transaction(string, required)
Examples
Request
{
"destination": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
"amount": {
"cents": 250000
}
}
Response
{
"transaction": "0x9f8b7c6d5e4a3b2c1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f0a9b8c"
}
SDK Code
import requests
url = "https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw"
payload = {
"destination": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
"amount": { "cents": 250000 }
}
headers = {
"Authorization": "<apiKey>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = 'https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw';
const options = {
method: 'POST',
headers: {Authorization: '<apiKey>', 'Content-Type': 'application/json'},
body: '{"destination":"0xAbC1234dEf567890aBcD1234567890EfABcDeF12","amount":{"cents":250000}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw"
payload := strings.NewReader("{\n \"destination\": \"0xAbC1234dEf567890aBcD1234567890EfABcDeF12\",\n \"amount\": {\n \"cents\": 250000\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<apiKey>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"destination\": \"0xAbC1234dEf567890aBcD1234567890EfABcDeF12\",\n \"amount\": {\n \"cents\": 250000\n }\n}"
response = http.request(request)
puts response.read_body
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
HttpResponse<String> response = Unirest.post("https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw")
.header("Authorization", "<apiKey>")
.header("Content-Type", "application/json")
.body("{\n \"destination\": \"0xAbC1234dEf567890aBcD1234567890EfABcDeF12\",\n \"amount\": {\n \"cents\": 250000\n }\n}")
.asString();
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw', [
'body' => '{
"destination": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
"amount": {
"cents": 250000
}
}',
'headers' => [
'Authorization' => '<apiKey>',
'Content-Type' => 'application/json',
],
]);
echo $response->getBody();
using RestSharp;
var client = new RestClient("https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n \"destination\": \"0xAbC1234dEf567890aBcD1234567890EfABcDeF12\",\n \"amount\": {\n \"cents\": 250000\n }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
import Foundation
let headers = [
"Authorization": "<apiKey>",
"Content-Type": "application/json"
]
let parameters = [
"destination": "0xAbC1234dEf567890aBcD1234567890EfABcDeF12",
"amount": ["cents": 250000]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.coinflow.cash/api/seller/usdc-withdraw")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()