Create Deposit
Creates a new deposit transaction. After the transaction is created, the user is redirected to your redirect URL and status changes are notified via callback.
Endpoint
POST /api/createDeposit
Headers
| Header | Type | Required | Description |
|---|---|---|---|
| mvpayApiToken | string | ✅ | API authentication token |
| Content-Type | string | ✅ | application/json |
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| amount | number | ✅ | Deposit amount |
| userID | string | ✅ | User ID |
| name | string | ✅ | Full name |
| userName | string | ✅ | Username |
| processID | string | ✅ | Unique transaction ID |
| redirectURL | string | ✅ | URL to redirect after transaction |
Note:
processIDmust be unique for each request. Using the same ID again may result in 409/422 errors.
Example Requests
- 🟢 Node.js
- 🐘 PHP
- 🔷 C#
- 🐍 Python
- ☕ Java
const fetch = require("node-fetch");
const data = {
amount: 100,
userID: "user123",
name: "John Doe",
userName: "johndoe",
processID: "DEPOSIT-12345",
redirectURL: "https://yoursite.com/success",
};
const response = await fetch("https://app.mvpay.xyz/api/createDeposit", {
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/createDeposit';
$data = array(
'amount' => 100,
'userID' => 'user123',
'name' => 'John Doe',
'userName' => 'johndoe',
'processID' => 'DEPOSIT-12345',
'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/createDeposit";
var data = new
{
amount = 100,
userID = "user123",
name = "John Doe",
userName = "johndoe",
processID = "DEPOSIT-12345",
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/createDeposit"
headers = {
"mvpayApiToken": "YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"amount": 100,
"userID": "user123",
"name": "John Doe",
"userName": "johndoe",
"processID": "DEPOSIT-12345",
"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 CreateDeposit {
public static void main(String[] args) throws IOException, InterruptedException {
HttpClient client = HttpClient.newHttpClient();
Map<String, Object> data = new HashMap<>();
data.put("amount", 100);
data.put("userID", "user123");
data.put("name", "John Doe");
data.put("userName", "johndoe");
data.put("processID", "DEPOSIT-12345");
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/createDeposit"))
.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());
}
}