
Payment Gateway Integration API 2026: How to Pick One (Stripe, PayPal, NOWPayments, BTCPay)
Pick a payment gateway API in 2026: Stripe, PayPal, Square, NOWPayments, and BTCPay ranked on integration time, fees, idempotency, and webhook quality.
Key Takeaways
- Best developer experience: Stripe, deepest SDKs, idempotency built in, best docs in the industry. Not in payyd's tier system because it is a fiat-only processor that bans crypto-adjacent businesses.
- Cheapest at scale: NOWPayments [Gold tier], 0.5% flat, 300+ coins, HMAC-signed webhooks, 4 official SDKs, sandbox with parity
- Most sovereign: BTCPay Server [Bronze tier], self-hosted, 0% fees, Greenfield REST API, regtest sandbox
- Avoid for new builds: PayPal (fragmented API surface), Square (weaker DX than Stripe outside US in-person flows)
- Stripe vs NOWPayments on a 10,000 dollar sale: Stripe takes 290 dollars, NOWPayments takes 50. On a 100 dollar sale Stripe takes 3.20, NOWPayments takes 0.50. Pick based on AOV, not vibes.
- Hybrid stack: Stripe for US cards, NOWPayments for international and high-ticket, BTCPay for sovereignty-conscious customers. Three checkouts on the same site.
Table of Contents
- Choosing a payment gateway API in 2026
- The 5-API shortlist (scored)
- Stripe API: the incumbent (when it still wins)
- PayPal and Square: fiat alternatives
- NOWPayments API: the crypto challenger
- BTCPay Greenfield: full sovereignty
- Code snippets: same invoice, 3 different APIs
- Fees compared on $100 / $1k / $10k sales
- Pick by use case
- FAQ
Choosing a payment gateway API in 2026
For most of the last decade the developer answer to "which payment gateway API should I use" was "Stripe, unless you have a specific reason not to." That advice was correct because Stripe was the only API-first processor with first-class SDKs, a real sandbox, idempotency primitives, and dashboards your finance team could actually use. The alternatives (PayPal, Authorize.Net, Braintree) all felt like 2010 tooling wearing a 2025 wrapper.
In 2026 the calculus has shifted. Crypto payment APIs have matured to the point where NOWPayments and BTCPay Greenfield ship developer experience that is within striking distance of Stripe, at a tenth of the cost and with zero geographic restrictions. Square has improved its API but still feels in-person-first. PayPal's developer experience has not meaningfully improved since Braintree was acquired in 2013. So the right framing for a new build in 2026 is not "Stripe or not" but "which combination of these five APIs do I integrate, and why."
This guide scores five gateway APIs on the dimensions that actually matter to backend engineers: integration time, authentication model, webhook signing quality, idempotency support, sandbox parity, SDK count, and headline fee. Then it gives use-case verdicts (SaaS, marketplace, international, high-risk). If you have already decided you want crypto only, jump to the narrower crypto-only API comparison and the broader crypto payment API guide.
The 5-API shortlist (scored)
Every gateway in this table is genuinely a credible 2026 pick for at least one use case. The scores are payyd's editorial assessment from integrating each API on real projects. "Integration time" is the working invoice plus verified webhook on a vanilla Node or Python server.
| API | Tier (payyd) | Fee | Integration time | SDKs |
|---|---|---|---|---|
| Stripe | Not tiered (fiat-only) | 2.9% + $0.30 | ~30 min | 7 official |
| PayPal / Braintree | Not tiered (fiat-only) | 2.59% – 3.49% | 1 – 2 hours | 6 official, fragmented |
| Square | Not tiered (fiat-only) | 2.6% + $0.10 in-person | ~45 min | 6 official |
| NOWPayments | Gold | 0.5% | ~10 min | 4 official |
| BTCPay Server | Bronze | 0% | ~20 min (post-install) | Community: JS, PHP, Python, Ruby, Go |
Stripe, PayPal, and Square are not in payyd's tier system because payyd ranks crypto payment gateways. They are included here as the fiat reference points every developer evaluates against. NOWPayments and BTCPay carry their normal payyd tiers.
| Dimension | Stripe | PayPal | Square | NOWPayments | BTCPay |
|---|---|---|---|---|---|
| Auth model | Bearer secret key | OAuth2 client_credentials | Bearer access token | x-api-key header | API key (Greenfield) |
| Webhook signing | HMAC-SHA256 + timestamp | RSA cert chain | HMAC-SHA256 | HMAC-SHA512 | HMAC-SHA256 |
| Idempotency | Idempotency-Key header (24h) | PayPal-Request-Id | idempotency_key in body | Via payment_id natural key | Via orderId natural key |
| Sandbox parity | Full (test mode flag) | Separate sandbox.paypal.com | Full sandbox subdomain | Full sandbox.nowpayments | Full (Bitcoin regtest) |
| Crypto support | Via extension only | Limited (PYUSD, BTC) | No | 300+ coins native | BTC + altcoins native |
Stripe API: the incumbent (when it still wins)
Stripe is the gold standard for fiat-card payments and we will not pretend otherwise. The reasons are obvious to anyone who has integrated it: stripe.PaymentIntents.create() works the same way in Node, Python, Ruby, PHP, Java, .NET, and Go. The Idempotency-Key header is built into every mutating endpoint, so retries are safe by default. Webhook signing uses a timestamp-prefixed HMAC that prevents replay attacks. The sandbox is the same code path as production, just toggled by a key prefix, so there is no environment drift to debug.
Stripe also owns the surrounding tooling. Stripe CLI lets you forward webhooks to localhost during development. Stripe Tax handles VAT and US sales tax automatically. Stripe Radar plugs in fraud scoring at no extra config. For a SaaS that sells in USD to US customers, the integration economics are essentially "spend 30 minutes, ship a paying product."
Where Stripe loses: high-risk verticals (adult, gambling, some crypto-adjacent businesses, firearms, CBD in many states), which it bans under its Acceptable Use Policy. International FX, which costs roughly 2% on top of the 2.9% card fee for non-USD presentment. High-ticket sales where the percentage-based fee starts to hurt (a 10,000 dollar SaaS contract gives Stripe 290 dollars and the merchant 9,710). And anything where the customer specifically wants to pay in crypto, which Stripe addresses only through a Crypto extension (Pay With Crypto) that converts at checkout to USD before settlement, not a native crypto rail. For those use cases see our Stripe vs crypto gateways comparison.
PayPal and Square: fiat alternatives
PayPal / Braintree. The PayPal API surface is the most fragmented of the five. There is the original NVP/SOAP API (deprecated but still everywhere), the REST Orders v2 API, the Subscriptions v1 API, the Braintree Drop-In SDK (a separate product PayPal acquired), and PayPal Checkout JS (a browser SDK that wraps Orders v2). They all do similar things slightly differently. Authentication is OAuth2 client_credentials, which means an extra round trip on every workflow that has not cached the token. Webhook signing uses RSA verification against a published cert chain at api.paypal.com/v1/notifications/verify-webhook-signature, which is cryptographically sound but slower than HMAC and more bureaucratic to implement.
PayPal still wins one thing: consumer mindshare. For B2C marketplaces, gaming, freelance platforms, and secondhand commerce, a meaningful slice of buyers will only check out if PayPal is offered. The 2.59 to 3.49 percent fee reflects that demand. For B2B and SaaS we would skip it.
Square. Square is in-person-payments-first. Its API has improved dramatically since the 2022 rebuild, the Square Node SDK is genuinely pleasant, idempotency uses idempotency_key in the body of every mutating request, and webhook signing is HMAC-SHA256. But the headline fee structure (2.6% + 10 cents in-person, 2.9% + 30 cents online) is identical to Stripe online and Stripe is the better online tool. Square also charges 5 dollars per wire payout, which is silly in 2026 when ACH is free at every competitor. We recommend Square only if you also need its point-of-sale hardware and ecommerce in the same dashboard.
NOWPayments API: the crypto challenger
NOWPayments [Gold tier] is the crypto API closest in spirit to Stripe. The REST endpoints follow predictable verb-noun patterns (POST /v1/invoice, POST /v1/payment, GET /v1/payment/{id}), authentication is a simple x-api-key header (no OAuth dance), the sandbox at sandbox.nowpayments.io mirrors production with the same key format, and webhook signing uses HMAC-SHA512 over the JSON body in the x-nowpayments-sig header.
The four official SDKs (Node, Python, PHP, Java) wrap the REST API cleanly, and the documentation is the best in crypto payments. Where Stripe takes 30 minutes for a working invoice, NOWPayments takes about 10 because the surface area is smaller (you do not need to handle 3DS, address verification, or PCI compliance, the crypto rail does not have those concepts).
The trade-offs: only crypto, no fiat card option (which is exactly what you want if you are building for crypto-native customers, but a non-starter if you need to accept US cards). Idempotency works via the payment_id NOWPayments returns rather than a dedicated header, you persist that id against your internal order_id immediately and dedupe webhook events by it. The fee is 0.5% flat, which on a 10,000 dollar sale is 50 dollars vs Stripe's 290. Full review at NOWPayments review, sign-up via /go/nowpayments.
BTCPay Greenfield: full sovereignty
BTCPay Server [Bronze tier] is the open-source self-hosted option. The HTTP API is called Greenfield, it follows REST conventions with /api/v1/stores/{storeId}/invoices as the canonical endpoint, and authentication is an API key with scoped permissions (you can mint a key that only creates invoices, for example). Webhook signing is HMAC-SHA256 with a per-store secret. The sandbox is Bitcoin regtest, which is a full-parity local Bitcoin network you can run on your laptop, so you can test the entire confirmation flow without spending real BTC.
The integration time is about 20 minutes once your BTCPay instance is running. The catch is that running the instance itself takes 30 to 60 minutes on a 5 dollar VPS (see our BTCPay setup guide). Once it is up, the API is rock solid and the trade-off is clear: zero fees, full custody of your funds, no central operator that can deplatform you. Bronze tier in payyd's system because the lack of hosted support and SLA makes it the wrong call for non-technical merchants, but for sovereignty-conscious developers it is the right answer. Review: BTCPay Server.
Code snippets: same invoice, 3 different APIs
The clearest way to compare APIs is to look at the same task in each. Below are three implementations of "create a 100 dollar invoice." Notice the surface area difference, Stripe and NOWPayments are nearly identical in line count, BTCPay needs the store id but is otherwise comparable.
Stripe (Node SDK):
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
const session = await stripe.checkout.sessions.create({
mode: "payment",
payment_method_types: ["card"],
line_items: [{
price_data: {
currency: "usd",
product_data: { name: "Pro plan, 30 days" },
unit_amount: 10000, // $100.00 in cents
},
quantity: 1,
}],
success_url: "https://yoursite.com/success?session_id={CHECKOUT_SESSION_ID}",
cancel_url: "https://yoursite.com/cancel",
}, {
idempotencyKey: `order_${userId}_${Date.now()}`,
});
return { checkout_url: session.url };
NOWPayments (curl):
curl -X POST https://api.nowpayments.io/v1/invoice \
-H "x-api-key: $NOWPAYMENTS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"price_amount": 100,
"price_currency": "usd",
"pay_currency": "usdttrc20",
"order_id": "order_abc123",
"order_description": "Pro plan, 30 days",
"ipn_callback_url": "https://yoursite.com/webhook/nowpayments",
"success_url": "https://yoursite.com/success",
"cancel_url": "https://yoursite.com/cancel"
}'
# Response includes invoice_url to redirect the customer to
BTCPay Server Greenfield (curl):
curl -X POST https://btcpay.yourdomain.com/api/v1/stores/$STORE_ID/invoices \
-H "Authorization: token $BTCPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": "100",
"currency": "USD",
"metadata": {
"orderId": "order_abc123",
"itemDesc": "Pro plan, 30 days"
},
"checkout": {
"redirectURL": "https://yoursite.com/success",
"redirectAutomatically": true
}
}'
# Response includes checkoutLink for the customer
Notice three things. First, all three return a hosted checkout URL you redirect the customer to, none of them require you to handle card data or wallet UX directly. Second, idempotency is explicit in Stripe (header), implicit via natural key in NOWPayments (order_id) and BTCPay (orderId metadata). Third, none of these is meaningfully harder than the others, the perceived difficulty of crypto APIs is largely a myth left over from 2018.
Cut your payment fee by 80% on big invoices
NOWPayments, 0.5% flat fee, 300+ coins, 10-minute REST integration. Add it next to Stripe in an afternoon.
Sign Up for NOWPayments →Fees compared on $100 / $1k / $10k sales
Headline percentages bury the actual dollars. Below is the merchant cost on three sale sizes, assuming a US card transaction for Stripe/PayPal/Square and USDT-TRC20 for NOWPayments/BTCPay (the most common high-value crypto flow because TRC-20 network fees are roughly 1 dollar regardless of transaction size).
| API | $100 sale | $1,000 sale | $10,000 sale |
|---|---|---|---|
| Stripe | $3.20 (3.2%) | $29.30 (2.93%) | $290.30 (2.9%) |
| PayPal | $3.79 (3.79%) | $34.90 (3.49%) | $349.00 (3.49%) |
| Square (online) | $3.20 (3.2%) | $29.30 (2.93%) | $290.30 (2.9%) |
| NOWPayments [Gold] | $1.50 (0.5% + $1 net) | $6.00 (0.5% + $1 net) | $51.00 (0.5% + $1 net) |
| BTCPay Server [Bronze] | $1.00 (network only) | $1.00 (network only) | $1.00 (network only) |
At 10,000 dollar tickets the gap between Stripe (290 dollars) and NOWPayments (51 dollars) is enough that a single B2B SaaS contract pays for the entire crypto integration in fee savings. At 100 dollar tickets the absolute dollars are small enough that developer-experience preference often wins. The crossover is roughly the 500 dollar AOV mark, see the deeper crypto payment API guide for per-feature breakdowns.
Pick by use case
"I'm building a US SaaS with under 200 dollar AOV"
Stripe. The developer experience and tooling depth outweigh the 2.9% fee at this AOV, and your customers expect card checkout. Save NOWPayments and BTCPay for v2 once you have international demand.
"I'm building B2B SaaS with 1,000 dollar plus contracts"
Stripe primary, NOWPayments [Gold tier] secondary. Offer both at checkout. International customers, crypto-native buyers, and price-sensitive contracts will route to NOWPayments and save you 200 to 250 dollars per deal at 10k ticket sizes. The 10-minute NOWPayments add is net-positive on a single conversion.
"I'm building an international consumer marketplace"
Stripe + PayPal + NOWPayments. Three rails. Stripe captures most card volume. PayPal captures the buyer slice that demands it. NOWPayments captures the international and crypto-native slice, plus countries where card processing is unreliable. For a deeper crypto-payments view see best crypto payment gateways 2026.
"I'm in a high-risk vertical that Stripe will ban"
NOWPayments [Gold tier] primary, BTCPay Server [Bronze tier] as freeze-proof backup. Stripe is not an option, period. NOWPayments has explicit acceptance of adult, gambling, and high-risk verticals. Running BTCPay in parallel means if any custodial gateway ever changes its mind, you do not lose revenue while you re-platform.
"I'm running a subscription product"
Stripe Subscriptions or NOWPayments recurring. Stripe Subscriptions is the most polished subscription billing in the industry, full stop. For crypto-paid subscriptions see recurring crypto payments, NOWPayments handles recurring invoices via its API plus a webhook-driven renewal model. PayPal Subscriptions works but the API ergonomics are worse than Stripe's.
"I want zero counterparty risk on my payment infrastructure"
BTCPay Server [Bronze tier]. Self-hosted, non-custodial, 0% fees, no central operator that can suspend your account. The trade-off is operational, you run the server, you patch it, you handle backups. Bronze tier because of that overhead. See BTCPay setup guide.
FAQ
Which payment gateway API is easiest to integrate in 2026?
Stripe remains the easiest end to end. First-class SDKs in seven languages, best documentation in the industry, idempotency built into every mutating endpoint, and the test card numbers cover dozens of decline scenarios. A working Stripe checkout takes about 30 minutes from npm install to first paid invoice. NOWPayments is the crypto equivalent, working invoice in roughly 10 minutes via REST, though tooling depth is shallower.
Is the Stripe API really worth 2.9% plus 30 cents?
For most US SaaS and ecommerce yes, because the cost is dominated by card interchange any fiat processor must pay, and Stripe's developer experience, fraud tooling, and global reach are unmatched. The math changes at high tickets and internationally. On a 10,000 dollar invoice Stripe takes 290, NOWPayments takes 50. That gap is why crypto APIs are in the consideration set for serious B2B merchants now.
Can I use a crypto API alongside Stripe?
Yes, and many production stacks do. Stripe handles US card-paying customers. NOWPayments or BTCPay handle international, crypto-paying, and high-ticket customers because they avoid card interchange and chargebacks. The two coexist at the checkout layer, you expose both as payment method options and let the customer pick.
Which payment API has the best webhook signing?
Stripe leads with HMAC-SHA256 using a timestamped Stripe-Signature header and a 5-minute replay window. NOWPayments uses HMAC-SHA512 on the JSON body. BTCPay Server uses HMAC-SHA256 with a per-store secret. PayPal uses RSA against a published cert chain, slower but cryptographically equivalent. Square uses HMAC-SHA256. All five are production-grade. Avoid any gateway that puts the secret token in the URL query string.
How long does it take to integrate each payment gateway API?
Working invoice plus verified webhook, for an experienced backend developer with a webhook endpoint ready: Stripe 30 minutes, NOWPayments 10 minutes, BTCPay Server 20 minutes (post-install), Square 45 minutes, PayPal 1 to 2 hours (the API surface is fragmented). BTCPay's server install adds 30 to 60 minutes on a fresh VPS.
Does PayPal still make sense in 2026?
For consumer marketplaces where PayPal balance is a meaningful tender (gaming, freelance, secondhand), yes, despite the rough developer experience. For pure SaaS or B2B it adds friction without adding revenue, and the 2.59 to 3.49% fee is higher than Stripe in most countries. Recommend Stripe primary, PayPal only when customer research shows demand.
- Crypto Pay API Comparison: NOWPayments vs CoinGate vs BTCPay vs Plisio
- Crypto Payment API Guide: Architecture and Concepts
- Stripe vs Crypto Payment Gateways
- NOWPayments Review: Full API Walkthrough
- BTCPay Server Setup Guide: Self-Host in 30 Minutes
- Best Crypto Payment Gateways 2026
- Recurring Crypto Payments: Subscription Patterns
Affiliate disclosure: payyd.co earns a commission when readers sign up for NOWPayments through our /go/nowpayments link. We do not earn anything from Stripe, PayPal, Square, or BTCPay Server, and we recommend each of them above when they are the right fit for the reader's use case (Stripe for US-card SaaS, BTCPay for sovereignty-first builders). Our gateway tiering is based on payyd's editorial criteria, not commission rates.