Create Invoice
curl -X POST "https://api.example.com/v1/api/v1/create-invoice" \
-H "Content-Type: application/json" \
-H "X-Api-Key: YOUR_API_KEY" \
-d '{
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"purpose": "Payment for Premium subscription",
"success_url": "https://yoursite.com/payment/success"
}'
import requests
import json
url = "https://api.example.com/v1/api/v1/create-invoice"
headers = {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
}
data = {
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"purpose": "Payment for Premium subscription",
"success_url": "https://yoursite.com/payment/success"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.example.com/v1/api/v1/create-invoice", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-Api-Key": "YOUR_API_KEY"
},
body: JSON.stringify({
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"purpose": "Payment for Premium subscription",
"success_url": "https://yoursite.com/payment/success"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"purpose": "Payment for Premium subscription",
"success_url": "https://yoursite.com/payment/success"
}`)
req, err := http.NewRequest("POST", "https://api.example.com/v1/api/v1/create-invoice", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-Api-Key", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/v1/api/v1/create-invoice')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-Api-Key'] = 'YOUR_API_KEY'
request.body = '{
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"currency_code": "UAH",
"customer_id": "user_12345",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"purpose": "Payment for Premium subscription",
"success_url": "https://yoursite.com/payment/success"
}'
response = http.request(request)
puts response.body
{
"amount": "1500.00",
"callback_url": "https://yoursite.com/webhooks/payment",
"conversion_rate": "41.50",
"created_at": "2026-02-25T12:00:00Z",
"currency": "UAH",
"customer_id": "user_12345",
"expires_at": "2026-02-25T12:20:00Z",
"external_id": "order-2026-0001",
"fail_url": "https://yoursite.com/payment/failed",
"invoice_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"merchant_usdt": "35.42",
"payment_link": "https://pay.app.com/a1b2c3d4-5678-90ab-cdef-1234567890ab",
"purpose": "Payment for Premium subscription",
"status": "pending",
"success_url": "https://yoursite.com/payment/success"
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"successful": false,
"request_id": "a1b2c3d4-...",
"error": {
"code": "API_KEY_MISSING",
"message": "Missing X-Api-Key header"
}
}
{
"successful": false,
"request_id": "a1b2c3d4-...",
"error": {
"code": "API_KEY_INVALID",
"message": "Invalid or inactive API key"
}
}
{
"successful": false,
"request_id": "a1b2c3d4-...",
"error": {
"code": "DUPLICATE_EXTERNAL_ID",
"message": "External ID for this merchant is already exists, try to generate another External ID"
}
}
{
"successful": false,
"request_id": "a1b2c3d4-...",
"error": {
"code": "CURRENCY_INVALID",
"message": "Currency not found or disabled"
}
}
{
"successful": false,
"request_id": "a1b2c3d4-...",
"error": {
"code": "DEALS_SYSTEM_DISABLED",
"message": "Deals system is disabled"
}
}
/api/v1/create-invoice
The media type of the request body
Payment amount in fiat currency
ISO 4217 currency code (3 uppercase letters)
Unique customer identifier in your system. Used for rate limiting
Your unique invoice/order ID. Must be unique per merchant.
Payment description shown to customer on payment page
HTTPS URL for webhook notifications. Overrides merchant default webhook_url
URL to redirect customer after successful payment
URL to redirect customer after failed/expired payment
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Merchant API Key.
Body
Payment amount in fiat currency
ISO 4217 currency code (3 uppercase letters)
Unique customer identifier in your system. Used for rate limiting
Your unique invoice/order ID. Must be unique per merchant.
Payment description shown to customer on payment page
HTTPS URL for webhook notifications. Overrides merchant default webhook_url
URL to redirect customer after successful payment
URL to redirect customer after failed/expired payment
Responses
Internal invoice ID (UUID). Use this to query invoice status
Your external_id passed in the request
Invoice amount in fiat currency
Currency code (e.g. UAH, USD)
USDT/fiat conversion rate applied to this invoice
USDT amount that will be credited to merchant balance after payment (after commissions)
Invoice status: pending — awaiting payment, success — paid, expired — not paid in time, cancelled — cancelled
URL to redirect the customer for payment. Valid until expires_at
Customer ID from the request
Payment description from the request
Webhook URL that will receive payment notifications
Customer redirect URL on successful payment
Customer redirect URL on failed/expired payment
Invoice creation timestamp (ISO 8601 UTC)
Invoice expiration timestamp (ISO 8601 UTC). After this time the invoice cannot be paid
Payment completion timestamp (ISO 8601 UTC). null until paid
Path to invalid field
Pydantic error type
Error message
Unique request ID for debugging
Machine-readable error code
Human-readable description
Extra context (varies by error)
Unique request ID for debugging
Machine-readable error code
Human-readable description
Extra context (varies by error)
Unique request ID for debugging
Machine-readable error code
Human-readable description
Extra context (varies by error)
Unique request ID for debugging
Machine-readable error code
Human-readable description
Extra context (varies by error)
Unique request ID for debugging
Machine-readable error code
Human-readable description
Extra context (varies by error)
Last updated Feb 26, 2026
Built with Documentation.AI