Skip to content
OnCharge.io
Developer docs

OnCharge developer docs

OnCharge gives your store a hosted card checkout, risk screening on every payment, dispute tools, and payouts released when the order is delivered. You integrate it with a few signed API calls from your server and either send the shopper to OnCharge's checkout page or embed it in yours. Card details are entered on OnCharge's page and never pass through your servers.

How it works#

  1. Create a checkout session. When the shopper is ready to pay, your server calls POST /api/v1/checkout/sessions with the amount, your order reference, a return URL and, for goods you ship, the shipping address. The request is signed with your API secret.
  2. Show the checkout. Redirect the shopper to the session's checkout URL, or embed it in an iframe on your own checkout page. See Checkout.
  3. Confirm the payment. OnCharge sends a signed webhook (payment.captured). Mark the order paid when it arrives.
  4. Ship and report tracking. Send the carrier and tracking number to POST /api/v1/shipments. OnCharge follows the package with the carrier.
  5. Get paid. The order's payout is released 1 day after the carrier confirms delivery to the checkout address. Orders with nothing to ship (digital goods and services) are paid 7 days after payment. See Shipments & payouts.

Choose your integration#

You runStart here
WooCommerceWooCommerce plugin: install, paste your keys, done. Shipping and tracking are reported automatically.
Magento 2Magento 2 module (beta)
WixWix integration (beta)
Next.jsNext.js guide
React single-page appReact guide
Any site with a server (PHP, Node, Python, …)HTML & iframe guide
Custom or headless commerceCustom & headless guide
An AI coding assistantBuild with AI: prompts, a Claude skill, a custom GPT and an MCP server

New to OnCharge? Follow the Quickstart first.

Key concepts#

Store. Each store has its own API keys, registered domains and webhook endpoint. Create stores and keys in the merchant portal at app.oncharge.io.

Server-side only. API requests are signed with your API secret, so they must come from your server. The browser only ever receives a checkout URL.

Amounts are integers in the currency's minor unit: 4900 is $49.00. Currencies are ISO 4217 codes such as USD.

Registered domains. The return_url must be on one of the store's registered domains, and only pages on those domains may embed the checkout.

Session statuses.

StatusMeaning
createdWaiting for the shopper.
pendingThe shopper has to complete an extra step.
authorizedApproved but not yet captured.
capturedPaid.
refusedDeclined.
cancelledCancelled before capture.
errorThe payment could not be completed.
expiredNot paid within 30 minutes.

Resources#