Skip to content
EN
Book a demo

HomeGuides

How to Add Embedded Payments to a SaaS Product via API

How to add embedded payments to a SaaS product starts with two decisions made before any code: who is paying whom, and where the customer types the card. After that, the build is a short list of API calls, a few webhooks and a lot of testing.

On this page

This guide is for the product engineer or technical lead who owns the payment flow. It holds on any platform, whether you sell invoicing software, a booking tool or a vertical marketplace.

01Before you start

Payments inside a product touch legal, finance and engineering. Clear the questions in the table first, because answers change the integration, not just the paperwork.

What you need Who owns it Where it comes from
The payment model: your customers pay you, or your customers' customers pay them Product and legal Your pricing and your contracts
A payment provider, or several, with API documentation Payments engineer Your own vendor process
A decision on card data handling and the scope it creates Security lead PCI DSS rules and your auditor
The objects in your product that carry money: invoice, booking, plan Product engineer Your data model
A test environment and sample customers QA Your provider's sandbox

If your customers are businesses that get paid through your product, ask each provider early who onboards those businesses and who decides when one is turned away. That answer shapes your roadmap more than any endpoint does. Hosted pages, embedded fields and mobile SDKs differ in how much card data you touch, as the checkout integration options show.

02How to add embedded payments, step by step

  1. 01 Settle the payment model in one sentence

    Write it down, for example "our customer's buyer pays our customer, and the money lands in our customer's account" or "our customer pays us a subscription". These need different flows, different reports and sometimes different licenses.

    Legal and your provider decide the regulated parts. Don't guess. After this step, any engineer on the team can say whose money moves and who holds the account.

  2. 02 Choose where the card is entered

    You have three options. One is a hosted payment page you redirect to, another is input fields embedded in your own page, and the third is a mobile SDK inside your app. Each changes how much card data your systems can touch, and with it your PCI DSS scope.

    Read the PCI DSS standard summary on the PCI Security Standards Council site and ask your auditor which self-assessment applies to your choice.

    Embedded fields feel native, and a hosted page usually leaves you the smallest PCI DSS scope. Choose on the evidence, not on looks.

  3. 03 Map your objects to payment objects

    List what your product already knows, such as a customer, a plan, an invoice or a booking. Next to each, write the payment concept it triggers, such as a charge, a recurring charge, a refund or a payout to a seller. Decide which of your IDs you will send as a reference with every payment.

    You should end up with a one-page diagram that shows where a payment starts and where its result is written back.

  4. 04 Connect in a sandbox first

    Create the credentials, store them outside your code and make a first call that does nothing but authenticate. Then a test payment. Check the provider's API documentation for the exact request and response shapes, and never copy them from a blog.

    Use separate keys for test and live, with the narrowest role each needs. That way a test payment works from your staging environment, and a live key can't be used there by accident.

  5. 05 Configure methods, currencies and providers

    Decide which payment methods each customer segment sees, in which currencies and through which provider. Put these choices in configuration. A new market then becomes a settings change, not a code change.

    Start with the smallest useful set. Cards plus one local method in your biggest market beats ten methods you can't support.

  6. 06 Put the payment into the user's flow

    Place the payment where the user's intent is strongest, for instance at the end of an invoice or inside a seller's dashboard. Show the amount, the method and the result without a page jump if you can.

    Plan every state the user can land in, including a pending payment and an error the customer can recover from. A decline message that says what to do next beats one that says "failed".

  7. 07 Listen for status with webhooks

    The API response tells you what happened right now. A webhook tells you what changed later, which is how you learn a pending payment finally settled. Write a handler that checks the sender, stores the event, and is safe to run twice with the same message.

    Update your own records only from verified events. Then the customer's screen and your database agree even if the browser tab was closed.

  8. 08 Monitor, then widen the rollout

    Decide which numbers you watch, such as volume, declines by reason, time from request to result and webhook failures. Set alerts on the ones that mean lost money.

    Give support staff a view of payments with only the permissions they need. Then widen the rollout from a handful of customers to a segment, and then to everyone.

03Testing before real traffic

Run each case in the sandbox and then with a few real, low-value payments from your own team.

  • A successful payment writes the right status to your invoice or booking.
  • A declined card shows a recoverable message and creates no order.
  • A closed browser tab still ends with the correct status after the webhook arrives.
  • The same webhook delivered twice changes nothing the second time.
  • A refund updates your records and the customer's view.
  • A test key in a live environment is refused.

Keep a short table of the results, with the date and who ran each case. If a case fails in the live trial, you want the sandbox result next to it.

04Rolling back, and what goes wrong

Webhooks arrive out of order or twice. A "paid" event can reach you before the "pending" one. Store the provider's event time, ignore anything older than the state you already hold, and keep the raw message for audits. If statuses already look wrong in production, replay the stored events in order.

Conversion drops after you embed. Compare the new flow with the old one on the same customer segment before blaming the integration, because a changed layout or a missing method can do the same. Keep the old flow available behind a switch for the first weeks.

Card fields change your compliance scope without notice. A script added to the payment page by a marketing tool can read what customers type. Lock down what runs on that page and review it on every release.

Provider changes break your calls. Providers update their APIs, and a version you didn't track stops working. Pin the version you tested against, read the change notices and keep a test that runs every night against the sandbox.

05Where the platform does these steps

Steps 4, 5 and 7 are where one integration saves repeated work. We offer a single API connection for adding payments inside a platform, app, checkout or merchant portal.

You configure methods, providers, currencies and rules, and connect to your CRM, billing system or back office. Routing follows business logic, availability or cost. A JS SDK covers embedded card inputs, and status updates reach your back end by webhook.

The sandbox mirrors production settings, so your QA team can run every case without real transactions. Because the layer sits between your product and the providers, your code calls one embedded payments platform instead of one API per provider.

Implementation support is available. The payment model, the user flow and your own records stay yours.

06FAQ

How long does it take to integrate an embedded payments API?

The time depends on the model, the provider's documentation and your own testing, so no honest number fits every team. The API calls are the short part. Onboarding sellers, compliance review and the test cycle take longer. Ask providers for a plan with the steps listed, not a promise.

How do I choose an embedded payment platform?

Check who onboards your customers and who answers when one is declined. Read the API documentation before you sign. Ask which methods, currencies and providers you can configure without a code change, and whether a sandbox mirrors production.

Does embedded payments change my PCI DSS scope?

Yes, it can. Hosted pages keep card entry on the provider's side, while embedded fields and SDKs shift where the data passes. Ask your auditor which self-assessment fits the option you choose, and check what the platform's own certification covers.

How do I add embedded payments to my software platform?

Pick the payment model, choose where the card is entered, map your objects, connect in a sandbox, configure methods and providers, then handle webhooks and monitor. Follow the order above. Skipping the model decision or the webhook handler causes most of the late surprises.

Can I keep more than one provider behind one integration?

Yes. A layer between your product and the providers lets you add a second provider through configuration and route by method, currency or cost. Your product still calls one API, and the provider changes happen underneath.

Next step

Add payments without rebuilding your product

Embedded payments should feel like part of your product. If you want to map your own flow onto one integration, talk to our team.

Book a demo

Map your integrations onto one API

We look at the providers you run today and what moving them behind one API would take.