Overview
Base URL: https://crosspayonline.com/api
Integration model: your backend builds a signed payment URL (GET) and issues an HTTP redirect. Never expose your API key in the browser—generate URLs server-side only.
Quick start (Lahza / PaySky)
- Create a unique
invoice_id(your order ID). - Prepare
inv_detailsJSON (line items, info rows, customer). - Build the request URL using the endpoint for your payment method (e.g.
createInvoiceByAccountPaySky). - Redirect the customer to the generated URL.
- On
return_url, readinvoice_id,is_paid,transaction_idand update order status.
Common query parameters
All payment endpoints share the same parameters; only the path changes.
| Parameter | Type | Required | Notes |
|---|---|---|---|
api_data | string | Yes | Static value issued by CrossPay for your account. |
invoice_id | string | Yes | Your order / invoice ID; returned on redirect. |
apiKey | string | Yes | Merchant API key — server-side only. |
total | number | Yes | Amount, e.g. 10.00 |
currency | string | Yes | 3-letter code, e.g. USD |
inv_details | JSON (URL-encoded) | Yes | Invoice payload; must be URL-encoded in the query string. |
return_url | URL | Yes | HTTPS endpoint where the customer returns after payment. |
email | string | Optional | Customer email. |
mobail | string | Optional | Mobile number (parameter name is mobail per API contract). |
name | string | Optional | Customer full name. |
inv_details JSON
Keys: inv_items (line items), inv_info (VAT, delivery, discounts), user.userName. Field spellings match the live API contract.
{
"inv_items": [
{
"name": "Shopping from store",
"quntity": "1.00",
"unitPrice": "10.00",
"totalPrice": "10.00",
"currency": "USD"
}
],
"inv_info": [
{ "row_title": "Vat", "row_value": "0" },
{ "row_title": "Delevery", "row_value": "0" },
{ "row_title": "Promo Code", "row_value": 0 },
{ "row_title": "Discounts", "row_value": 0 }
],
"user": {
"userName": "Customer Name"
}
}
Endpoints (GET → redirect)
There must be no spaces after /api/ in the URL.
| Method | Endpoint |
|---|---|
| Cards | https://crosspayonline.com/api/createInvoiceByAccount |
| PayPal | https://crosspayonline.com/api/createInvoiceByAccountPaypal |
| Spaceremit | https://crosspayonline.com/api/createInvoiceByAccountSpaceremit |
| Lahza | https://crosspayonline.com/api/createInvoiceByAccountLahza |
| USDT | https://crosspayonline.com/api/createInvoiceByAccountUSDT |
| PaySky | https://crosspayonline.com/api/createInvoiceByAccountPaySky |
PaySky uses the same parameters and flow as Lahza; only the endpoint path changes.
Platform SDK — server samples
Use these patterns on your backend as your "SDK": build the query string with proper encoding, then redirect. Replace placeholders with your CrossPay credentials.
PHP (redirect)
<?php
$base = "https://crosspayonline.com/api/createInvoiceByAccountPaySky";
$invDetails = [
"inv_items" => [[
"name" => "Order #1001",
"quntity" => "1.00",
"unitPrice" => "10.00",
"totalPrice" => "10.00",
"currency" => "USD"
]],
"inv_info" => [
["row_title" => "Vat", "row_value" => "0"],
["row_title" => "Delevery", "row_value" => "0"],
],
"user" => ["userName" => "Customer Name"]
];
$params = [
"api_data" => "YOUR_API_DATA",
"invoice_id" => "ORDER-1001",
"apiKey" => "YOUR_API_KEY",
"total" => "10.00",
"currency" => "USD",
"inv_details" => json_encode($invDetails),
"return_url" => "https://merchant.com/payment/return",
"email" => "customer@mail.com",
"mobail" => "0590000000",
"name" => "Customer Name",
];
$url = $base . "?" . http_build_query($params);
header("Location: " . $url);
exit;
Node.js (Express redirect)
app.get("/pay", (req, res) => {
const base = "https://crosspayonline.com/api/createInvoiceByAccountPaySky";
const invDetails = {
inv_items: [{
name: "Order #1001",
quntity: "1.00",
unitPrice: "10.00",
totalPrice: "10.00",
currency: "USD"
}],
inv_info: [
{ row_title: "Vat", row_value: "0" },
{ row_title: "Delevery", row_value: "0" },
],
user: { userName: "Customer Name" }
};
const params = new URLSearchParams({
api_data: "YOUR_API_DATA",
invoice_id: "ORDER-1001",
apiKey: "YOUR_API_KEY",
total: "10.00",
currency: "USD",
inv_details: JSON.stringify(invDetails),
return_url: "https://merchant.com/payment/return",
email: "customer@mail.com",
mobail: "0590000000",
name: "Customer Name",
});
res.redirect(`${base}?${params.toString()}`);
});
Return URL contract
CrossPay appends query parameters when redirecting the customer back:
| Parameter | Description |
|---|---|
invoice_id | Same value you sent. |
is_paid | 1 = paid, 0 = unpaid. |
transaction_id | Payment reference. |
Example:
https://merchant.com/payment/return?invoice_id=ORDER-1001&is_paid=1&transaction_id=ABC123
Security & best practices
- Keep
apiKeyon the server only. - Always URL-encode
inv_detailsandreturn_url(http_build_query/URLSearchParams). - Use HTTPS for
return_url. - Log return query params for debugging (avoid sensitive data in logs).
Troubleshooting
| Issue | Fix |
|---|---|
| Payment page does not open | No spaces after /api/; verify query encoding. |
inv_details breaks URL | Ensure JSON is URL-encoded. |
| Missing return parameters | return_url must be public HTTPS and allow redirects. |