Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n 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;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

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

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

MakePay Go SDK

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

Install

go get github.com/makecryptoio/makepay-go

The package is published through the public Go module index:

https://pkg.go.dev/github.com/makecryptoio/makepay-go

Public source: https://github.com/makecryptoio/makepay-go

The module targets Go 1.22 or newer and uses only the Go standard library.

Configure

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

package main
import (
"context""log""os"
makepay "github.com/makecryptoio/makepay-go"
)
funcmain() {
client, err:=makepay.NewClient(makepay.ClientOptions{
KeyID: os.Getenv("MAKEPAY_KEY_ID"),
KeySecret: os.Getenv("MAKEPAY_KEY_SECRET"),
// Optional: override only when MakePay gives you a custom checkout origin.CheckoutBaseURL: "https://makepay.io",
})
iferr!=nil {
log.Fatal(err)
}
_=client_=context.Background()
}

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

Payment Links

response, err:=client.CreatePaymentLink(context.Background(), makepay.PaymentLinkPayload{
"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",
}, nil)
iferr!=nil {
returnerr
}
log.Printf("created MakePay link: %#v", response["paymentLink"])

Read, update, and email existing links:

links, err:=client.ListPaymentLinks(ctx, map[string]any{"limit": 50})
detail, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
updated, err:=client.UpdatePaymentLink(ctx, "PAYMENT_LINK_UID", map[string]any{
"status": "paused",
})
sent, err:=client.SendPaymentRequestEmail(ctx, "PAYMENT_LINK_UID", "buyer@example.com")
_, _, _, _=links, detail, updated, sent

Donations

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

donation, err:=client.CreateDonationLink(ctx, makepay.DonationLinkPayload{
"title": "Spring campaign",
"description": "Support the 2026 spring fundraiser.",
"defaultAmountUsd": "25",
"minimumAmountUsd": "5",
"donationSlug": "spring-campaign",
}, nil)
iferr!=nil {
returnerr
}
links, err:=client.ListDonationLinks(ctx)
detail, err:=client.GetDonationLink(ctx, "DONATION_UID")
updated, err:=client.UpdateDonationLink(ctx, "DONATION_UID", map[string]any{
"status": "paused",
})
_, _, _, _=donation, links, detail, updated

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.

response, err:=makepay.CreateAnonymousPaymentLink(ctx, makepay.AnonymousPaymentLinkPayload{
"amount": "25",
"settlement": map[string]any{
"currency": "USDT",
"priorities": []map[string]any{
{
"chain": "ETH",
"address": "0xYourSettlementWallet",
"asset": "ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7",
},
},
},
"title": "Invoice #1042",
"webhookUrl": "https://merchant.example/webhooks/makepay",
}, makepay.PublicRequestOptions{})

Checkout URLs And Embeds

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

hostedURL, err:=client.HostedCheckoutURL("PAYMENT_LINK_UID")
embeddedURL, err:=client.EmbeddedCheckoutURL(
"PAYMENT_LINK_UID",
"https://merchant.example",
)
donationURL, err:=client.HostedDonationURL("spring-campaign")
embeddedDonationURL, err:=client.EmbeddedDonationURL(
"spring-campaign",
"https://merchant.example",
)
buttonHTML, err:=client.EmbedButtonHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
ButtonLabel: "Pay with crypto",
})
iframeHTML, err:=client.IframeHTML("PAYMENT_LINK_UID", makepay.EmbedSnippetOptions{
IframeTitle: "Secure MakePay checkout",
})
_, _, _, _, _, _=hostedURL, embeddedURL, donationURL, embeddedDonationURL, buttonHTML, iframeHTML

Customers And Subscriptions

customer, err:=client.UpsertCustomer(ctx, makepay.CustomerPayload{
"email": "buyer@example.com",
"name": "Buyer Example",
"clientId": "crm_123",
})
portal, err:=client.CreateCustomerPortal(ctx, "CUSTOMER_ID", map[string]any{
"returnUrl": "https://merchant.example/account",
})
subscription, err:=client.CreateSubscription(ctx, makepay.SubscriptionPayload{
"amountUsd": "29",
"customerEmail": "buyer@example.com",
"label": "Monthly plan",
"billingIntervalUnit": "month",
"billingIntervalCount": 1,
})
_, _, _=customer, portal, subscription

POS Terminals

terminal, err:=client.CreatePosTerminal(ctx, makepay.PosTerminalPayload{
"name": "Front counter",
"pin": "1234",
"allowedAssets": []string{"ETH.USDT-0xdAC17F958D2ee523a2206206994597C13D831ec7"},
"emailCollectionMode": "optional_after_deposit",
"catalogEnabled": true,
})
terminals, err:=client.ListPosTerminals(ctx)
detail, err:=client.GetPosTerminal(ctx, "TERMINAL_UID")
_, _, _=terminal, terminals, detail

Products And Simple Shop

product, err:=client.CreateProduct(ctx, makepay.ProductPayload{
"name": "Digital guide",
"productType": "digital",
"basePriceUsd": "19",
"shopSlug": "digital-guide",
"images": []map[string]any{
{"url": "https://merchant.example/guide.png", "alt": "Guide cover"},
},
"variants": []map[string]any{
{"name": "PDF", "priceUsd": "19"},
},
})
downloads, err:=client.CreateProductDownload(ctx, "PRODUCT_UID", map[string]any{
"fileName": "guide.pdf",
"contentType": "application/pdf",
"url": "https://merchant.example/downloads/guide.pdf",
})
shop, err:=client.UpdateShop(ctx, makepay.ShopPayload{
"slug": "merchant-shop",
"displayCurrency": "USD",
"checkoutMode": "hosted",
"branding": map[string]any{"accentColor": "#14b8a6"},
})
domain, err:=client.UpdateShopDomain(ctx, "shop.merchant.example")
refreshed, err:=client.RefreshShopDomain(ctx, nil)
coupon, err:=client.CreateShopCoupon(ctx, map[string]any{
"code": "SPRING10",
"discountType": "percent",
"value": "10",
})
orders, err:=client.ListShopOrders(ctx, map[string]any{"status": "paid", "limit": 25})
_, _, _, _, _, _, _=product, downloads, shop, domain, refreshed, coupon, orders

Invoices And Bookkeeping

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

created, err:=client.CreateBookkeepingInvoice(ctx, makepay.BookkeepingInvoicePayload{
"title": "Invoice #1042",
"currency": "USD",
"issueDate": "2026-05-15",
"dueDate": "2026-05-30",
"counterparty": map[string]any{
"name": "Buyer Example",
"email": "buyer@example.com",
"clientId": "crm_123",
},
"lineItems": []map[string]any{
{
"description": "Implementation services",
"quantity": "1",
"unitAmount": "500",
"taxAmount": "0",
},
},
"metadata": map[string]any{"orderId": "order_1042"},
})
_, err=client.CreateBookkeepingInvoicePaymentLink(ctx, "INVOICE_UID", map[string]any{
"sendPaymentRequestEmail": true,
})
_, _=created, err

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

expense, err:=client.CreateBookkeepingExpense(ctx, makepay.BookkeepingExpensePayload{
"title": "Hosting",
"amount": "49",
"currency": "USD",
"incurredOn": "2026-05-15",
"category": "Infrastructure",
"counterparty": map[string]any{"name": "Vendor Example", "type": "vendor"},
})
activityExpense, err:=client.CreateBookkeepingExpenseFromActivity(ctx, makepay.BookkeepingExpensePayload{
"walletActivityEventKey": "CHAIN_EVENT_KEY",
"category": "Settlement",
})
reconciliation, err:=client.CreateBookkeepingReconciliation(ctx, makepay.BookkeepingReconciliationPayload{
"invoiceId": "INVOICE_UID",
"paymentSessionId": "PAYMENT_SESSION_ID",
"linkType": "payment",
})
_, _, _=expense, activityExpense, reconciliation

Document uploads use multipart form data through an io.Reader.

file, err:=os.Open("receipt.pdf")
iferr!=nil {
returnerr
}
deferfile.Close()
uploaded, err:=client.UploadBookkeepingDocument(ctx, makepay.BookkeepingDocumentUpload{
File: file,
FileName: "receipt.pdf",
DocumentType: "receipt",
ExpenseID: "EXPENSE_UID",
})
documents, err:=client.ListBookkeepingDocuments(ctx)
download, err:=client.GetBookkeepingDocumentDownloadURL(ctx, "DOCUMENT_UID")
ocr, err:=client.RunBookkeepingDocumentOCR(ctx, "DOCUMENT_UID")
summary, err:=client.GetBookkeepingSummary(ctx)
_, _, _, _, _=uploaded, documents, download, ocr, summary

Branding And Domains

branding, err:=client.UpdateBranding(ctx, makepay.BrandingPayload{
"brandName": "Merchant",
"supportEmail": "support@merchant.example",
"brandingBrandColor": "#111827",
"brandingAccentColor": "#14b8a6",
"paymentLinkTheme": "system",
"paymentLinkDomain": "pay.merchant.example",
"emailSendingDomain": "mail.merchant.example",
})
refreshed, err:=client.RefreshBrandingDomains(ctx, "all")
_, _=branding, refreshed

Settings And Operational APIs

settings, err:=client.GetSettings(ctx)
updated, err:=client.UpdateSettings(ctx, map[string]any{
"callbackUrl": "https://merchant.example/webhooks/makepay",
})
assets, err:=client.ListDestinationAssets(ctx)
webhooks, err:=client.ListWebhookRequests(ctx, map[string]any{"limit": 25})
_, _, _, _=settings, updated, assets, webhooks

Verify Webhooks

Read the exact raw body before parsing JSON.

funchandleMakePayWebhook(writer http.ResponseWriter, request*http.Request) {
rawBody, err:=io.ReadAll(request.Body)
iferr!=nil {
http.Error(writer, "invalid body", http.StatusBadRequest)
return
}
event, err:=makepay.ParseWebhook(
rawBody,
request.Header.Get("x-makepay-signature"),
os.Getenv("MAKEPAY_WEBHOOK_SECRET"),
)
iferr!=nil {
http.Error(writer, "invalid signature", http.StatusUnauthorized)
return
}
ifevent["event"] !=nil {
// Update your local order status.
}
writer.WriteHeader(http.StatusOK)
}

Use VerifyWebhook when you only need a boolean result.

Method Coverage

AreaSDK methods
Payment linksCreatePaymentLink, ListPaymentLinks, GetPaymentLink, UpdatePaymentLink, SendPaymentRequestEmail
DonationsCreateDonationLink, ListDonationLinks, GetDonationLink, UpdateDonationLink
Anonymous linksCreateAnonymousPaymentLink
Checkouthosted, embedded, modal, button, iframe, and donation URL helpers
CustomersListCustomers, UpsertCustomer, CreateCustomerPortal
SubscriptionsListSubscriptions, CreateSubscription
POS terminalsListPosTerminals, CreatePosTerminal, GetPosTerminal, UpdatePosTerminal
ProductsListProducts, CreateProduct, GetProduct, UpdateProduct, ListProductDownloads, CreateProductDownload
Simple ShopGetShop, UpdateShop, GetShopBuilder, UpdateShopBuilder, domain, coupon, and order methods
Bookkeepingsummary, invoice, expense, document upload/OCR, and reconciliation methods
BrandingGetBranding, UpdateBranding, RefreshBrandingDomains
OperationsGetSettings, UpdateSettings, ListDestinationAssets, ListWebhookRequests
WebhooksVerifyWebhook, ParseWebhook

Payload And Response Models

The SDK keeps request payloads open-ended with map[string]any aliases because several MakePay surfaces are configurable and continue to gain fields. Send camelCase keys for new integrations. Some API routes may accept snake_case for compatibility, but camelCase is the stable SDK convention.

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 return decoded JSON objects as map[string]any so production can add response fields without breaking Go consumers.

Error Handling

API calls return *makepay.Error for API responses outside the 2xx range. It includes the HTTP status, decoded JSON response body, and raw response bytes.

response, err:=client.GetPaymentLink(ctx, "PAYMENT_LINK_UID")
iferr!=nil {
varmakePayError*makepay.Erroriferrors.As(err, &makePayError) {
log.Println(makePayError.StatusCode, makePayError.ResponseBody)
}
returnerr
}
_=response

Source Layout

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

About

Official Go SDK for MakePay. 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