API v1

Dekaplet payments API reference

Base URL https://dekaplet.com/api/v1 Header X-API-Key
Dekaplet API Reference

Accept crypto payments through hosted checkout or direct payment flows.

Use the v1 API to retrieve supported currencies, estimate payable amounts, create payment sessions, monitor payment status, and receive signed webhook updates for reliable fulfillment.

Authentication Send your active merchant key with each API call.
JSON format POST bodies and API responses use application/json.
Verified webhooks Use signed events as the source of truth for fulfillment.
Hosted Checkout Request Production
POST https://dekaplet.com/api/v1/payment-links
Body
{
    "amount": 150,
    "currency": "BTC",
    "email": "customer@example.com",
    "name": "Ada Lovelace",
    "is_fixed_rate": false,
    "is_fee_paid_by_user": false,
    "order_id": "order_1001",
    "order_description": "Premium subscription payment",
    "success_url": "https://merchant.example/payments/success",
    "cancel_url": "https://merchant.example/payments/cancel"
}
KEY

Authentication

Authenticate server-side v1 requests with the active API key from your merchant dashboard.

KEY X-API-Key: sk_your_api_key_here

Headers

X-API-KeyActive merchant API key.
Acceptapplication/json
Content-Typeapplication/json for POST requests.
Keep server API keys on your server. Use the separate dk_ public key only for browser drop-in checkout.

Required Headers

JSON
{
    "headers": {
        "X-API-Key": "sk_your_api_key_here",
        "Accept": "application/json",
        "Content-Type": "application/json"
    }
}
GET

Retrieve balances

Return the latest balances available to the merchant account linked to the API key.

GET https://dekaplet.com/api/v1/balances

Request

AuthRequired
BodyNone
Use caseDisplay available, pending, and settled balances inside your dashboard.

Response

200 OK
{
    "success": true,
    "message": "Balances retrieved successfully.",
    "data": {
        "sub_partner_id": "111394288",
        "balances": [
            {
                "currency": "USDDTRC20",
                "amount": 0.7,
                "pending_amount": 0,
                "usd_amount": 0.7,
                "pending_usd_amount": 0,
                "updated_at": "2026-06-11T18:23:12-04:00"
            },
            {
                "currency": "USDTBSC",
                "amount": 1.000134184735,
                "pending_amount": 0,
                "usd_amount": 1.000134184735,
                "pending_usd_amount": 0,
                "updated_at": "2026-06-11T18:23:12-04:00"
            }
        ]
    }
}
GET

List currencies

Return enabled assets with network, precision, and validation details for checkout screens.

GET https://dekaplet.com/api/v1/currencies

Request

AuthRequired
BodyNone
Use casePopulate checkout currency selectors and validate customer selections.

Response

200 OK
{
    "success": true,
    "message": "Currencies retrieved successfully.",
    "data": [
        {
            "code_id": 1,
            "code": "BTC",
            "name": "Bitcoin",
            "network": "BTC",
            "icon_url": "/assets/images/coins/btc.svg",
            "logo_file": "btc.svg",
            "wallet_regex": "^(bc1|[13])[a-zA-HJ-NP-Z0-9]{25,39}$",
            "priority": 1,
            "extra_id_exists": false,
            "extra_id_regex": null,
            "track": 1,
            "cg_id": "bitcoin",
            "is_maxlimit": false,
            "smart_contract": null,
            "network_precision": 8,
            "usd_rate": 64000.12,
            "enabled": true,
            "created_at": "2026-06-04T18:23:12-04:00",
            "updated_at": "2026-06-11T18:23:12-04:00"
        },
        {
            "code_id": 2,
            "code": "ETH",
            "name": "Ethereum",
            "network": "ETH",
            "icon_url": "/assets/images/coins/eth.svg",
            "logo_file": "eth.svg",
            "wallet_regex": "^0x[a-fA-F0-9]{40}$",
            "priority": 2,
            "extra_id_exists": false,
            "extra_id_regex": null,
            "track": 1,
            "cg_id": "ethereum",
            "is_maxlimit": false,
            "smart_contract": null,
            "network_precision": 18,
            "usd_rate": 3200.44,
            "enabled": true,
            "created_at": "2026-06-04T18:23:12-04:00",
            "updated_at": "2026-06-11T18:23:12-04:00"
        }
    ]
}
GET

Check minimum amount

Check the smallest supported amount before showing a payment option to a customer.

GET https://dekaplet.com/api/v1/minimum-amount

Query Parameters

currency_frombtc or another source asset.
currency_tobtc or another destination asset.
fiat_equivalentOptional fiat equivalent, defaults to USD.
is_fixed_rateOptional boolean.
is_fee_paid_by_userOptional boolean.
Sample query
{
    "currency_from": "btc",
    "currency_to": "btc",
    "fiat_equivalent": "USD",
    "is_fixed_rate": false,
    "is_fee_paid_by_user": false
}

Response

200 OK
{
    "success": true,
    "message": "Minimum amount retrieved successfully.",
    "data": {
        "currency_from": "btc",
        "currency_to": "btc",
        "fiat_equivalent": "USD",
        "is_fixed_rate": false,
        "is_fee_paid_by_user": false,
        "min_amount": 0.00034,
        "fiat_equivalent_amount": 21.78,
        "raw": {
            "min_amount": 0.00034,
            "fiat_equivalent": 21.78
        }
    }
}
GET

Estimate payment amount

Estimate the crypto amount due for a USD charge before creating a payment.

GET https://dekaplet.com/api/v1/estimate

Query Parameters

amountUSD amount to convert.
currencyDestination asset ticker, for example BTC.
Sample query
{
    "amount": 150,
    "currency": "BTC"
}

Response

200 OK
{
    "success": true,
    "message": "Estimate retrieved successfully.",
    "data": {
        "amount": 150,
        "currency_from": "usd",
        "currency_to": "btc",
        "estimated_amount": 0.00231,
        "rate": 1.54e-5,
        "fee": null,
        "raw": {
            "currency_from": "usd",
            "amount_from": 150,
            "currency_to": "btc",
            "estimated_amount": 0.00231
        }
    }
}
POST

Create direct payment

Create a payment for an embedded checkout where your app displays the address, amount, network, and QR payload.

POST https://dekaplet.com/api/v1/payments

Body Parameters

amountRequired charge amount in USD.
currencyRequired payment asset ticker.
emailRequired customer email address.
success_urlOptional HTTPS URL for completed checkout redirects.
cancel_urlOptional HTTPS URL for cancelled checkout redirects.
Request body
{
    "amount": 150,
    "currency": "BTC",
    "email": "customer@example.com",
    "name": "Ada Lovelace",
    "order_id": "order_1001",
    "order_description": "Premium subscription payment",
    "success_url": "https://merchant.example/payments/success",
    "cancel_url": "https://merchant.example/payments/cancel"
}
Display the payment address, network, and crypto amount exactly as returned. Do not round payable amounts.

Response

201 Created
{
    "success": true,
    "message": "Payment created successfully.",
    "data": {
        "payment": {
            "payment_id": "5169465938",
            "invoice_id": "4315278456",
            "purchase_id": "4512369874",
            "payment_status": "waiting",
            "hosted_payment_url": "https://dekaplet.com/api/payment?iid=4315278456&paymentId=5169465938",
            "status_url": "https://dekaplet.com/api/v1/payments/5169465938",
            "success_url": "https://merchant.example/payments/success",
            "cancel_url": "https://merchant.example/payments/cancel",
            "created_at": "2026-06-11T18:23:12-04:00",
            "expires_at": "2026-06-11T18:43:12-04:00",
            "valid_until": "2026-06-11T19:23:12-04:00",
            "confirmed_at": null
        },
        "customer": {
            "name": "Ada Lovelace",
            "email": "customer@example.com"
        },
        "pricing": {
            "price_amount": 150,
            "price_currency": "USD",
            "pay_amount": 0.00231,
            "pay_currency": "BTC",
            "actually_paid": null,
            "is_fixed_rate": false,
            "is_fee_paid_by_user": false
        },
        "blockchain": {
            "pay_address": "bc1qexampleaddress1234567890",
            "pay_amount": 0.00231,
            "pay_currency": "BTC",
            "network": "BTC",
            "extra_id": null,
            "smart_contract": null,
            "network_precision": 8
        },
        "qr": {
            "payload": "bitcoin:bc1qexampleaddress1234567890?amount=0.00231",
            "amount_payload": "bc1qexampleaddress1234567890?amount=0.00231",
            "payment_uri": "bitcoin:bc1qexampleaddress1234567890?amount=0.00231",
            "code_url": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPi4uLjwvc3ZnPg==",
            "amount_code_url": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPi4uLjwvc3ZnPg=="
        },
        "merchant_reference": {
            "order_id": "order_1001",
            "order_description": "Premium subscription payment"
        },
        "integration_recommendations": [
            "Display the exact pay_amount, pay_currency, pay_address, network, and expires_at values without rounding.",
            "Render qr.code_url or qr.amount_code_url for wallet scanning, and also show the plain address for manual copy.",
            "Use GET /api/v1/payments/{payment_id} or signed webhooks to confirm payment before fulfillment.",
            "Do not treat browser redirects or customer screenshots as proof of payment.",
            "Expire your on-site checkout UI when expires_at has passed and create a new payment if the customer retries."
        ]
    }
}
JS

Javascript drop-in checkout

Open a native Dekaplet crypto checkout popup with a browser-safe public key.

JS https://dekaplet.com/dropin/v1/dekaplet.js

Browser Key

publicKeyYour dk_ drop-in public key. This key can only create drop-in sessions.
amountRequired charge amount in USD unless another display currency is configured.
cryptoCurrencyOptional asset ticker. If omitted, the customer selects an asset in the popup.
customer.emailRequired customer email address.
referenceOptional merchant order reference.
The drop-in uses /api/dropin/v1 routes and does not expose your server API key or call /api/v1/payments directly from the browser.

Example

HTML
<script src="https://dekaplet.com/dropin/v1/dekaplet.js"></script>

<button id="pay-with-dekaplet">Pay with Crypto</button>

<script>
document.getElementById('pay-with-dekaplet').onclick = function () {
  DekapletCheckout.open({
    publicKey: 'dk_your_public_key_here',
    amount: 150,
    currency: 'USD',
    reference: 'ORDER_1001',
    customer: {
      name: 'Ada Lovelace',
      email: 'customer@example.com'
    },
    onSuccess: function (payment) {
      console.log('Payment received', payment);
    }
  });
};
</script>
GET

Check payment status

Retrieve the latest status for a direct payment or hosted payment-link transaction.

GET https://dekaplet.com/api/v1/payments/{payment_id}

Path Parameters

payment_idThe payment ID returned when the payment was created.
Use status checks for reconciliation, but rely on verified webhooks for automated fulfillment.

Response

200 OK
{
    "success": true,
    "message": "Payment status retrieved successfully.",
    "data": {
        "payment_id": "5169465938",
        "invoice_id": "4315278456",
        "payment_status": "finished",
        "price_amount": 150,
        "price_currency": "USD",
        "pay_amount": 0.00231,
        "pay_currency": "BTC",
        "actually_paid": 0.00231,
        "confirmed_at": "2026-06-11T18:23:12-04:00"
    }
}
EVT

Payment webhooks

Receive signed payment status updates at the webhook URL configured in your merchant dashboard.

POST https://your-domain.com/webhooks/dekaplet

Headers

X-Dekaplet-Eventpayment.updated
X-Dekaplet-DeliveryUnique delivery ID for idempotency.
X-Dekaplet-TimestampUnix timestamp used in signature verification.
X-Dekaplet-Signaturesha256=... HMAC signature.
Webhook secretNot configured
Signature verification
const crypto = require('crypto');

const signedPayload = `${timestamp}.${rawBody}`;
const expected = 'sha256=' + crypto
  .createHmac('sha256', webhookSecret)
  .update(signedPayload)
  .digest('hex');

if (!crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))) {
  throw new Error('Invalid webhook signature');
}

Payload

payment.updated
{
    "id": "3d58cb81-b6ec-4203-a4df-d09c67b2c1d8",
    "event": "payment.updated",
    "created_at": "2026-06-11T18:23:12-04:00",
    "source": "dekaplet",
    "merchant": {
        "user_id": null
    },
    "payment": {
        "payment_id": "5169465938",
        "invoice_id": "4315278456",
        "purchase_id": "4512369874",
        "payment_status": "finished",
        "price_amount": 150,
        "price_currency": "USD",
        "pay_amount": 0.00231,
        "pay_currency": "BTC",
        "actually_paid": 0.00231,
        "pay_address": "bc1qexampleaddress1234567890",
        "network": "BTC",
        "confirmed_at": "2026-06-11T18:23:12-04:00",
        "customer": {
            "name": "Ada Lovelace",
            "email": "customer@example.com"
        }
    }
}
ERR

Errors and status codes

Handle validation, authentication, missing-resource, and processing failures consistently.

Status Codes

400Invalid request or unsupported operation.
401Missing, inactive, or invalid API key.
404Payment or resource was not found for the authenticated merchant.
422Validation failed.
500Unexpected processing failure. Retry safely after checking whether the payment was created.

Validation Error

422 Unprocessable Entity
{
    "success": false,
    "message": "Validation failed.",
    "errors": {
        "currency": [
            "The selected currency is invalid."
        ]
    }
}