Introduction
Merchant API allows you to accept fiat payments from your customers and receive settlements in USDT.
Base URL: https://api.ecca-ex.com/api/v1
How it works
Create an invoice
Send POST /api/v1/create-invoice with the amount, currency, customer ID, your unique order ID, and required URLs.
The required URLs are:
callback_url— where we send payment status updatessuccess_url— where the customer returns after successful paymentfail_url— where the customer returns after failed, expired, or canceled payment
Redirect the customer
Use payment_link from the response to redirect the customer to the hosted payment page.
We handle the payment flow on that page.
Receive payment updates
We send payment status updates to your callback_url.
Your system should process these updates and match them with your order using external_id.
Complete the order
Once you receive a successful payment update, mark the order as paid in your system and fulfill it.
Quick start
Get your API key
Generate an API key in your merchant dashboard.
Create an invoice
curl -X POST https://api.ecca-ex.com/api/v1/create-invoice \
-H "Content-Type: application/json" \
-H "X-Api-Key: your_api_key_here" \
-d '{
"amount": "1500.00",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"purpose": "Premium subscription",
"callback_url": "https://yoursite.com/webhooks/payment",
"success_url": "https://yoursite.com/payment/success",
"fail_url": "https://yoursite.com/payment/failed"
}'
const response = await fetch("https://api.ecca-ex.com/api/v1/create-invoice", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "your_api_key_here"
},
body: JSON.stringify({
amount: "1500.00",
currency_code: "UAH",
customer_id: "user_12345",
external_id: "order-2026-0001",
purpose: "Premium subscription",
callback_url: "https://yoursite.com/webhooks/payment",
success_url: "https://yoursite.com/payment/success",
fail_url: "https://yoursite.com/payment/failed"
})
});
const invoice = await response.json();
console.log(invoice);
const axios = require("axios");
async function createInvoice() {
const { data } = await axios.post(
"https://api.ecca-ex.com/api/v1/create-invoice",
{
amount: "1500.00",
currency_code: "UAH",
customer_id: "user_12345",
external_id: "order-2026-0001",
purpose: "Premium subscription",
callback_url: "https://yoursite.com/webhooks/payment",
success_url: "https://yoursite.com/payment/success",
fail_url: "https://yoursite.com/payment/failed"
},
{
headers: {
"Content-Type": "application/json",
"X-Api-Key": "your_api_key_here"
}
}
);
return data;
}
createInvoice().then((invoice) => {
console.log(invoice);
});
import requests
url = "https://api.ecca-ex.com/api/v1/create-invoice"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "your_api_key_here",
}
payload = {
"amount": "1500.00",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"purpose": "Premium subscription",
"callback_url": "https://yoursite.com/webhooks/payment",
"success_url": "https://yoursite.com/payment/success",
"fail_url": "https://yoursite.com/payment/failed",
}
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()
invoice = response.json()
print(invoice)
<?php
$url = "https://api.ecca-ex.com/api/v1/create-invoice";
$payload = [
"amount" => "1500.00",
"currency_code" => "UAH",
"customer_id" => "user_12345",
"external_id" => "order-2026-0001",
"purpose" => "Premium subscription",
"callback_url" => "https://yoursite.com/webhooks/payment",
"success_url" => "https://yoursite.com/payment/success",
"fail_url" => "https://yoursite.com/payment/failed",
];
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: your_api_key_here",
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = curl_exec($ch);
if ($response === false) {
throw new Exception(curl_error($ch));
}
curl_close($ch);
$invoice = json_decode($response, true);
print_r($invoice);
Redirect to payment page
The response contains payment_link.
{
"invoice_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"external_id": "order-2026-0001",
"amount": "1500.00",
"currency": "UAH",
"status": "pending",
"payment_link": "https://pay.app.com/f47ac10b-58cc-4372-a567-0e02b2c3d479",
"customer_id": "user_12345",
"purpose": "Premium subscription",
"callback_url": "https://yoursite.com/webhooks/payment",
"success_url": "https://yoursite.com/payment/success",
"fail_url": "https://yoursite.com/payment/failed",
"created_at": "2026-02-26T14:30:00+00:00",
"expires_at": "2026-02-26T14:45:00+00:00",
"finished_at": null
}
{
"successful": false,
"request_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"error": {
"code": "MISSING_REQUIRED_URLS",
"message": "callback_url, success_url and fail_url are required. Provide them in the request or set defaults in merchant settings",
"details": {
"missing_fields": ["callback_url"]
}
}
}
Redirect your customer to this URL:
https://pay.app.com/f47ac10b-58cc-4372-a567-0e02b2c3d479
Handle the result
After the customer pays, your callback_url receives a payment update.
Use it to update the order status in your system.
Request basics
- Use
Content-Type: application/json - Send your API key in the
X-Api-Keyheader - Monetary amounts should have at most 2 decimal places:
"1500.00" - Currency codes use ISO 4217 format:
"UAH","KZT","UZS" external_idmust be unique per merchantcallback_url,success_url, andfail_urlare required
Save the request_id from error responses. It helps support locate your request in logs.
Next steps
Authentication
Learn how to use your API key and required request headers.
Invoices
Create invoices and check payment status.
Webhooks
Receive payment status updates on your callback URL.
Currencies
View supported currencies and rates.
Errors
Understand error codes and validation responses.
Last updated today
Built with Documentation.AI