Start with PHP if your platform is Laravel, CodeIgniter, WordPress, or a custom PHP backend. The same API pattern works in every language: send JSON to the v1 endpoint with your server-side API credentials.
PHP
Use cURL from your PHP backend.
<?php
$url = "https://api.eienone.in/v1/payouts";
$payload = {
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
};
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: YOUR_API_KEY",
"X-API-Secret: YOUR_API_SECRET",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode($payload)
]);
$response = curl_exec($ch);
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($statusCode >= 200 && $statusCode < 300) {
$payout = json_decode($response, true);
print_r($payout);
} else {
throw new Exception("EienONE API error: " . $response);
}
Node.js
Use the built-in fetch API from Node 18+.
const response = await fetch("https://api.eienone.in/v1/payouts", {
method: "POST",
headers: {
"X-API-Key": process.env.EIENONE_API_KEY,
"X-API-Secret": process.env.EIENONE_API_SECRET,
"Content-Type": "application/json"
},
body: JSON.stringify({
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
})
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.message || "EienONE API request failed");
}
console.log(data);
Python
Use requests from a Django, Flask, or FastAPI service.
import os
import requests
payload = {
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}
response = requests.post(
"https://api.eienone.in/v1/payouts",
headers={
"X-API-Key": os.environ["EIENONE_API_KEY"],
"X-API-Secret": os.environ["EIENONE_API_SECRET"],
"Content-Type": "application/json",
},
json=payload,
timeout=30,
)
response.raise_for_status()
print(response.json())
cURL
Quick terminal test for any server environment.
curl -X POST "https://api.eienone.in/v1/payouts" \
-H "X-API-Key: YOUR_API_KEY" \
-H "X-API-Secret: YOUR_API_SECRET" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}'
Java
Use Java 11+ HttpClient.
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
String payload = """
{
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.eienone.in/v1/payouts"))
.header("X-API-Key", System.getenv("EIENONE_API_KEY"))
.header("X-API-Secret", System.getenv("EIENONE_API_SECRET"))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() < 200 || response.statusCode() >= 300) {
throw new RuntimeException(response.body());
}
System.out.println(response.body());
C#
Use HttpClient from .NET services.
using System.Text;
var payload = """
{
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}
""";
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.eienone.in/v1/payouts");
request.Headers.Add("X-API-Key", Environment.GetEnvironmentVariable("EIENONE_API_KEY"));
request.Headers.Add("X-API-Secret", Environment.GetEnvironmentVariable("EIENONE_API_SECRET"));
request.Content = new StringContent(payload, Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var body = await response.Content.ReadAsStringAsync();
if (!response.IsSuccessStatusCode) {
throw new Exception(body);
}
Console.WriteLine(body);
Go
Use the standard net/http package.
package main
import (
"bytes"
"fmt"
"io"
"net/http"
"os"
)
func main() {
payload := []byte(`{
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}`)
req, _ := http.NewRequest("POST", "https://api.eienone.in/v1/payouts", bytes.NewBuffer(payload))
req.Header.Set("X-API-Key", os.Getenv("EIENONE_API_KEY"))
req.Header.Set("X-API-Secret", os.Getenv("EIENONE_API_SECRET"))
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
panic(string(body))
}
fmt.Println(string(body))
}
Ruby
Use Net::HTTP from Rails or plain Ruby.
require "json"
require "net/http"
require "uri"
payload = {
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
}
uri = URI("https://api.eienone.in/v1/payouts")
request = Net::HTTP::Post.new(uri)
request["X-API-Key"] = ENV.fetch("EIENONE_API_KEY")
request["X-API-Secret"] = ENV.fetch("EIENONE_API_SECRET")
request["Content-Type"] = "application/json"
request.body = payload.to_json
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end
raise response.body unless response.is_a?(Net::HTTPSuccess)
puts JSON.parse(response.body)
JavaScript Browser
Call your own backend from the browser, not EienONE directly.
async function createPayout() {
const response = await fetch("/api/payouts", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"amount": 1000,
"mode": "IMPS",
"beneficiaryName": "John Doe",
"accountNumber": "1234567890",
"ifscCode": "HDFC0001234",
"beneficiaryPhone": "9876543210",
"beneficiaryEmail": "john@example.com",
"bankName": "HDFC Bank",
"referenceId": "ORDER_12345"
})
});
const data = await response.json();
if (!response.ok) {
throw new Error(data.message || "Payout request failed");
}
return data;
}