Skip to main content

Overview

Collect Checkout provides a streamlined, hosted checkout solution that enables merchants to accept payments through a secure, gateway-hosted checkout page. This API integration method allows developers to programmatically create checkout sessions for dynamic payment flows.
This page covers the API integration method for developers. For a no-code solution using payment links, see Collect Checkout - No-Code.

Choose Your Integration Method

No-Code Payment Links

Create payment links instantly from your dashboard - no coding required

API Integration

Programmatically create checkout sessions (covered on this page)

Key Features

Quick Integration

Get started with minimal code

Hosted Solution

Gateway-hosted checkout reduces PCI scope

Mobile Optimized

Responsive design works on all devices

Secure Processing

Built-in security and fraud prevention

How It Works

1

Initiate Checkout

Your server creates a checkout session with the gateway
2

Redirect Customer

Redirect the customer to the hosted checkout page
3

Customer Completes Payment

Customer enters payment information on the secure hosted page
4

Return to Merchant

After payment, customer is redirected back to your site
5

Verify Transaction

Your server verifies the transaction result

Methodology

Collect Checkout uses a redirect-based approach similar to the Three Step Redirect API, but with a more streamlined checkout interface optimized for conversion. The checkout page is fully hosted by the gateway and includes:
  • Payment form with validation
  • Multiple payment method support
  • Mobile-responsive design
  • Automatic security features
  • Error handling and retry logic

Integration Method

<?php
// Step 1: Create checkout session
$url = "https://api.ionicfi.com/checkout.php";

$data = array(
    "security_key" => "YOUR_API_KEY",
    "amount" => "99.99",
    "order_description" => "Order #12345",
    "redirect_url" => "https://yoursite.com/success",
    "cancel_url" => "https://yoursite.com/cancel"
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

parse_str($response, $result);

// Step 2: Redirect to checkout
header("Location: " . $result['checkout_url']);
?>

Required Parameters

ParameterDescriptionFormat
security_keyYour API security keyString
amountTransaction amountx.xx
order_descriptionDescription of the purchaseString
redirect_urlSuccess redirect URLURL

Optional Parameters

ParameterDescriptionFormat
cancel_urlCancel redirect URLURL
customer_emailCustomer email addressEmail
billing_addressPre-fill billing addressObject
custom_fieldsMerchant-defined fieldsKey-value pairs

Response Handling

After payment completion, the customer is redirected to your redirect_url with transaction details:
https://yoursite.com/success?
  transaction_id=123456789&
  response=1&
  responsetext=SUCCESS&
  amount=99.99
Always verify the transaction on your server using the Query API. Never trust client-side parameters alone.

Standard Implementation

1

Create Checkout Session

Send a POST request to create the checkout session with transaction details
2

Store Session Reference

Save the session ID in your database for later verification
3

Redirect Customer

Redirect the customer to the checkout URL returned by the gateway
4

Handle Return

Process the customer when they return from the checkout page
5

Verify Transaction

Use the Query API to verify the transaction status

Customization Options

While Collect Checkout is a hosted solution, you can customize:
  • Logo and branding colors
  • Success and cancel messages
  • Required fields
  • Payment methods accepted
  • Receipt options
Contact your account representative to configure checkout page customization options.

Testing

Use test mode credentials to verify your integration:
  • Test amounts ending in .00 will approve
  • Test amounts ending in .01 will decline
  • Test amounts ending in .02 will trigger errors

Next Steps