Softech Blog
Digital Assets & Financial Infrastructure

How to Integrate CoinGate into a SaaS or B2B Platform

A production integration guide covering CoinGate orders, hosted checkout, callbacks, status mapping, idempotency, refunds, settlement and reconciliation.

5 min read
How to Integrate CoinGate into a SaaS or B2B Platform
Executive summary

The most important points from this article

A robust CoinGate integration keeps the provider order outside the core business domain. The application creates its own payment intent, maps it to CoinGate order_id, redirects to payment_url, processes callbacks idempotently, verifies status and amounts, updates the internal ledger and reconciles provider ledger/settlement records later.

Key takeaways
  • Keep your invoice/order ID and CoinGate order ID as separate identifiers.
  • Map provider states to your own product state machine.
  • Validate callback authenticity and re-fetch critical state when appropriate.
  • Treat refunds as their own lifecycle.
  • Build daily reconciliation from provider ledger transactions and settlement evidence.
Key insights

Key observations and insights

The key observations summarizing the experience, decisions and outcomes described in the article.

Do not make CoinGate order_id your product primary key.
A callback is a notification to verify state, not permission to blindly mutate business state.
Payment success and settlement completion are different states.
Reconciliation should use provider ledger transactions, not only webhook history.

Architecture first: CoinGate is the payment rail, not your domain model

The cleanest CoinGate integration puts a payment-orchestration layer between your business domain and the provider. Your invoice or order should not become a CoinGate object. It should have its own lifecycle and reference a separate payment intent.

A practical data chain is:

Business Order → Payment Intent → CoinGate Order → Payment Callback → Product Ledger → Settlement/Reconciliation.

Step 1: create a product-owned payment intent

Before calling CoinGate, create an internal record containing the customer, business object, expected price amount/currency, allowed payment method, expiry policy and a stable idempotency/reference key.

Do not use the provider ID as your primary business identifier. Provider migrations and retries become much easier when your system owns the reference.

Step 2: create the CoinGate order

CoinGate’s Create Order endpoint accepts the order price and currency, the settlement receive_currency, callback URL, return URLs and a merchant-defined token. It returns a payment_url for the hosted checkout.

For a typical B2B implementation, the business price can remain EUR while the customer chooses USDC in the provider checkout. Settlement can then follow the merchant configuration and provider capabilities.

Your fieldCoinGate conceptPurpose
paymentIntentIdorder_id/title/referenceCross-system correlation
amountDueprice_amountCommercial amount
currencyprice_currencyCommercial source-of-truth currency
settlementPreferencereceive_currencyMerchant settlement target
callbackSecrettokenCallback validation support

Step 3: redirect to hosted checkout

Hosted checkout is usually preferable for the first production version because the provider owns the supported asset/network presentation and payment instructions. It also keeps your application from hardcoding network-specific address/amount UX that can become stale.

Step 4: process callbacks idempotently

CoinGate documents callbacks when object state changes and also documents retries until the merchant endpoint returns success. It additionally supports callback replay from the dashboard. This means duplicate delivery is an expected system property, not an edge case.

Your callback handler should:

  1. authenticate/validate the notification using the configured integration mechanism,
  2. store an external event identifier or deterministic deduplication key,
  3. lock or transactionally load the payment intent,
  4. verify provider order identity, state, amount and currency context,
  5. apply an idempotent state transition,
  6. record an audit event,
  7. return success only after durable processing.

Step 5: map CoinGate status to product state

CoinGate currently documents statuses including new, pending, confirming, paid, invalid, expired, canceled and refund states. Do not mirror these directly as your only product state.

A better mapping is:

ProviderProduct paymentBusiness action
new/pendingAWAITING_PAYMENTNo entitlement
confirmingPAYMENT_DETECTEDShow progress only
paidPAIDCredit ledger / unlock according to policy
invalidMANUAL_REVIEW or FAILEDDo not credit automatically
expired/canceledCLOSEDCreate a new intent if needed

Step 6: verify before crediting

For critical payments, the callback should trigger state verification rather than blind trust. CoinGate’s Get Order endpoint provides detailed order information including payment amounts, conversion data, fees, refunds and blockchain transaction information. Use the data required by your risk model to verify the transition.

Step 7: update the internal ledger

When the business accepts the payment, create an immutable ledger event tied to the customer, invoice/order, payment intent and provider order. Keep provider status and product credit separate so support can tell whether a payment was received but not yet credited, credited but not settled, or refunded later.

Read the internal ledger guide for the data model.

Step 8: treat refunds as a separate lifecycle

A refund is not “set payment status back to unpaid”. It is a new financial event with its own amount, currency, destination, provider refund identifier, status and audit trail. CoinGate provides dedicated refund APIs and refund status callbacks.

Step 9: reconcile provider ledger and settlement

Callbacks tell you that state changed. Reconciliation proves that the financial movements match. CoinGate exposes ledger transactions with filters such as date, currency, transaction type and source, which makes them useful for scheduled reconciliation jobs.

A daily job should compare:

  1. product payments accepted during the window,
  2. CoinGate orders and ledger transactions,
  3. provider fees and refunds,
  4. withdrawal/settlement records,
  5. bank evidence where fiat settlement is used.

See the full stablecoin reconciliation guide.

Testing checklist

  • normal USDC payment,
  • duplicate callback delivery,
  • callback arrives out of order,
  • payment expires,
  • provider marks payment invalid/manual review,
  • application returns 500 and callback is replayed,
  • amount/reference mismatch,
  • full and partial refund,
  • reconciliation mismatch,
  • provider API temporarily unavailable.

Common anti-patterns

“Callback equals paid”

A callback is an input. Your system decides whether the business transition is valid.

“CoinGate status is our entire payment model”

Provider state is narrower than your business state. Your product may need separate entitlement, settlement, refund and manual-review states.

“No ledger because the provider has reporting”

Provider reporting cannot replace your own product record of why a customer was credited.

“Reconciliation later”

Later usually means after transaction volume is high enough to make missing references expensive.

Monitoring and observability

Expose metrics for orders created, checkout conversion, payments stuck in confirming, callback failures, callback processing latency, invalid payments, refund failures and settlement mismatches. Keep provider IDs searchable in the operator panel so support can move from a customer or invoice to the exact provider object without querying production databases manually.

Security boundary

Keep the CoinGate API token server-side, isolate it from browser code and scope access according to the provider configuration available to your account. Callback endpoints should be public HTTPS endpoints but should not accept business mutations from arbitrary payloads. Authentication, reference validation and idempotency must happen before any product credit.

Sandbox-to-production rollout

Use the provider sandbox to verify integration contracts, but create a production runbook before the first live payment. The runbook should cover callback replay, provider outage, failed refund, settlement delay, manual status verification and escalation ownership. Test with low-value live transactions before enabling the rail for all customers.

Where CoinGate fits best

CoinGate is a strong fit when the product wants managed crypto checkout and provider-side settlement capabilities while keeping business logic, entitlement and reconciliation inside the application. For the architecture decision itself, compare gateway vs custom wallet infrastructure.

Solution framework

Key elements and relationships

CoinGate Integration Boundary

Keep provider state behind a payment-orchestration layer.

Layer 1
Business order

Invoice, subscription or purchase.

Layer 2
Payment intent

Your immutable payment context.

Layer 3
CoinGate order

External execution object and payment_url.

Layer 4
Callback adapter

Authentication, deduplication, state verification and mapping.

Layer 5
Product ledger

Business acceptance and downstream actions.

Layer 6
Reconciliation

Provider ledger, fees, refunds and settlement evidence.

Evidence and context

Information supporting the analysis

USDC is described by Circle as an e-money token under MiCA for the EEA.

MiCA establishes an EU framework for crypto-assets and related services not already covered by other EU financial-services legislation.

CoinGate Create Order returns payment_url and supports callback_url, token, price/receive currencies and optional shopper data.

CoinGate documents callback retries until the merchant returns HTTP 200 or 204 and provides a dashboard tool to re-send callbacks.

CoinGate Get Order exposes payment, conversion, fee, refund and blockchain transaction information.

CoinGate exposes ledger transactions for reconciliation and supports filtering by date, currency, type and source.

CoinGate provides an API for merchant refunds linked to an order and ledger account.

FAQ

Should I trust a CoinGate callback as the final source of truth?
Treat the callback as an external event. Validate it, deduplicate it and verify the order state and amounts required by your business logic before crediting your internal ledger.
What CoinGate status should unlock the product?
Your business rule should map CoinGate’s status model to product state. CoinGate documents paid as confirmed and credited to the merchant; your product should still ensure the expected order, amount and currency context match.
Do I need reconciliation if CoinGate already has a dashboard?
Yes. Reconciliation is the process of matching your business records and internal ledger with provider transactions, fees, refunds and settlement evidence.
Continue reading

Related articles

Articles that expand the topic and add further practical context.

Author

Matt Dudzicz · Softech.app

Founder

Founder of Softech.app, focused on product engineering, digital asset infrastructure, custom software and AI-native business systems.

LinkedIn
Next step
Planning a CoinGate integration inside an existing product?
We map the order lifecycle, hosted checkout, callbacks, authoritative status checks, refunds and settlement reconciliation.