//
Applications that have a money balance and need to process payouts to users that can be withdrawn immediately can use our API to achieve that. Here's how it works:
Anyone can send a webhook event to your server claiming to have made you a payment via your Dinar Dragon payment link.
To check if the received webhook event is legitimately from us or not, use the following API endpoint provided by Dinar Dragon:
NOTE: For testing, run your localhost app through NGROK. We can only send webhook events to secure https addresses.
#include <cpprest/http_client.h> #include <iostream> int main() { web::http::client::http_client client(U("https://dinardragon.com/dinarbox-transfer")); web::json::value postData; postData[U("senderEmail")] = web::json::value::string("sender@example.com"); postData[U("senderSecret")] = web::json::value::string("apiKey"); postData[U("recipientEmail")] = web::json::value::string("recipient@example.com"); postData[U("amount")] = web::json::value::number(100); postData[U("triggerWebhook")] = web::json::value::boolean(true); postData[U("webhookEndpoint")] = web::json::value::string("https://your-webhook-endpoint.com"); client.request(web::http::methods::POST, U(""), postData) .then([](web::http::http_response response) { std::cout << "Response: " << response.status_code() << std::endl; }).wait(); return 0; }
using System; using System.Net.Http; using System.Text; using System.Threading.Tasks; class Program { static async Task Main() { HttpClient client = new HttpClient(); var json = @"{ ""senderEmail"": ""sender@example.com"", ""senderSecret"": ""apiKey"", ""recipientEmail"": ""recipient@example.com"", ""amount"": 100, ""triggerWebhook"": true, ""webhookEndpoint"": ""https://your-webhook-endpoint.com"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json"); HttpResponseMessage response = await client.PostAsync("https://dinardragon.com/dinarbox-transfer", content); Console.WriteLine(await response.Content.ReadAsStringAsync()); } }
import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; public class Main { public static void main(String[] args) throws Exception { URL url = new URL("https://dinardragon.com/dinarbox-transfer"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); conn.setDoOutput(true); String jsonInputString = "{" + "\"senderEmail\": \"sender@example.com\"," + "\"senderSecret\": \"apiKey\"," + "\"recipientEmail\": \"recipient@example.com\"," + "\"amount\": 100," + "\"triggerWebhook\": true," + "\"webhookEndpoint\": \"https://your-webhook-endpoint.com\"" + "}"; try(OutputStream os = conn.getOutputStream()) { byte[] input = jsonInputString.getBytes("utf-8"); os.write(input, 0, input.length); } System.out.println("Response Code: " + conn.getResponseCode()); } }
fetch("https://dinardragon.com/dinarbox-transfer", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ senderEmail: "sender@example.com", senderSecret: "apiKey", recipientEmail: "recipient@example.com", amount: 100, triggerWebhook: true, webhookEndpoint: "https://your-webhook-endpoint.com" }) }) .then(response => response.json()) .then(data => console.log(data));
package main import ( "bytes" "fmt" "net/http" ) func main() { jsonData := []byte(`{ "senderEmail": "sender@example.com", "senderSecret": "apiKey", "recipientEmail": "recipient@example.com", "amount": 100, "triggerWebhook": true, "webhookEndpoint": "https://your-webhook-endpoint.com" }`) resp, err := http.Post("https://dinardragon.com/dinarbox-transfer", "application/json", bytes.NewBuffer(jsonData)) if err != nil { fmt.Println("Error:", err) } defer resp.Body.Close() fmt.Println("Response Status:", resp.Status) }
import requests url = "https://dinardragon.com/dinarbox-transfer" payload = { "senderEmail": "sender@example.com", "senderSecret": "apiKey", "recipientEmail": "recipient@example.com", "amount": 100, "triggerWebhook": True, "webhookEndpoint": "https://your-webhook-endpoint.com" } response = requests.post(url, json=payload) print(response.json())