Direct API and transactions
A direct API integration lets you build and run the whole payment experience yourself. Instead of a hosted page collecting card details, your application collects them and sends them straight to the API for authorization, capture, refunds, and more.
It's the right choice when you need complete control over checkout, payment flows, and the interface, and you can take on more development work and more responsibility for security and compliance.
Features
With a direct API integration you can:
- Build fully custom payment forms and checkout experiences
- Add payments to web, mobile, or back-end applications
- Control authorization, capture, voids, refunds, and recurring payments
- Connect payments to order management, subscriptions, invoicing, and customer portals
- Own the presentation, validation, and customer interactions
Security and PCI compliance
With a direct integration, card data passes through your systems before it reaches the gateway, so you are responsible for protecting it and for meeting PCI DSS. This usually means a much larger PCI scope than hosted options. Before you choose this path, review:
- Your PCI DSS obligations
- How you store and transmit payment data
- Encryption and tokenization
- Application and infrastructure security controls
- Ongoing compliance monitoring and audits
Note
Transactions
Use the transactions API to create and manage payments across their whole life.
| Type | What it does | When to use it |
|---|---|---|
| Sale | Creates a payment and tries to authorize and capture it, based on your account setup | A customer buys something |
| Void | Cancels an earlier payment before it settles | You need to cancel quickly, without a refund |
| Refund | Returns all or part of a successful payment | The payment has already settled, so a void is no longer possible |
Common transaction flow
- 1Build the request. Include your credentials, order reference, amount, currency, payment details, and customer details as your integration needs.
- 2Send it to the transactions endpoint from your server over HTTPS, and keep your own reference IDs for tracking.
- 3Read the response: the transaction status, gateway references, and any decline or validation messages.
- 4Save the transaction ID and related references. You need them to void or refund later.
- 5Handle later updates. If you use notifications, update the final status in your system when it changes. See webhooks.
Key considerations
| Area | What to do |
|---|---|
| Retries | Use safe retry logic so a dropped connection never creates a duplicate payment |
| Validation and errors | Check required fields before sending, and turn decline codes into clear customer messages |
| Security | Protect your credentials, handle as little card data as possible, and follow PCI DSS |
| Reconciliation | Store order IDs, transaction IDs, timestamps, and amounts so finance and support can trace every payment |
Ready to try it? Send your first API request, then use the testing guide.
Gateway services in this section are provided through ONKORE's processing partner, Elavon. Developer accounts, sandbox and production credentials, the developer portal, and the merchant portal are provided by Elavon, so you'll see the Elavon name in those emails, portals, and API addresses. ONKORE remains your point of contact.
