SDK Libraries

Java SDK

Install the official MakePay Java SDK for payment links, settings, and webhook verification.

MakePay Java SDK

Overview

io.makecrypto:makepay is the official Java SDK for MakePay server-side integrations. It wraps API-key authentication, payment and donation links, anonymous public links, customers, subscriptions, invoices, bookkeeping, POS terminals, product catalogs, Simple Shop, branded domains, operational APIs, and signed webhook verification.

Package:

io.makecrypto:makepay

Installation

Gradle:

dependencies {
    implementation("io.makecrypto:makepay:0.3.0")
}

Maven:

<dependency>
  <groupId>io.makecrypto</groupId>
  <artifactId>makepay</artifactId>
  <version>0.3.0</version>
</dependency>

The SDK targets Java 11 or newer and uses the standard JDK HTTP client.

Authentication

Create a MakePay API key from the MakeCrypto merchant developer area and store the key secret only on your server.

import io.makecrypto.makepay.MakePayClient;
import io.makecrypto.makepay.MakePayClientOptions;

MakePayClient makepay = new MakePayClient(
    MakePayClientOptions.builder()
        .keyId(System.getenv("MAKEPAY_KEY_ID"))
        .keySecret(System.getenv("MAKEPAY_KEY_SECRET"))
        .build()
);

The SDK sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API. You can pass baseUrl for a non-production MakeCrypto API origin, and checkoutBaseUrl for a custom MakePay checkout origin.

import com.fasterxml.jackson.databind.JsonNode;
import java.util.Map;

JsonNode response = makepay.createPaymentLink(Map.of(
    "title", "Order #1042",
    "description", "Checkout for order #1042",
    "amount", "129.99",
    "currency", "USDT",
    "orderId", "order_1042",
    "customerEmail", "buyer@example.com",
    "returnUrl", "https://merchant.example/orders/1042",
    "successUrl", "https://merchant.example/orders/1042/success",
    "failureUrl", "https://merchant.example/orders/1042/pay",
    "expirationTime", "12h"
));

String publicUrl = response.path("paymentLink").path("publicUrl").asText();

Send a payment request email during creation:

import io.makecrypto.makepay.CreatePaymentLinkOptions;

makepay.createPaymentLink(
    payload,
    CreatePaymentLinkOptions.builder()
        .sendPaymentRequestEmail(true)
        .build()
);

Read and manage existing links:

makepay.listPaymentLinks();
makepay.getPaymentLink("PAYMENT_LINK_UID");
makepay.updatePaymentLink("PAYMENT_LINK_UID", Map.of("status", "paused"));
makepay.sendPaymentRequestEmail("PAYMENT_LINK_UID", "buyer@example.com");

Donation links use the same settlement and checkout infrastructure as payment links, but they publish a public donation slug and allow flexible donor amounts.

JsonNode donation = makepay.createDonationLink(Map.of(
    "title", "Spring campaign",
    "description", "Support the 2026 spring fundraiser.",
    "defaultAmountUsd", "25",
    "minimumAmountUsd", "5",
    "donationSlug", "spring-campaign"
));

String donationUrl = donation.path("paymentLink").path("publicUrl").asText();

makepay.listDonationLinks();
makepay.getDonationLink("DONATION_UID");
makepay.updateDonationLink("DONATION_UID", Map.of("status", "paused"));

Use anonymous links when a payment page should be created without a MakePay API key. Because there is no authenticated merchant account, the request must include settlement routing.

import java.util.List;

JsonNode response = MakePayClient.createAnonymousPaymentLink(Map.of(
    "amount", "25",
    "settlement", Map.of(
        "currency", "USDT",
        "priorities", List.of(Map.of(
            "chain", "ETH",
            "address", "0xYourSettlementWallet",
            "asset", "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"
        ))
    ),
    "title", "Invoice #1042",
    "customerEmail", "buyer@example.com",
    "webhookUrl", "https://merchant.example/webhooks/makepay"
));

Anonymous link payloads support title, description, orderId, clientId, customerEmail, returnUrl, successUrl, failureUrl, metadata, branding, webhookUrl, and expirationTime values from 15 minutes to 72 hours.

Hosted And Embedded Checkout

Use hosted checkout URLs for full-page redirects, or the embed helpers when your frontend keeps the shopper on the merchant page.

String paymentUid = response.path("paymentLink").path("uid").asText();

String hostedUrl = makepay.hostedCheckoutUrl(paymentUid);
String embedUrl = makepay.embeddedCheckoutUrl(
    paymentUid,
    "https://merchant.example"
);
String buttonHtml = makepay.embedButtonHtml(paymentUid, "Pay with crypto");
String iframeHtml = makepay.iframeHtml(paymentUid, "Secure MakePay checkout");

Donation pages have hosted and embedded URL helpers too:

makepay.hostedDonationUrl("spring-campaign");
makepay.embeddedDonationUrl("spring-campaign", "https://merchant.example");

For static CMS pages, MakePayClient.buildEmbedButtonHtml(paymentUid, baseUrl, label) returns a button snippet that loads the MakePay modal script.

Customers

makepay.upsertCustomer(Map.of(
    "email", "buyer@example.com",
    "name", "Buyer Example",
    "clientId", "crm_123",
    "metadata", Map.of("plan", "pro")
));

makepay.listCustomers();

makepay.createCustomerPortal("CUSTOMER_ID", Map.of(
    "returnUrl", "https://merchant.example/account"
));

Subscriptions

makepay.createSubscription(Map.of(
    "amountUsd", "29",
    "customerEmail", "buyer@example.com",
    "label", "Monthly plan",
    "billingIntervalUnit", "month",
    "billingIntervalCount", 1,
    "sendPaymentRequestEmail", true
));

makepay.listSubscriptions();

Subscription invoice payment links are generated by the subscription API. Do not create subscription_invoice links directly through createPaymentLink.

POS Terminals

JsonNode terminal = makepay.createPosTerminal(Map.of(
    "name", "Front counter",
    "pin", "1234",
    "allowedAssets", List.of(
        "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"
    ),
    "emailCollectionMode", "optional_after_deposit",
    "catalogEnabled", true
));

makepay.listPosTerminals();
makepay.getPosTerminal("TERMINAL_UID");
makepay.updatePosTerminal("TERMINAL_UID", Map.of(
    "name", "Front counter",
    "pin", "5678",
    "catalogEnabled", true
));

Products

Products power POS catalogs and Simple Shop storefronts.

makepay.createProduct(Map.of(
    "name", "Digital guide",
    "productType", "digital",
    "basePriceUsd", "19",
    "shopSlug", "digital-guide",
    "images", List.of(Map.of(
        "url", "https://merchant.example/guide.png",
        "alt", "Guide cover"
    )),
    "variants", List.of(Map.of("name", "PDF", "priceUsd", "19"))
));

makepay.listProducts();
makepay.getProduct("PRODUCT_UID");
makepay.updateProduct("PRODUCT_UID", Map.of(
    "name", "Digital guide",
    "status", "active"
));

Digital products can include downloads:

makepay.createProductDownload("PRODUCT_UID", Map.of(
    "fileName", "guide.pdf",
    "contentType", "application/pdf",
    "url", "https://merchant.example/downloads/guide.pdf"
));

makepay.listProductDownloads("PRODUCT_UID");

Simple Shop

makepay.updateShop(Map.of(
    "slug", "merchant-shop",
    "displayCurrency", "USD",
    "checkoutMode", "hosted",
    "billingDetailsRequired", true,
    "flatShippingFeeUsd", "5",
    "freeShippingThresholdUsd", "100"
));

makepay.getShop();
makepay.updateShopBuilder(Map.of("blocks", List.of()));
makepay.getShopBuilder();

Connect and verify a shop domain:

makepay.updateShopDomain("shop.merchant.example");
makepay.getShopDomain();
makepay.refreshShopDomain();

Manage coupons and orders:

makepay.createShopCoupon(Map.of(
    "code", "SPRING10",
    "discountType", "percent",
    "value", "10"
));

makepay.listShopCoupons();
makepay.updateShopCoupon("COUPON_UID", Map.of("status", "archived"));
makepay.archiveShopCoupon("COUPON_UID");
makepay.listShopOrders(Map.of("status", "paid", "limit", 25));

Invoices And Bookkeeping

Bookkeeping APIs manage merchant invoices, expenses, supporting documents, OCR, and reconciliation links.

JsonNode invoice = makepay.createBookkeepingInvoice(Map.of(
    "title", "Invoice #1042",
    "currency", "USD",
    "issueDate", "2026-05-15",
    "dueDate", "2026-05-30",
    "counterparty", Map.of(
        "name", "Buyer Example",
        "email", "buyer@example.com",
        "clientId", "crm_123"
    ),
    "lineItems", List.of(Map.of(
        "description", "Implementation services",
        "quantity", "1",
        "unitAmount", "500",
        "taxAmount", "0"
    )),
    "metadata", Map.of("orderId", "order_1042")
));

makepay.createBookkeepingInvoicePaymentLink("INVOICE_UID", Map.of(
    "sendPaymentRequestEmail", true
));

makepay.listBookkeepingInvoices();
makepay.getBookkeepingInvoice("INVOICE_UID");
makepay.updateBookkeepingInvoice("INVOICE_UID", Map.of("status", "open"));

Create and reconcile expenses manually or from wallet activity:

makepay.createBookkeepingExpense(Map.of(
    "title", "Hosting",
    "amount", "49",
    "currency", "USD",
    "incurredOn", "2026-05-15",
    "category", "Infrastructure"
));

makepay.createBookkeepingExpenseFromActivity(Map.of(
    "walletActivityEventKey", "CHAIN_EVENT_KEY",
    "category", "Settlement"
));

makepay.createBookkeepingReconciliation(Map.of(
    "invoiceId", "INVOICE_UID",
    "paymentSessionId", "PAYMENT_SESSION_ID",
    "linkType", "payment"
));

Document uploads use multipart form data through a Path or byte array.

import java.nio.file.Path;

makepay.uploadBookkeepingDocument(
    Path.of("receipt.pdf"),
    "receipt.pdf",
    "receipt",
    null,
    "EXPENSE_UID"
);

makepay.listBookkeepingDocuments();
makepay.getBookkeepingDocumentDownloadUrl("DOCUMENT_UID");
makepay.runBookkeepingDocumentOcr("DOCUMENT_UID");
makepay.getBookkeepingSummary();

Branding And Domains

Branding controls merchant display details, checkout theme colors, payment-link domains, and email-sending domains.

makepay.updateBranding(Map.of(
    "brandName", "Merchant",
    "businessDescription", "Digital products and services.",
    "websiteUrl", "https://merchant.example",
    "supportEmail", "support@merchant.example",
    "brandingAccentColor", "#14b8a6",
    "paymentLinkDomain", "pay.merchant.example",
    "emailSendingDomain", "mail.merchant.example"
));

makepay.getBranding();
makepay.refreshBrandingDomains("all");

Use refreshBrandingDomains("payment-link") or refreshBrandingDomains("email-sending") when you only need one domain check.

Operational APIs

makepay.getSettings();
makepay.updateSettings(Map.of(
    "callbackUrl", "https://merchant.example/webhooks/makepay"
));

makepay.listDestinationAssets();
makepay.listWebhookRequests(Map.of("limit", 25));

listDestinationAssets is useful before configuring settlement overrides or anonymous settlement routes.

Webhook Verification

MakePay signs the exact raw request body. Read the body before parsing JSON.

import io.makecrypto.makepay.MakePayWebhook;

String rawBody = requestBodyString;
String signature = request.getHeader("x-makepay-signature");

JsonNode event = MakePayWebhook.parse(
    rawBody,
    signature,
    System.getenv("MAKEPAY_WEBHOOK_SECRET")
);

if ("status_changed".equals(event.path("event").path("type").asText())) {
    // Update the local order.
}

Use MakePayWebhook.verify(...) when you only need a boolean result.

SDK Method Coverage

AreaMethods
Payment linkscreatePaymentLink, listPaymentLinks, getPaymentLink, updatePaymentLink, sendPaymentRequestEmail
DonationscreateDonationLink, listDonationLinks, getDonationLink, updateDonationLink
Anonymous linkscreateAnonymousPaymentLink, createAnonymousMakePayPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomerslistCustomers, upsertCustomer, createCustomerPortal
SubscriptionslistSubscriptions, createSubscription
POS terminalslistPosTerminals, createPosTerminal, getPosTerminal, updatePosTerminal
ProductslistProducts, createProduct, getProduct, updateProduct, listProductDownloads, createProductDownload
Simple ShopgetShop, updateShop, getShopBuilder, updateShopBuilder, getShopDomain, updateShopDomain, refreshShopDomain, coupon and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandinggetBranding, updateBranding, refreshBrandingDomains
OperationsgetSettings, updateSettings, listDestinationAssets, listWebhookRequests
WebhooksMakePayWebhook.verify, MakePayWebhook.parse

Payloads And Response Models

Java payloads are Map<String, ?> values so the SDK can track MakePay API growth without forcing a Java model release for every field. Use the same camelCase payload names as the npm SDK.

Model conventions:

  • Use strings for decimal money values when precision matters, for example "129.99" instead of 129.99.
  • Dates are ISO strings. Date-only fields, such as invoice issueDate, should use YYYY-MM-DD.
  • IDs are usually public uid values. Bookkeeping detail endpoints accept an internal UUID or public UID.
  • API methods throw MakePayError for non-2xx responses.
  • Successful API calls return Jackson JsonNode envelopes so production can add fields without breaking JVM consumers.

Accepted Payload Models

Payload surfaceUsed byRequired fieldsCommon optional fields
Payment linkcreatePaymentLinkamounttitle, description, currency, asset, orderId, customerEmail, clientId, redirect URLs, metadata
Donation linkcreateDonationLinknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment linkcreateAnonymousPaymentLinkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
CustomerupsertCustomerone of email, customerEmail, name, clientIdmetadata
SubscriptioncreateSubscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminalcreatePosTerminal, updatePosTerminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
ProductcreateProduct, updateProductnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Simple ShopupdateShopnoneslug, status, displayCurrency, checkoutMode, shipping fields, links, SEO, tracking, branding
BrandingupdateBrandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoicecreateBookkeepingInvoice, updateBookkeepingInvoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expensecreateBookkeepingExpense, createBookkeepingExpenseFromActivity, updateBookkeepingExpensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, wallet activity IDs, counterparty, metadata
Document uploaduploadBookkeepingDocumentfilefileName, documentType, invoiceId, expenseId
ReconciliationcreateBookkeepingReconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment, subscription cycle, or wallet activity; amount, assetSymbol, metadata
Open-ended mapsproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Error Handling

API calls throw MakePayError. It includes the HTTP status and decoded response body.

import io.makecrypto.makepay.MakePayError;

try {
    makepay.getPaymentLink("PAYMENT_LINK_UID");
} catch (MakePayError error) {
    logger.warn("MakePay failed with status {}", error.getStatus());
}

Source Layout

The canonical monorepo source lives in apps/plugins/java-sdk. The published Maven package contains the compiled jar, sources jar, javadocs jar, signed POM, and Central Portal checksums.

Release Notes

The package is published as io.makecrypto:makepay on Maven Central through the Central Portal Publisher API. Release publishing uses a Central Portal user token and an in-memory PGP signing key in GitHub Actions.

Need partner setup help?

Open the payment link details view in MakeCrypto to copy the generated snippets for a real payment UID, or return to the portal to manage merchant settings.

Open portal