logo
StartIntroduction

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 updates
  • success_url — where the customer returns after successful payment
  • fail_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"
  }'

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
}

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-Key header
  • Monetary amounts should have at most 2 decimal places: "1500.00"
  • Currency codes use ISO 4217 format: "UAH", "KZT", "UZS"
  • external_id must be unique per merchant
  • callback_url, success_url, and fail_url are 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.

Was this page helpful?

Last updated today

Built with Documentation.AI