Skip to main content

Overview

Cheqpay’s Hosted Payment Page (HPP) allows you to accept payments with minimal integration effort. Create a payment link with a single API call, then redirect customers to Cheqpay’s hosted checkout page where they can complete their payment securely.

Integration Flow

The Hosted Payment Page integration involves three main steps:
  1. Create Payment Link - Your backend creates a payment link via API
  2. Customer Checkout - Customer is redirected to Cheqpay’s hosted payment page
  3. Payment Completion - Customer is redirected back to your site with payment status

Before You Start

Prerequisites

  • Cheqpay merchant account with API credentials
  • Backend server to create payment links
  • Redirect URL endpoint to handle payment completion

Authentication

All API requests require authentication using your API key:
Create a payment link by making a POST request to the payment links endpoint. For complete API documentation, see the Create Payment Link API Reference.

Endpoint

Payment methods

Pass one or more methods in paymentMethods. Values are lowercase and must be enabled on your merchant account: You can offer a single method or let the customer choose if you have more than one method enabled on your merchant account, for example ["card", "spei", "paycash", "cie_cash_net"].

Request examples

For SPEI, PayCash, and CIE Cash Net, funds are confirmed asynchronously after the customer leaves checkout. Always confirm the final status with Get Invoice or webhooks—do not rely on cp_status alone for fulfillment.
See Card Payments, SPEI Transfers, PayCash Payments, and CIE Cash Net Payments for method-specific behavior, testing, and webhooks.

Response

Upon successful creation, you’ll receive a payment link object with a url field that you’ll use to redirect the customer. See the Create Payment Link API Reference for the complete response schema.
Use the url field from the response to redirect your customer to the payment page.

Step 2: Redirect Customer to Payment Page

Once you receive the payment link URL, redirect your customer to it:
Or on the server side:

Let Customers Cancel

Optionally set cancelUrl when creating the link. The hosted page then shows a “Cancel and return” link, and clicking it sends the customer back to that URL. No query parameters are added. App deep links (for example myapp://cart) are supported.

Step 3: Handle Payment Completion

After the customer completes payment (or cancels), Cheqpay redirects them back to your redirectUrl with query parameters:
  • cp_status - Payment status (success or failed)
  • cp_invoice_id - Invoice ID for retrieving payment details

Example Redirect URL

Handle the Redirect

Step 4: Retrieve Invoice Details

After payment completion, retrieve the invoice details to confirm the payment and get order information. For complete API documentation, see the Get Invoice API Reference.

Endpoint

The response includes invoice details such as order information, customer details, payment method, and status. See the Get Invoice API Reference for the complete response schema.

Best Practices

  • Always validate the cp_status and cp_invoice_id parameters on your server
  • Never trust client-side status - always verify by fetching invoice details
  • Use HTTPS for all redirect URLs
  • Store API keys securely on your backend, never expose them to the client
  • Handle network errors when creating payment links
  • Implement retry logic for failed API calls
  • Show user-friendly error messages
  • Log errors for debugging
  • Show a loading state while creating the payment link
  • Provide clear instructions during redirect
  • Handle payment completion gracefully
  • Send confirmation emails after successful payment

Testing

Use the staging environment for testing:

Next Steps