Skip to main content
Before you integrate, you need a Privex Pay merchant account with API credentials. See Account setup to create your account and retrieve your API key.

Integration options

REST API

Make direct HTTP requests to the Privex Pay API. Works with any language or framework.

Plugins

Install a pre-built plugin for your e-commerce platform — no custom code required.

How to integrate

1

Get your API credentials

Log in to your Privex Pay dashboard, navigate to Settings → API keys, and copy your secret key. Keep this value private — never expose it in client-side code.
2

Add Privex Pay to your codebase

Follow the code examples in this page or in your chosen documentation to create a payment session and redirect your customer to the hosted checkout.
3

Go live

Verify that your checkout flow completes end to end, then start accepting real payments.

Authentication

Pass your API key in the x-api-key header on every request. Keys start with pp_live_ and are created in the dashboard under Developers → API Keys.
x-api-key: pp_live_your_api_key

API integration

Send a POST with an items array. Each item needs a name, amount (per unit, in dollars), and optional quantity (defaults to 1). The total is computed automatically. Pass a single item for a one-product checkout, or many for a multi-line cart — same endpoint.

Create a payment session

curl --request POST \
  --url https://api.privexpay.com/api-checkouts \
  --header 'x-api-key: pp_live_your_api_key' \
  --header 'Content-Type: application/json' \
  --data '{
    "items": [
      { "name": "Pro plan", "amount": 49.99, "quantity": 1 },
      { "name": "Add-on seat", "amount": 9.99, "quantity": 2 }
    ],
    "currency": "USD",
    "success_url": "https://yoursite.com/thank-you",
    "active": true
  }'
const response = await fetch('https://api.privexpay.com/api-checkouts', {
  method: 'POST',
  headers: {
    'x-api-key': 'pp_live_your_api_key',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    items: [
      { name: 'Pro plan',    amount: 49.99, quantity: 1 },
      { name: 'Add-on seat', amount: 9.99,  quantity: 2 },
    ],
    currency: 'USD',
    success_url: 'https://yoursite.com/thank-you',
    active: true,
  }),
});

const { data } = await response.json();
window.location.href = data.checkout_url;
The API responds with a session object that includes a checkout_url. Redirect your customer to this URL to complete payment on the Privex Pay hosted checkout page.
Response
{
  "data": {
    "id": "b3f1c2d4-7e8a-4d2b-9f1c-1234567890ab",
    "merchant_id": "a1b2c3d4-...-uuid",
    "product_name": "Pro plan + 1 more",
    "amount": 69.97,
    "currency": "USD",
    "items": [
      { "name": "Pro plan", "amount": 49.99, "quantity": 1 },
      { "name": "Add-on seat", "amount": 9.99, "quantity": 2 }
    ],
    "active": true,
    "created_at": "2026-05-11T12:00:00Z",
    "checkout_url": "https://privexpay.com/pay/b3f1c2d4-7e8a-4d2b-9f1c-1234567890ab"
  }
}