Create Withdraw
Creates a new withdraw transaction. After the transaction is created, the user is redirected to your redirect URL and status changes are notified via callback.
Endpoint
POST /api/createWithdraw
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| mvpayApiToken | string | ✅ | API authentication token |
| Content-Type | string | ✅ | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | number | ✅ | Withdraw amount |
| userID | string | ✅ | User ID |
| name | string | ✅ | Full name |
| userName | string | ✅ | Username |
| iban | string | ✅ | IBAN number for withdrawal |
| processID | string | ✅ | Unique process ID |
| redirectURL | string | ✅ | URL to redirect after transaction |
Note:
redirectURLis used for redirection after a successful transaction.processIDmust be unique for each request.ibanmust be a valid IBAN format.
Example Requests
- 🟢 Node.js
- 🐘 PHP
- 🔷 C#
- 🐍 Python
- ☕ Java
const fetch = require("node-fetch");
const data = {
amount: 50,
userID: "12345",
name: "John Doe",
userName: "johndoe",
iban: "TR330006100519786457841326",
processID: "WITHDRAW-001",
redirectURL: "https://yoursite.com/success",
};
const response = await fetch("https://app.mvpay.xyz/api/createWithdraw", {
method: "POST",
headers: {
mvpayApiToken: "YOUR_API_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify(data),
});
const result = await response.json();
console.log(result);
<?php
$url = 'https://app.mvpay.xyz/api/createWithdraw';
$data = array(
'amount' => 50,
'userID' => '12345',
'name' => 'John Doe',
'userName' => 'johndoe',
'iban' => 'TR330006100519786457841326',
'processID' => 'WITHDRAW-001',
'redirectURL' => 'https://yoursite.com/success'
);
$options = array(
'http' => array(
'header' => "mvpayApiToken: YOUR_API_TOKEN\r\n" .
"Content-Type: application/json\r\n",
'method' => 'POST',
'content' => json_encode($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) {
echo "Error occurred";
} else {
echo $result;
}
?>
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var url = "https://app.mvpay.xyz/api/createWithdraw";
var data = new
{
amount = 50,
userID = "12345",
name = "John Doe",
userName = "johndoe",
iban = "TR330006100519786457841326",
processID = "WITHDRAW-001",
redirectURL = "https://yoursite.com/success"
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("mvpayApiToken", "YOUR_API_TOKEN");
var response = await client.PostAsync(url, content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}
}
import requests
import json
url = "https://app.mvpay.xyz/api/createWithdraw"
headers = {
"mvpayApiToken": "YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"amount": 50,
"userID": "12345",
"name": "John Doe",
"userName": "johndoe",
"iban": "TR330006100519786457841326",
"processID": "WITHDRAW-001",
"redirectURL": "https://yoursite.com/success"
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.HashMap;
import java.util.Map;
public class CreateWithdraw {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newHttpClient();
Map<String, Object> data = new HashMap<>();
data.put("amount", 50);
data.put("userID", "12345");
data.put("name", "John Doe");
data.put("userName", "johndoe");
data.put("iban", "TR330006100519786457841326");
data.put("processID", "WITHDRAW-001");
data.put("redirectURL", "https://yoursite.com/success");
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(data);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://app.mvpay.xyz/api/createWithdraw"))
.header("mvpayApiToken", "YOUR_API_TOKEN")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}