securepayAPI
securepayAPI accepts card payments through a drop-in widget, a hosted checkout page, or the Payment Intents API. Card security and 3-D Secure authentication are built in.
Create a payment and collect a card, end to end.
Drop a secure payment widget into your own site.
Send customers to a ready-made checkout page.
Plans, the first charge in the widget, renewals, variable pricing, cancellation.
The Payment Intents API for creating payments from your backend.
The agent handbook — the whole contract and the rules that decide money, written for your coding assistant.
How it works
With the embedded widget:
- Create a payment on your server with your secret key — you get back a
client_secret. - Collect the card in the browser with the embedded widget, using that
client_secret. 3-D Secure, Apple Pay and Google Pay run inside it. - Confirm on your server by reading the Payment Intent back, then fulfil. Webhooks keep you informed afterwards.
Your server is always the source of truth for the amount — the browser never decides what a customer is charged.
With a hosted checkout page there is no server code at all: you create a product in the dashboard and share its link; the price comes from the product and its coupons, and you learn about each payment from webhooks and the dashboard.
What you can build
- A custom checkout on your own pages using the embedded widget — with Apple Pay or Google Pay where the device supports it.
- Recurring payments: the widget takes the first charge and the customer's consent; the payment platform bills the following periods — fixed or variable price, trials, cancellation — see Recurring payments.
- A hosted page per product, shareable as a link, with Apple Pay.
- A catalog of products with prices, coupons and images.
Before you start
You need a securepayAPI merchant account and a pair of API keys: a publishable key (sp_client_…) for the browser and a secret key (sp_secret_…) for your server. Hosted checkout pages need no keys.
The Payment Intents API is currently v1 and supports payments in USD. Product prices can be set in USD, EUR or GBP. Dashboard invoices can be issued in USD, EUR, GBP, CAD or AUD; bank pay-ins are USD only, and USDC pay-ins need a USD or USDC invoice.
Building with an AI coding assistant
Give your assistant the agent handbook — markdown written to be read by a model, stating the complete contract of this documentation. The entry file links one chapter per area:
- Payment Intents and subscriptions
- SDK and embedded widget
- Webhooks, transactions and disputes
- Hosted checkout, products and hosted invoices
Everything in one file joins the entry and all chapters. How to use it.
Hosted invoice payment methods
Eligible hosted invoices can offer Bank Pay-ins (ACH debit, ACH transfer or wire) and USDC pay-ins. Use the issued invoice link unchanged and confirm that the invoice is paid before fulfillment. These are separate from the Payment Intents API and JavaScript SDK; availability depends on your account and environment configuration.