curl -X POST "https://api.orsunpay.com/v1/payment/sale" \
-H "x-api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}'
const response = await fetch("https://api.orsunpay.com/v1/payment/sale", {
method: "POST",
headers: {
"x-api-key": "your-api-key-here",
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 1000,
currency: "USD",
paymentMethod: "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId: "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId: "transaction_123",
buyerId: "customer_123",
successUrl: "https://example.com/success",
failureUrl: "https://example.com/failure",
returnUrl: "https://example.com/return",
callbackUrl: "https://example.com/callback",
}),
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.orsunpay.com/v1/payment/sale',
headers={
'x-api-key': 'your-api-key-here',
'Content-Type': 'application/json'
},
json={
'amount': 1000,
'currency': 'USD',
'paymentMethod': 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId': 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId': 'transaction_123',
'buyerId': 'customer_123',
'successUrl': 'https://example.com/success',
'failureUrl': 'https://example.com/failure',
'returnUrl': 'https://example.com/return',
'callbackUrl': 'https://example.com/callback'
}
)
print(response.json())
<?php
$data = [
'amount' => 1000,
'currency' => 'USD',
'paymentMethod' => 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId' => 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId' => 'transaction_123',
'buyerId' => 'customer_123',
'successUrl' => 'https://example.com/success',
'failureUrl' => 'https://example.com/failure',
'returnUrl' => 'https://example.com/return',
'callbackUrl' => 'https://example.com/callback'
];
$ch = curl_init('https://api.orsunpay.com/v1/payment/sale');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: your-api-key-here',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.orsunpay.com/v1/payment/sale", bytes.NewBuffer(jsonData))
req.Header.Set("x-api-key", "your-api-key-here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
require 'net/http'
require 'json'
uri = URI('https://api.orsunpay.com/v1/payment/sale')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-api-key'] = 'your-api-key-here'
request['Content-Type'] = 'application/json'
request.body = {
amount: 1000,
currency: 'USD',
paymentMethod: 'cr_clyv2goxb0000z8b8j5y6fl1j',
merchantId: 'mr_clyv2goxb0000z8b8j5y6fl1j',
orderId: 'transaction_123',
buyerId: 'customer_123',
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
returnUrl: 'https://example.com/return',
callbackUrl: 'https://example.com/callback'
}.to_json
response = http.request(request)
puts response.body
import java.io.*;
import java.net.http.*;
import java.net.URI;
public class CreateDeposit {
public static void main(String[] args) throws Exception {
String json = """
{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.orsunpay.com/v1/payment/sale"))
.header("x-api-key", "your-api-key-here")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main()
{
var data = new
{
amount = 1000,
currency = "USD",
paymentMethod = "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId = "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId = "transaction_123",
buyerId = "customer_123",
successUrl = "https://example.com/success",
failureUrl = "https://example.com/failure",
returnUrl = "https://example.com/return",
callbackUrl = "https://example.com/callback"
};
string json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("x-api-key", "your-api-key-here");
HttpResponseMessage response = await client.PostAsync(
"https://api.orsunpay.com/v1/payment/sale", content);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
{
"status": true,
"url": "https://payment-provider.com/pay/abc123",
"transaction": {
"id": "tx_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"status": "PROCESSING",
"action": "SALE",
"amount": 1000,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": true,
"transaction": {
"id": "tx_direct_001",
"orderId": "order_789",
"status": "SUCCESS",
"action": "SALE",
"amount": 500,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": false,
"error": "Invalid payment method"
}
Create Deposit Transaction
Creates a new deposit transaction for customer account funding. Supports various payment methods including cryptocurrencies, e-wallets, and BNPL services.
curl -X POST "https://api.orsunpay.com/v1/payment/sale" \
-H "x-api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}'
const response = await fetch("https://api.orsunpay.com/v1/payment/sale", {
method: "POST",
headers: {
"x-api-key": "your-api-key-here",
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 1000,
currency: "USD",
paymentMethod: "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId: "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId: "transaction_123",
buyerId: "customer_123",
successUrl: "https://example.com/success",
failureUrl: "https://example.com/failure",
returnUrl: "https://example.com/return",
callbackUrl: "https://example.com/callback",
}),
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.orsunpay.com/v1/payment/sale',
headers={
'x-api-key': 'your-api-key-here',
'Content-Type': 'application/json'
},
json={
'amount': 1000,
'currency': 'USD',
'paymentMethod': 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId': 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId': 'transaction_123',
'buyerId': 'customer_123',
'successUrl': 'https://example.com/success',
'failureUrl': 'https://example.com/failure',
'returnUrl': 'https://example.com/return',
'callbackUrl': 'https://example.com/callback'
}
)
print(response.json())
<?php
$data = [
'amount' => 1000,
'currency' => 'USD',
'paymentMethod' => 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId' => 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId' => 'transaction_123',
'buyerId' => 'customer_123',
'successUrl' => 'https://example.com/success',
'failureUrl' => 'https://example.com/failure',
'returnUrl' => 'https://example.com/return',
'callbackUrl' => 'https://example.com/callback'
];
$ch = curl_init('https://api.orsunpay.com/v1/payment/sale');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: your-api-key-here',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.orsunpay.com/v1/payment/sale", bytes.NewBuffer(jsonData))
req.Header.Set("x-api-key", "your-api-key-here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
require 'net/http'
require 'json'
uri = URI('https://api.orsunpay.com/v1/payment/sale')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-api-key'] = 'your-api-key-here'
request['Content-Type'] = 'application/json'
request.body = {
amount: 1000,
currency: 'USD',
paymentMethod: 'cr_clyv2goxb0000z8b8j5y6fl1j',
merchantId: 'mr_clyv2goxb0000z8b8j5y6fl1j',
orderId: 'transaction_123',
buyerId: 'customer_123',
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
returnUrl: 'https://example.com/return',
callbackUrl: 'https://example.com/callback'
}.to_json
response = http.request(request)
puts response.body
import java.io.*;
import java.net.http.*;
import java.net.URI;
public class CreateDeposit {
public static void main(String[] args) throws Exception {
String json = """
{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.orsunpay.com/v1/payment/sale"))
.header("x-api-key", "your-api-key-here")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main()
{
var data = new
{
amount = 1000,
currency = "USD",
paymentMethod = "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId = "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId = "transaction_123",
buyerId = "customer_123",
successUrl = "https://example.com/success",
failureUrl = "https://example.com/failure",
returnUrl = "https://example.com/return",
callbackUrl = "https://example.com/callback"
};
string json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("x-api-key", "your-api-key-here");
HttpResponseMessage response = await client.PostAsync(
"https://api.orsunpay.com/v1/payment/sale", content);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
{
"status": true,
"url": "https://payment-provider.com/pay/abc123",
"transaction": {
"id": "tx_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"status": "PROCESSING",
"action": "SALE",
"amount": 1000,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": true,
"transaction": {
"id": "tx_direct_001",
"orderId": "order_789",
"status": "SUCCESS",
"action": "SALE",
"amount": 500,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": false,
"error": "Invalid payment method"
}
Overview
The deposit endpoint creates a new transaction for customer account funding. It supports multiple payment methods including cryptocurrencies, e-wallets, and BNPL services.curl -X POST "https://api.orsunpay.com/v1/payment/sale" \
-H "x-api-key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}'
const response = await fetch("https://api.orsunpay.com/v1/payment/sale", {
method: "POST",
headers: {
"x-api-key": "your-api-key-here",
"Content-Type": "application/json",
},
body: JSON.stringify({
amount: 1000,
currency: "USD",
paymentMethod: "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId: "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId: "transaction_123",
buyerId: "customer_123",
successUrl: "https://example.com/success",
failureUrl: "https://example.com/failure",
returnUrl: "https://example.com/return",
callbackUrl: "https://example.com/callback",
}),
});
const data = await response.json();
console.log(data);
import requests
import json
response = requests.post(
'https://api.orsunpay.com/v1/payment/sale',
headers={
'x-api-key': 'your-api-key-here',
'Content-Type': 'application/json'
},
json={
'amount': 1000,
'currency': 'USD',
'paymentMethod': 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId': 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId': 'transaction_123',
'buyerId': 'customer_123',
'successUrl': 'https://example.com/success',
'failureUrl': 'https://example.com/failure',
'returnUrl': 'https://example.com/return',
'callbackUrl': 'https://example.com/callback'
}
)
print(response.json())
<?php
$data = [
'amount' => 1000,
'currency' => 'USD',
'paymentMethod' => 'cr_clyv2goxb0000z8b8j5y6fl1j',
'merchantId' => 'mr_clyv2goxb0000z8b8j5y6fl1j',
'orderId' => 'transaction_123',
'buyerId' => 'customer_123',
'successUrl' => 'https://example.com/success',
'failureUrl' => 'https://example.com/failure',
'returnUrl' => 'https://example.com/return',
'callbackUrl' => 'https://example.com/callback'
];
$ch = curl_init('https://api.orsunpay.com/v1/payment/sale');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: your-api-key-here',
'Content-Type: application/json',
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
data := map[string]interface{}{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", "https://api.orsunpay.com/v1/payment/sale", bytes.NewBuffer(jsonData))
req.Header.Set("x-api-key", "your-api-key-here")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
require 'net/http'
require 'json'
uri = URI('https://api.orsunpay.com/v1/payment/sale')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['x-api-key'] = 'your-api-key-here'
request['Content-Type'] = 'application/json'
request.body = {
amount: 1000,
currency: 'USD',
paymentMethod: 'cr_clyv2goxb0000z8b8j5y6fl1j',
merchantId: 'mr_clyv2goxb0000z8b8j5y6fl1j',
orderId: 'transaction_123',
buyerId: 'customer_123',
successUrl: 'https://example.com/success',
failureUrl: 'https://example.com/failure',
returnUrl: 'https://example.com/return',
callbackUrl: 'https://example.com/callback'
}.to_json
response = http.request(request)
puts response.body
import java.io.*;
import java.net.http.*;
import java.net.URI;
public class CreateDeposit {
public static void main(String[] args) throws Exception {
String json = """
{
"amount": 1000,
"currency": "USD",
"paymentMethod": "cr_clyv2goxb0000z8b8j5y6fl1j",
"merchantId": "mr_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"buyerId": "customer_123",
"successUrl": "https://example.com/success",
"failureUrl": "https://example.com/failure",
"returnUrl": "https://example.com/return",
"callbackUrl": "https://example.com/callback"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.orsunpay.com/v1/payment/sale"))
.header("x-api-key", "your-api-key-here")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main()
{
var data = new
{
amount = 1000,
currency = "USD",
paymentMethod = "cr_clyv2goxb0000z8b8j5y6fl1j",
merchantId = "mr_clyv2goxb0000z8b8j5y6fl1j",
orderId = "transaction_123",
buyerId = "customer_123",
successUrl = "https://example.com/success",
failureUrl = "https://example.com/failure",
returnUrl = "https://example.com/return",
callbackUrl = "https://example.com/callback"
};
string json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
client.DefaultRequestHeaders.Add("x-api-key", "your-api-key-here");
HttpResponseMessage response = await client.PostAsync(
"https://api.orsunpay.com/v1/payment/sale", content);
string responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
{
"status": true,
"url": "https://payment-provider.com/pay/abc123",
"transaction": {
"id": "tx_clyv2goxb0000z8b8j5y6fl1j",
"orderId": "transaction_123",
"status": "PROCESSING",
"action": "SALE",
"amount": 1000,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": true,
"transaction": {
"id": "tx_direct_001",
"orderId": "order_789",
"status": "SUCCESS",
"action": "SALE",
"amount": 500,
"currency": "USD",
"createdAt": "2023-12-25T10:00:00.000Z"
}
}
{
"status": false,
"error": "Invalid payment method"
}
Payment Flow
- Create Transaction - Call this endpoint to initiate a deposit
- Redirect Customer - If
urlis provided, redirect customer to complete payment - Handle Callback - Process webhook notifications at your
callbackUrl - Redirect Customer - Customer returns to
successUrlorfailureUrl
Common Use Cases
Basic Deposit
Perfect for simple payment processing with minimal customer data required.Deposit with Customer Information
Include customer details for enhanced fraud protection and compliance requirements.Recurring Payments
Use metadata field to store subscription or recurring payment information.Authorizations
API key for merchant authorization
Body
Deposit transaction details
Transaction amount in cents
x >= 11000
Three-letter currency code (ISO 4217)
^[A-Z]{3}$"USD"
Payment method identifier
"cr_clyv2goxb0000z8b8j5y6fl1j"
Merchant account identifier
"mr_clyv2goxb0000z8b8j5y6fl1j"
Unique transaction identifier in your system
"transaction_123"
Customer identifier in your system
"customer_123"
URL to redirect customer after successful payment
"https://example.com/success"
URL to redirect customer after failed payment
"https://example.com/failure"
URL to redirect customer when returning to your site
"https://example.com/return"
Webhook URL for payment status notifications
"https://example.com/callback"
Language/locale in BCP 47 format
"en-US"
Show child attributes
Show child attributes
Additional payment method specific parameters
Additional metadata for the transaction
Response
Deposit transaction successfully created
Indicates if the request was successful
true
Redirect URL for payment completion (if required)
"https://payment-provider.com/pay/abc123"
Show child attributes
Show child attributes
Error message if the request failed
"Payment method not available"

