Dinakel
Why Dinakel?How it worksGatewayMerchantUser Guide
User Guide
User GuideGatewayMerchantAPI Key
API key statusMerchant statusAvailable currenciesDonation gatewayCreate invoiceInvoice status

Login

Login

💳Create Invoice API

This endpoint creates an invoice scoped to the API key's merchant and returns a customer-ready payment URL.

Note:

Ensure that you pass a validmerchant_id, reference_id, andamountwhen making a request. If the merchant or reference is not found, or the amount is invalid, an error will be returned.

📝 Input Parameters

ParameterTypeRequiredDescription
merchant_idstring✔️Unique identifier for the merchant. This is required for creating an invoice.
reference_idstring✔️Your unique order ID (1–36 characters). Reuse the same value only when retrying the identical request.
currency_idstring✔️UUID of an operational currency on a network with an active wallet.
amountstring✔️Decimal string, at least 1, up to 28 total digits and 12 decimal places; for example "10.50".
descriptionstring❌Optional, up to 500 characters; must remain unchanged on retries.
  • 🔹 The API requires anAPI Keyfor authentication.
  • 🔹 Themerchant_idshould be passed in the request body.
  • 🔹 Theamountmust be a valid string representation of a number and greater than 1.

Request body format

Send this request body as JSON. In Postman, select Body → raw → JSON. multipart/form-data is not supported by this endpoint.

The Idempotency-Key header is required and must exactly match the reference_id in the request body.

Server-to-server

Backend integration examples

Choose your backend language. Every example reads secret credentials only from environment variables.

API key stays server-side
Node.js 18+ · native fetch
const response = await fetch("https://api.dinakel.com/api/gateway/v1/invoices", {
    method: "POST"
    headers: {
      Authorization: `Bearer ${process.env.DINAKEL_API_KEY}`,
      Accept: "application/json",
      "Content-Type": "application/json",
      "Idempotency-Key": process.env.DINAKEL_REFERENCE_ID
    }
    body: JSON.stringify({
  merchant_id: process.env.DINAKEL_MERCHANT_ID,
  reference_id: process.env.DINAKEL_REFERENCE_ID,
  currency_id: process.env.DINAKEL_CURRENCY_ID,
  amount: "10.50",
  description: "Order payment"
})
});

const result = await response.json();
if (!response.ok) throw new Error(result.message || "Dinakel request failed");
console.log(result);
DINAKEL_API_KEYMerchant secret API key; keep it on the server only

💡 Example Request


POST https://api.dinakel.com/api/gateway/v1/invoices

Headers:
Authorization: Bearer <your_api_key>
Idempotency-Key: <reference_id>
Content-Type: application/json
Accept: application/json

Body (raw JSON; not form-data):
{
  "merchant_id": "<merchant_id>",
  "reference_id": "<reference_id>",
  "currency_id": "<currency_id>",
  "amount": "<amount>",
  "description": "<description>"
}
          

🔍 Example Response


{
  "status": true,
  "statusCode": 201,
  "invoice_id": "<invoice_id>",
  "data": {
    "invoice_id": "<invoice_id>",
    "invoice_status": "draft",
    "payment_url": "https://dinakel.com/gateway-payment?invoice_id=<invoice_id>",
    "idempotency_replayed": false
  }
}
          

For retries, resend the same reference_id and unchanged invoice data. A replay returns HTTP 200 with the original invoice ID; a new invoice returns HTTP 201.

⚠️ Error Handling

The API provides the following error responses:


{
  "status": false,
  "statusCode": 400,
  "message": "Amount must be a valid decimal number."
}
            

400 Bad Request:The amount parameter is invalid. Ensure the amount is a valid decimal number and greater than 1.


{
  "status": false,
  "statusCode": 409,
  "message": "reference_id is already used with different invoice data",
  "message_key": "api.invoice.idempotency_conflict"
}
            

409 Conflict: The reference was already used with different invoice data.


{
  "status": false,
  "statusCode": 403,
  "message": "API key is not authorized for this merchant"
}
          

403 Forbidden: The key belongs to another merchant.


{
  "status": false,
  "statusCode": 409,
  "message": "Financial commands are unavailable for this currency",
  "operational_status": "maintenance"
}
          

409 Conflict: The network or currency is temporarily unavailable.

429 Too Many Requests: Up to 20 create requests per minute per key; use Retry-After.


{
  "status": false,
  "statusCode": 500,
  "message": "Internal server error"
}
            

500 Internal Server Error:An unexpected error occurred on the server. Try again later or contact support.

📖 Further Documentation

  • Available currencies
  • Merchant Status API
  • Invoice History
Dinakel

Professional crypto payment infrastructure for modern businesses.

Secure commerce infrastructure

Services

  • Why Dinakel?
  • How it works
  • User Guide
  • Gateway
  • Merchant
  • API Key

Legal

  • Terms of use
  • Crypto policy
  • Privacy policy
  • Cookie policy
© 2026 DinakelSimple · Secure · Trackable