Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - makepay-apps/makepay-python-sdk: Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion. · GitHub
Skip to content

Repository files navigation

MakePay Python SDK

Official Python SDK for MakePay server-side integrations. Use it to create crypto payment links, donation pages, invoices, bookkeeping records, subscriptions, POS terminals, products, Simple Shop storefronts, customer portals, branded domains, and signed webhook handlers.

Public source: https://github.com/makecryptoio/makepay-python-sdk

Install

pip install makepay
uv add makepay

The SDK targets Python 3.9 or newer, has no runtime dependencies, and uses Python standard library HTTP and crypto modules.

Configure

Create a MakePay API key in MakeCrypto and keep the secret on your server only.

importosfrommakepayimportMakePayClientmakepay=MakePayClient(
key_id=os.environ["MAKEPAY_KEY_ID"],
key_secret=os.environ["MAKEPAY_KEY_SECRET"],
)

The client sends X-MakeCrypto-Key-Id and X-MakeCrypto-Key-Secret headers to the MakePay partner API.

Payment Links

response=makepay.create_payment_link(
{
"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",
}
)
print(response["paymentLink"])

Read, update, and email existing links:

makepay.list_payment_links()
makepay.get_payment_link("PAYMENT_LINK_UID")
makepay.update_payment_link("PAYMENT_LINK_UID", {"status": "paused"})
makepay.send_payment_request_email("PAYMENT_LINK_UID", "buyer@example.com")

Donations

Donation pages are flexible-amount payment links with a public donation slug.

donation=makepay.create_donation_link(
{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}
)
print(donation["paymentLink"]["publicUrl"])
makepay.list_donation_links()
makepay.get_donation_link("DONATION_UID")
makepay.update_donation_link("DONATION_UID", {"status": "paused"})

Anonymous Payment Links

Anonymous links do not use a MakePay API key. They require an explicit settlement route because MakePay cannot read merchant wallet settings.

frommakepayimportcreate_anonymous_payment_linkresponse=create_anonymous_payment_link(
{
"amount": "25",
"settlement": {
"currency": "USDT",
"priorities": [
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
}
],
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}
)

Checkout URLs And Embeds

Use hosted checkout for redirects, or the embed helpers when your frontend keeps the shopper on the merchant site.

frommakepayimport (
build_makepay_embedded_checkout_url,
build_makepay_hosted_checkout_url,
build_makepay_iframe_html,
)
payment_uid=response["paymentLink"]["uid"]
hosted_url=build_makepay_hosted_checkout_url(payment_uid)
embed_url=build_makepay_embedded_checkout_url(
payment_uid,
parent_origin="https://merchant.example",
)
iframe_html=build_makepay_iframe_html(payment_uid)

Donation pages also have URL helpers:

makepay.hosted_donation_url("spring-campaign")
makepay.embedded_donation_url(
"spring-campaign",
parent_origin="https://merchant.example",
)

For static CMS pages, build_makepay_embed_button_html(payment_uid) returns a button snippet that loads the MakePay modal script, and build_makepay_iframe_html(payment_uid) returns an iframe snippet.

Customers And Subscriptions

makepay.upsert_customer(
{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
}
)
makepay.create_customer_portal(
"CUSTOMER_ID",
{"returnUrl": "https://merchant.example/account"},
)
makepay.create_subscription(
{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
}
)

POS Terminals

terminal=makepay.create_pos_terminal(
{
"name": "Front counter",
"pin": "1234",
"allowedAssets": ["ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"],
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": True,
}
)
makepay.list_pos_terminals()
makepay.get_pos_terminal(str(terminal["terminal"]["uid"]))

Products And Simple Shop

makepay.create_product(
{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": [{"url": "https://merchant.example/guide.png", "alt": "Guide cover"}],
"variants": [{"name": "PDF", "priceUsd": "19"}],
}
)
makepay.create_product_download(
"PRODUCT_UID",
{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
},
)
makepay.update_shop(
{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": {"accentColor": "#14b8a6"},
}
)
makepay.update_shop_domain("shop.merchant.example")
makepay.refresh_shop_domain()
makepay.create_shop_coupon(
{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
}
)
makepay.list_shop_orders({"status": "paid", "limit": 25})

Invoices And Bookkeeping

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

created=makepay.create_bookkeeping_invoice(
{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": {
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": [
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
}
],
"metadata": {"orderId": "order_1042"},
}
)
makepay.create_bookkeeping_invoice_payment_link(
"INVOICE_UID",
{"sendPaymentRequestEmail": True},
)
makepay.list_bookkeeping_invoices()
makepay.get_bookkeeping_invoice("INVOICE_UID")
makepay.update_bookkeeping_invoice("INVOICE_UID", {"status": "open"})

Expenses can be created manually or from wallet activity, then linked back to payments, transfers, invoices, or uploaded receipts.

makepay.create_bookkeeping_expense(
{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": {"name": "Vendor Example", "type": "vendor"},
}
)
makepay.create_bookkeeping_expense_from_activity(
{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
}
)
makepay.create_bookkeeping_reconciliation(
{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
}
)

Document uploads use multipart form data. Pass bytes, a file path, or a readable file object.

withopen("receipt.pdf", "rb") asreceipt:
makepay.upload_bookkeeping_document(
{
"file": receipt,
"fileName": "receipt.pdf",
"documentType": "receipt",
"expenseId": "EXPENSE_UID",
}
)
makepay.list_bookkeeping_documents()
makepay.get_bookkeeping_document_download_url("DOCUMENT_UID")
makepay.run_bookkeeping_document_ocr("DOCUMENT_UID")
makepay.get_bookkeeping_summary()

Branding And Domains

makepay.update_branding(
{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
}
)
makepay.refresh_branding_domains("all")

Settings And Operational APIs

makepay.get_settings()
makepay.update_settings(
{
"callbackUrl": "https://merchant.example/webhooks/makepay",
}
)
makepay.list_destination_assets()
makepay.list_webhook_requests({"limit": 25})

Webhook Verification

Read the exact raw body before parsing JSON.

importosfrommakepayimportparse_makepay_webhookdefhandle_makepay_webhook(raw_body: bytes, headers: dict[str, str]):
event=parse_makepay_webhook(
raw_body,
headers.get("x-makepay-signature"),
os.environ["MAKEPAY_WEBHOOK_SECRET"],
)
ifevent.get("event", {}).get("type") =="status_changed":
# Update your local order status.passreturn"ok", 200

Use verify_makepay_webhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linkscreate_payment_link, list_payment_links, get_payment_link, update_payment_link, send_payment_request_email
Donationscreate_donation_link, list_donation_links, get_donation_link, update_donation_link
Anonymous linkscreate_anonymous_payment_link
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
Customerslist_customers, upsert_customer, create_customer_portal
Subscriptionslist_subscriptions, create_subscription
POS terminalslist_pos_terminals, create_pos_terminal, get_pos_terminal, update_pos_terminal
Productslist_products, create_product, get_product, update_product, list_product_downloads, create_product_download
Simple Shopget_shop, update_shop, get_shop_builder, update_shop_builder, get_shop_domain, update_shop_domain, refresh_shop_domain, coupons, orders
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
Brandingget_branding, update_branding, refresh_branding_domains
Operationsget_settings, update_settings, list_destination_assets, list_webhook_requests
Webhooksverify_makepay_webhook, parse_makepay_webhook

Data Models And Response Models

Python payloads are plain dictionaries that use the MakePay API field names. New integrations should send camelCase keys such as customerEmail, paymentLinkDomain, and billingIntervalUnit.

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 raise MakePayError for non-2xx responses. Successful responses are decoded JSON dictionaries, so production can add fields without requiring a Python package update.

Accepted Payload Models

ModelUsed byRequired fieldsCommon optional fields
Payment link payloadcreate_payment_linkamounttitle, description, currency, asset, orderId, customerEmail, clientId, returnUrl, successUrl, metadata
Donation link payloadcreate_donation_linknonedefaultAmountUsd, minimumAmountUsd, donationSlug, payment-link display and redirect fields
Anonymous payment link payloadcreate_anonymous_payment_linkamount, settlement.currency, settlement.prioritiestitle, customerEmail, orderId, metadata, branding, webhookUrl, checkout redirect URLs
Customer payloadupsert_customerone of email, customerEmail, name, clientIdmetadata
Subscription payloadcreate_subscriptionplan amount/customer fields for your billing flowamountUsd, customerEmail, label, billingIntervalUnit, billingIntervalCount, startAt, sendPaymentRequestEmail
POS terminal payloadcreate_pos_terminal, update_pos_terminalnamepin, status, allowedAssets, emailCollectionMode, catalogEnabled, displaySettings, metadata
Product payloadcreate_product, update_productnamedescription, sku, status, productType, basePriceUsd, shopSlug, images, variants, taxRates, metadata
Shop payloadupdate_shopnoneslug, status, displayCurrency, checkoutMode, billingDetailsRequired, shipping fields, links, SEO, tracking, branding
Branding payloadupdate_brandingnonebrand name, support email, website URL, theme colors, paymentLinkDomain, emailSendingDomain
Bookkeeping invoice payloadcreate_bookkeeping_invoice, update_bookkeeping_invoicenone; blank invoices are allowed as draftsinvoiceNumber, status, paymentStatus, currency, issueDate, dueDate, counterparty, lineItems, documentIds
Bookkeeping expense payloadcreate_bookkeeping_expense, create_bookkeeping_expense_from_activity, update_bookkeeping_expensenone; amount defaults to zero if no activity is usedamount, currency, category, incurredOn, walletActivityEventId, walletActivityEventKey, counterparty, metadata
Bookkeeping document uploadupload_bookkeeping_documentfilefileName, documentType, invoiceId, expenseId
Bookkeeping reconciliation payloadcreate_bookkeeping_reconciliationone target and one sourcetarget: invoiceId or expenseId; source: payment link/session, subscription cycle, or wallet activity; amount, assetSymbol
Dictionary payloadproduct downloads, shop builder, coupons, settings, customer portalroute-specificthese advanced surfaces stay open-ended while their server schemas evolve

Errors

API calls raise MakePayError with status and response_body fields.

frommakepayimportMakePayErrortry:
makepay.get_payment_link("PAYMENT_LINK_UID")
exceptMakePayErroraserror:
print(error.status, error.response_body)

Source Layout

The canonical monorepo source lives in apps/plugins/python-sdk. The public repository at https://github.com/makecryptoio/makepay-python-sdk mirrors only the SDK files so developers can install or inspect it without the full MakeCrypto workspace.

Release Notes

The package is published as makepay on PyPI. Version 0.3.0 aligns the Python surface with the MakePay JavaScript SDK 0.3.0.

About

Official MakePay Python SDK. Cryptocurrency payment gateway for direct self-custody merchant-wallet settlement, decentralized swaps, and 70+ coin/20+ chain auto-conversion.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages